{"id":17796373,"url":"https://github.com/d-plaindoux/suitcase","last_synced_at":"2026-01-10T10:18:17.141Z","repository":{"id":8905647,"uuid":"10629287","full_name":"d-plaindoux/suitcase","owner":"d-plaindoux","description":"Java Pattern Matching library","archived":true,"fork":false,"pushed_at":"2023-11-09T02:29:56.000Z","size":739,"stargazers_count":21,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-13T16:23:26.025Z","etag":null,"topics":["pattern-matching"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d-plaindoux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-06-11T19:38:48.000Z","updated_at":"2024-08-07T12:37:52.000Z","dependencies_parsed_at":"2024-10-27T11:52:45.765Z","dependency_job_id":"e414ff0d-4f51-4646-ae51-44f826474cee","html_url":"https://github.com/d-plaindoux/suitcase","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-plaindoux%2Fsuitcase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-plaindoux%2Fsuitcase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-plaindoux%2Fsuitcase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-plaindoux%2Fsuitcase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d-plaindoux","download_url":"https://codeload.github.com/d-plaindoux/suitcase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243961730,"owners_count":20375295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pattern-matching"],"created_at":"2024-10-27T11:45:13.189Z","updated_at":"2026-01-10T10:18:17.068Z","avatar_url":"https://github.com/d-plaindoux.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SuitCase \n\nNote: With Java 21+ this project is finally obsolete!\n\n[![Coverage Status](https://coveralls.io/repos/d-plaindoux/suitcase/badge.png)](https://coveralls.io/r/d-plaindoux/suitcase)\n[![Maven Central](https://img.shields.io/maven-central/v/org.smallibs/suitcase.svg)](http://search.maven.org/#artifactdetails%7Corg.smallibs%7Csuitcase%7C0.3%7Cjar)\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nSuitCase is a convenient Java library dedicated to object manipulation using `pattern matching` mechanism.\n\n## Quick Overview\n\nIf you want to manipulate object based on types in Java the dedicated design pattern is the visitor.\nUnfortunately even if such pattern is well known its implementation is always painful because it implies\ncode dissemination and finally brakes incremental compilation approach.\n\nIn addition such mechanism only enables selection based on types and does not provides a simple and\nintuitive mechanism filtering objects using their values i.e. attributes.\n\nFor this purpose a simple pattern matching inspired by Scala \n[extractor object](http://docs.scala-lang.org/tutorials/tour/extractor-objects.html) has been designed.\n\nThis pattern matching offers a simple mechanism for simple object selection based on intrinsic equality.\nIndeed pattern matching cases can be done on the object kind and it's internal state. For instance the following \nsample checks if an integer is \u003ctt\u003eO\u003c/tt\u003e or not.\n\n``` java\nMatcher\u003cInteger, Boolean\u003e isZero = Matcher.match();\n\nisZero.caseOf(0).then(true);\nisZero.caseOf(Any()).then(false);\n\nisZero.match(0); // == true\n```\n\n## Regexp, List Patterns and more ...\n\nMore information and descriptions are given in the [Wiki](https://github.com/d-plaindoux/suitcase/wiki) and in \nparticular ad-hoc case is explained with practical implementations covering matching for lists, string regular \nexpression, XML etc.\n\n## Releases\n\nThis library is available at Sonatype OSS Repository Hosting service and can be simply used adding the following \ndependency to your pom project.\n\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.smallibs\u003c/groupId\u003e\n  \u003cartifactId\u003esuitcase\u003c/artifactId\u003e\n  \u003cversion\u003e0.3\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Presentation\n\nA [presentation (in french)](http://www.slideshare.net/dplaindoux/java-amp-le-pattern-matching-54806648) has been given \nduring a [Toulouse Java User Group](http://toulousejug.org) session.\n\n## Other Propositions \u0026 Discussions\n   \nA review of various approaches is given in the [Structural Pattern Matching in Java](http://blog.higher-order.com/blog/2009/08/21/structural-pattern-matching-in-java/). \nIt starts from the visitor and proposes alternatives with a functional programming approach.\n\nSome propositions like [Towards Pattern Matching in Java](http://kerflyn.wordpress.com/2012/05/09/towards-pattern-matching-in-java/)\nor [Java 8 annotation processor and framework](https://github.com/derive4j/derive4j) for deriving algebraic data types constructors, \npattern-matching, morphisms are also available.\n\n## License\n\nCopyright (C)2015 D. Plaindoux.\n\nThis program is  free software; you can redistribute  it and/or modify\nit  under the  terms  of  the GNU  Lesser  General  Public License  as\npublished by  the Free Software  Foundation; either version 2,  or (at\nyour option) any later version.\n\nThis program  is distributed in the  hope that it will  be useful, but\nWITHOUT   ANY  WARRANTY;   without  even   the  implied   warranty  of\nMERCHANTABILITY  or FITNESS  FOR  A PARTICULAR  PURPOSE.  See the  GNU\nLesser General Public License for more details.\n\nYou  should have  received a  copy of  the GNU  Lesser General  Public\nLicense along with  this program; see the file COPYING.  If not, write\nto the  Free Software Foundation,  675 Mass Ave, Cambridge,  MA 02139,\nUSA.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-plaindoux%2Fsuitcase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd-plaindoux%2Fsuitcase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-plaindoux%2Fsuitcase/lists"}