{"id":15964792,"url":"https://github.com/mechero/jdk12-switch-expressions","last_synced_at":"2025-04-04T13:17:00.173Z","repository":{"id":90103159,"uuid":"164333264","full_name":"mechero/jdk12-switch-expressions","owner":"mechero","description":"Example code of the Switch Expressions preview feature in Java 12","archived":false,"fork":false,"pushed_at":"2019-01-07T06:35:44.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-09T22:47:14.847Z","etag":null,"topics":["java","java12","switch-expressions"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mechero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-01-06T18:17:49.000Z","updated_at":"2019-08-28T04:45:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"a3140bbe-9f3b-4b70-88bc-0986f4260bf1","html_url":"https://github.com/mechero/jdk12-switch-expressions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mechero%2Fjdk12-switch-expressions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mechero%2Fjdk12-switch-expressions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mechero%2Fjdk12-switch-expressions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mechero%2Fjdk12-switch-expressions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mechero","download_url":"https://codeload.github.com/mechero/jdk12-switch-expressions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182424,"owners_count":20897381,"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":["java","java12","switch-expressions"],"created_at":"2024-10-07T17:20:59.558Z","updated_at":"2025-04-04T13:17:00.158Z","avatar_url":"https://github.com/mechero.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JDK 12 Switch Expressions Example\n\nThis project contains code examples comparing the classic Java switch statement with the new preview feature available in Java 12, Switch Expressions.\n\nFor the quick how-to and explanation, check out the article [Java 12 Switch Expressions in 5 minutes](https://thepracticaldeveloper.com/2019/01/07/java-12-switch-expressions-5-minutes/).\n\n## Build with maven\n\nFirst, make sure your JAVA_HOME variable points to a JDK 12 distribution, same as your PATH if needed.\n\nTo build the code and generate the JAR package using Maven, run:\n\n`mvn clean package`\n\n## Run from command line\n\nFrom the project's root directory, you can run:\n\n`java --enable-preview -jar target/jdk12preview-1.0.0-SNAPSHOT.jar`\n\nIf you want to run the `ClassicSwitch` code, you have two options:\n\n1. Pass the class to Java: `java --enable-preview -cp \"./target/classes\" io.tpd.SwitchExpressions`\n2. Change the `MANIFEST.MF` file contents to point to `io.tpd.SwitchExpressions`, re-build and execute the jar file again.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmechero%2Fjdk12-switch-expressions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmechero%2Fjdk12-switch-expressions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmechero%2Fjdk12-switch-expressions/lists"}