{"id":2653,"date":"2024-03-25T17:22:59","date_gmt":"2024-03-25T08:22:59","guid":{"rendered":"https:\/\/technologyagency.net\/wordpress\/?p=2653"},"modified":"2024-03-25T17:23:01","modified_gmt":"2024-03-25T08:23:01","slug":"switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b","status":"publish","type":"post","link":"https:\/\/technologyagency.net\/wordpress\/2024\/03\/25\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\/","title":{"rendered":"Switch Expressions\u306b\u66f8\u304d\u63db\u3048\u308b"},"content":{"rendered":"\n<p>\u3057\u3070\u3089\u304f\u653e\u7f6e\u3057\u3066\u3044\u305f\u304c\u3001Java 14\u304b\u3089\u6b63\u5f0f\u306b\u8ffd\u52a0\u3055\u308c\u305fSwitch Expressions\u3001Java 21\u304b\u3089\u8ffd\u52a0\u3055\u308c\u305fPattern Matching for switch\u3067\u65e2\u5b58\u306e\u51e6\u7406\u3092\u66f8\u304d\u63db\u3048\u308b\u3053\u3068\u306b\u3057\u305f\u3002<\/p>\n\n\n\n<p>Java 11\u304b\u308921\u307e\u3067\u306e\u9593\u306eSwitch\u6587\u306e\u5927\u304d\u306a\u5909\u66f4\u306f\uff12\u3064\u3042\u3063\u3066\u3001\u5206\u3051\u3066\u8003\u3048\u305f\u65b9\u304c\u308f\u304b\u308a\u3084\u3059\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Java 14\u3067\u8ffd\u52a0\u3055\u308c\u305fSwitch Expressions<\/h2>\n\n\n\n<p>\u3053\u308c\u306b\u66f8\u304d\u63db\u3048\u308b\u3053\u3068\u306e\u30e1\u30ea\u30c3\u30c8\u306f2\u3064\u3068\u8003\u3048\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\uff11\uff0ebreak\u304c\u4e0d\u8981<\/h3>\n\n\n\n<p>Switch\u6587\u304b\u3089\u629c\u3051\u308b\u305f\u3081\u306ebreak\u304c\u4e0d\u8981\u306b\u306a\u3063\u305f\u3002break\u304c\u306a\u304f\u3066\u3082\u540c\u3058\u3088\u3046\u306b\u6a5f\u80fd\u3059\u308b\u3002<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">\u4f8b\uff09\u5909\u66f4\u524d<\/h5>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"switch (code) {\ncase 401, 403:\n    model.addAttribute(&quot;errorTitle&quot;, &quot;403&quot;);\n    break;\ncase 404:\n    model.addAttribute(&quot;errorTitle&quot;, &quot;404&quot;);\n    break;\ndefault:\n    model.addAttribute(&quot;errorTitle&quot;, &quot;error&quot;);\n}\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">switch<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">code<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">case<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">401<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">403<\/span><span style=\"color: #81A1C1\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">model<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">addAttribute<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">errorTitle<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">403<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">break;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">case<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">404<\/span><span style=\"color: #81A1C1\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">model<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">addAttribute<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">errorTitle<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">404<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">break;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">default:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">model<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">addAttribute<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">errorTitle<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">error<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h5 class=\"wp-block-heading\">\u5909\u66f4\u5f8c<\/h5>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"switch (code) {\ncase 401, 403 -&gt; model.addAttribute(&quot;errorTitle&quot;, &quot;403&quot;);\ncase 404 -&gt; model.addAttribute(&quot;errorTitle&quot;, &quot;404&quot;);\ndefault -&gt; model.addAttribute(&quot;errorTitle&quot;, &quot;error&quot;);\n};\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">switch<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">code<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">case<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">401<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">403<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">-&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">model<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">addAttribute<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">errorTitle<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">403<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">case<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">404<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">-&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">model<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">addAttribute<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">errorTitle<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">404<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">default<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">-&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">model<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">addAttribute<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">errorTitle<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">error<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><span style=\"color: #81A1C1\">;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\uff12\uff0e\u7121\u99c4\u306a\u8a18\u8ff0\u304c\u6e1b\u308b<\/h3>\n\n\n\n<p>break\u304c\u4e0d\u8981\u306b\u306a\u3063\u305f\u3053\u3068\u3082\u542b\u3081\u3066\u3001\u7121\u99c4\u306a\u8a18\u8ff0\u3092\u6e1b\u3089\u305b\u308b\u3002<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">\u4f8b\uff09\u5909\u66f4\u524d<\/h5>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"int multiple = 0;\n\nswitch (unitSign) {\ncase M_BYTE:\n    multiple = 1024 * 1024;\n    break;\ncase K_BYTE:\n    multiple = 1024;\n    break;\ncase BYTE:\n    multiple = 1;\n}\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">int<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">multiple<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">switch<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">unitSign<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">case<\/span><span style=\"color: #D8DEE9FF\"> M_BYTE<\/span><span style=\"color: #81A1C1\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    multiple <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1024<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">*<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1024<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">break;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">case<\/span><span style=\"color: #D8DEE9FF\"> K_BYTE<\/span><span style=\"color: #81A1C1\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    multiple <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1024<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">break;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">case<\/span><span style=\"color: #D8DEE9FF\"> BYTE<\/span><span style=\"color: #81A1C1\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    multiple <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h5 class=\"wp-block-heading\">\u5909\u66f4\u5f8c<\/h5>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"int multiple = switch (unitSign) {\ncase M_BYTE -&gt; 1024 * 1024;\ncase K_BYTE -&gt; 1024;\ncase BYTE -&gt; 1;\n};\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">int<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">multiple<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">switch<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">unitSign<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">case<\/span><span style=\"color: #D8DEE9FF\"> M_BYTE <\/span><span style=\"color: #8FBCBB\">-&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1024<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">*<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1024<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">case<\/span><span style=\"color: #D8DEE9FF\"> K_BYTE <\/span><span style=\"color: #8FBCBB\">-&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1024<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">case<\/span><span style=\"color: #D8DEE9FF\"> BYTE <\/span><span style=\"color: #8FBCBB\">-&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><span style=\"color: #81A1C1\">;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Java 21\u3067\u8ffd\u52a0\u3055\u308c\u305fPattern Matching for switch<\/h2>\n\n\n\n<p>\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u304c\u3001\u6b63\u76f4\u3059\u3050\u4f7f\u3044\u305d\u3046\u306a\u306e\u306fnull\u306e\u30c1\u30a7\u30c3\u30af\u304f\u3089\u3044\u3060\u308d\u3046\u304b\u3002<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">\u4f8b\uff09\u5909\u66f4\u524d<\/h5>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"public static FileConverter createConverter(FileType fileType) {\n    if (fileType == null) {\n        throw new FileException(&quot;errors.fileType&quot;);\n    }\n\n    switch (fileType) {\n    case XML:\n        return createXmlConverter();\n    case EXCEL:\n        return createExcelConverter();\n    case CSV:\n        return createCsvConverter();\n    default:\n        throw new FileException(&quot;errors.fileType&quot;);\n    }\n}\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">public<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">static<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">FileConverter<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">createConverter<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #8FBCBB\">FileType<\/span><span style=\"color: #D8DEE9FF\"> fileType<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">fileType <\/span><span style=\"color: #81A1C1\">==<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">null<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">throw<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">new<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">FileException<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">errors.fileType<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #ECEFF4\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">switch<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">fileType<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">case<\/span><span style=\"color: #D8DEE9FF\"> XML<\/span><span style=\"color: #81A1C1\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">return<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">createXmlConverter<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">case<\/span><span style=\"color: #D8DEE9FF\"> EXCEL<\/span><span style=\"color: #81A1C1\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">return<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">createExcelConverter<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">case<\/span><span style=\"color: #D8DEE9FF\"> CSV<\/span><span style=\"color: #81A1C1\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">return<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">createCsvConverter<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">default:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">throw<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">new<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">FileException<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">errors.fileType<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #ECEFF4\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h5 class=\"wp-block-heading\">\u5909\u66f4\u5f8c<\/h5>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"public static FileConverter createConverter(FileType fileType) {\n    return switch (fileType) {\n    case XML -&gt; createXmlConverter();\n    case EXCEL -&gt; createExcelConverter();\n    case CSV -&gt; createCsvConverter();\n    case null, default -&gt; throw new FileException(&quot;errors.fileType&quot;);\n    };\n}\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">public<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">static<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">FileConverter<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">createConverter<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #8FBCBB\">FileType<\/span><span style=\"color: #D8DEE9FF\"> fileType<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">return<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">switch<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">fileType<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">case<\/span><span style=\"color: #D8DEE9FF\"> XML <\/span><span style=\"color: #8FBCBB\">-&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">createXmlConverter<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">case<\/span><span style=\"color: #D8DEE9FF\"> EXCEL <\/span><span style=\"color: #8FBCBB\">-&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">createExcelConverter<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">case<\/span><span style=\"color: #D8DEE9FF\"> CSV <\/span><span style=\"color: #8FBCBB\">-&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">createCsvConverter<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">case<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">null<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">default<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">-&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">throw<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">new<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">FileException<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">errors.fileType<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #ECEFF4\">}<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u3057\u3070\u3089\u304f\u653e\u7f6e\u3057\u3066\u3044\u305f\u304c\u3001Java 14\u304b\u3089\u6b63\u5f0f\u306b\u8ffd\u52a0\u3055\u308c\u305fSwitch Expressions\u3001Java 21\u304b\u3089\u8ffd\u52a0\u3055\u308c\u305fPattern Matching for switch\u3067\u65e2\u5b58\u306e\u51e6\u7406\u3092\u66f8\u304d\u63db\u3048\u308b\u3053\u3068\u306b\u3057\u305f\u3002 Ja &hellip; <a href=\"https:\/\/technologyagency.net\/wordpress\/2024\/03\/25\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\/\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Switch Expressions\u306b\u66f8\u304d\u63db\u3048\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2653","post","type-post","status-publish","format-standard","hentry","category-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Switch Expressions\u306b\u66f8\u304d\u63db\u3048\u308b - I want to lead an easy life.<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/technologyagency.net\/wordpress\/2024\/03\/25\/switch-expressions\u306b\u66f8\u304d\u63db\u3048\u308b\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Switch Expressions\u306b\u66f8\u304d\u63db\u3048\u308b - I want to lead an easy life.\" \/>\n<meta property=\"og:description\" content=\"\u3057\u3070\u3089\u304f\u653e\u7f6e\u3057\u3066\u3044\u305f\u304c\u3001Java 14\u304b\u3089\u6b63\u5f0f\u306b\u8ffd\u52a0\u3055\u308c\u305fSwitch Expressions\u3001Java 21\u304b\u3089\u8ffd\u52a0\u3055\u308c\u305fPattern Matching for switch\u3067\u65e2\u5b58\u306e\u51e6\u7406\u3092\u66f8\u304d\u63db\u3048\u308b\u3053\u3068\u306b\u3057\u305f\u3002 Ja &hellip; &quot;Switch Expressions\u306b\u66f8\u304d\u63db\u3048\u308b&quot; \u306e\u7d9a\u304d\u3092\u8aad\u3080\" \/>\n<meta property=\"og:url\" content=\"https:\/\/technologyagency.net\/wordpress\/2024\/03\/25\/switch-expressions\u306b\u66f8\u304d\u63db\u3048\u308b\/\" \/>\n<meta property=\"og:site_name\" content=\"I want to lead an easy life.\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-25T08:22:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-25T08:23:01+00:00\" \/>\n<meta name=\"author\" content=\"hide6644\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"hide6644\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"5\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/technologyagency.net\\\/wordpress\\\/2024\\\/03\\\/25\\\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/technologyagency.net\\\/wordpress\\\/2024\\\/03\\\/25\\\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\\\/\"},\"author\":{\"name\":\"hide6644\",\"@id\":\"https:\\\/\\\/technologyagency.net\\\/wordpress\\\/#\\\/schema\\\/person\\\/a25355beaa102da2b2d79b00f5865b63\"},\"headline\":\"Switch Expressions\u306b\u66f8\u304d\u63db\u3048\u308b\",\"datePublished\":\"2024-03-25T08:22:59+00:00\",\"dateModified\":\"2024-03-25T08:23:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/technologyagency.net\\\/wordpress\\\/2024\\\/03\\\/25\\\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\\\/\"},\"wordCount\":26,\"commentCount\":0,\"articleSection\":[\"Java\"],\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/technologyagency.net\\\/wordpress\\\/2024\\\/03\\\/25\\\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/technologyagency.net\\\/wordpress\\\/2024\\\/03\\\/25\\\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\\\/\",\"url\":\"https:\\\/\\\/technologyagency.net\\\/wordpress\\\/2024\\\/03\\\/25\\\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\\\/\",\"name\":\"Switch Expressions\u306b\u66f8\u304d\u63db\u3048\u308b - I want to lead an easy life.\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/technologyagency.net\\\/wordpress\\\/#website\"},\"datePublished\":\"2024-03-25T08:22:59+00:00\",\"dateModified\":\"2024-03-25T08:23:01+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/technologyagency.net\\\/wordpress\\\/#\\\/schema\\\/person\\\/a25355beaa102da2b2d79b00f5865b63\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/technologyagency.net\\\/wordpress\\\/2024\\\/03\\\/25\\\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\\\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/technologyagency.net\\\/wordpress\\\/2024\\\/03\\\/25\\\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/technologyagency.net\\\/wordpress\\\/2024\\\/03\\\/25\\\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\\\/\\\/technologyagency.net\\\/wordpress\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Switch Expressions\u306b\u66f8\u304d\u63db\u3048\u308b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/technologyagency.net\\\/wordpress\\\/#website\",\"url\":\"https:\\\/\\\/technologyagency.net\\\/wordpress\\\/\",\"name\":\"I want to lead an easy life.\",\"description\":\"Technical Notes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/technologyagency.net\\\/wordpress\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/technologyagency.net\\\/wordpress\\\/#\\\/schema\\\/person\\\/a25355beaa102da2b2d79b00f5865b63\",\"name\":\"hide6644\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a5df48aece572798f5aacd2dd90331e28bd249c13f736badb5116e3d43c5d5e9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a5df48aece572798f5aacd2dd90331e28bd249c13f736badb5116e3d43c5d5e9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a5df48aece572798f5aacd2dd90331e28bd249c13f736badb5116e3d43c5d5e9?s=96&d=mm&r=g\",\"caption\":\"hide6644\"},\"url\":\"https:\\\/\\\/technologyagency.net\\\/wordpress\\\/author\\\/hide6644\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Switch Expressions\u306b\u66f8\u304d\u63db\u3048\u308b - I want to lead an easy life.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/technologyagency.net\/wordpress\/2024\/03\/25\/switch-expressions\u306b\u66f8\u304d\u63db\u3048\u308b\/","og_locale":"ja_JP","og_type":"article","og_title":"Switch Expressions\u306b\u66f8\u304d\u63db\u3048\u308b - I want to lead an easy life.","og_description":"\u3057\u3070\u3089\u304f\u653e\u7f6e\u3057\u3066\u3044\u305f\u304c\u3001Java 14\u304b\u3089\u6b63\u5f0f\u306b\u8ffd\u52a0\u3055\u308c\u305fSwitch Expressions\u3001Java 21\u304b\u3089\u8ffd\u52a0\u3055\u308c\u305fPattern Matching for switch\u3067\u65e2\u5b58\u306e\u51e6\u7406\u3092\u66f8\u304d\u63db\u3048\u308b\u3053\u3068\u306b\u3057\u305f\u3002 Ja &hellip; \"Switch Expressions\u306b\u66f8\u304d\u63db\u3048\u308b\" \u306e\u7d9a\u304d\u3092\u8aad\u3080","og_url":"https:\/\/technologyagency.net\/wordpress\/2024\/03\/25\/switch-expressions\u306b\u66f8\u304d\u63db\u3048\u308b\/","og_site_name":"I want to lead an easy life.","article_published_time":"2024-03-25T08:22:59+00:00","article_modified_time":"2024-03-25T08:23:01+00:00","author":"hide6644","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"hide6644","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"5\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/technologyagency.net\/wordpress\/2024\/03\/25\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\/#article","isPartOf":{"@id":"https:\/\/technologyagency.net\/wordpress\/2024\/03\/25\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\/"},"author":{"name":"hide6644","@id":"https:\/\/technologyagency.net\/wordpress\/#\/schema\/person\/a25355beaa102da2b2d79b00f5865b63"},"headline":"Switch Expressions\u306b\u66f8\u304d\u63db\u3048\u308b","datePublished":"2024-03-25T08:22:59+00:00","dateModified":"2024-03-25T08:23:01+00:00","mainEntityOfPage":{"@id":"https:\/\/technologyagency.net\/wordpress\/2024\/03\/25\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\/"},"wordCount":26,"commentCount":0,"articleSection":["Java"],"inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/technologyagency.net\/wordpress\/2024\/03\/25\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/technologyagency.net\/wordpress\/2024\/03\/25\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\/","url":"https:\/\/technologyagency.net\/wordpress\/2024\/03\/25\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\/","name":"Switch Expressions\u306b\u66f8\u304d\u63db\u3048\u308b - I want to lead an easy life.","isPartOf":{"@id":"https:\/\/technologyagency.net\/wordpress\/#website"},"datePublished":"2024-03-25T08:22:59+00:00","dateModified":"2024-03-25T08:23:01+00:00","author":{"@id":"https:\/\/technologyagency.net\/wordpress\/#\/schema\/person\/a25355beaa102da2b2d79b00f5865b63"},"breadcrumb":{"@id":"https:\/\/technologyagency.net\/wordpress\/2024\/03\/25\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/technologyagency.net\/wordpress\/2024\/03\/25\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/technologyagency.net\/wordpress\/2024\/03\/25\/switch-expressions%e3%81%ab%e6%9b%b8%e3%81%8d%e6%8f%9b%e3%81%88%e3%82%8b\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/technologyagency.net\/wordpress\/"},{"@type":"ListItem","position":2,"name":"Switch Expressions\u306b\u66f8\u304d\u63db\u3048\u308b"}]},{"@type":"WebSite","@id":"https:\/\/technologyagency.net\/wordpress\/#website","url":"https:\/\/technologyagency.net\/wordpress\/","name":"I want to lead an easy life.","description":"Technical Notes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/technologyagency.net\/wordpress\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/technologyagency.net\/wordpress\/#\/schema\/person\/a25355beaa102da2b2d79b00f5865b63","name":"hide6644","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/secure.gravatar.com\/avatar\/a5df48aece572798f5aacd2dd90331e28bd249c13f736badb5116e3d43c5d5e9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a5df48aece572798f5aacd2dd90331e28bd249c13f736badb5116e3d43c5d5e9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a5df48aece572798f5aacd2dd90331e28bd249c13f736badb5116e3d43c5d5e9?s=96&d=mm&r=g","caption":"hide6644"},"url":"https:\/\/technologyagency.net\/wordpress\/author\/hide6644\/"}]}},"_links":{"self":[{"href":"https:\/\/technologyagency.net\/wordpress\/wp-json\/wp\/v2\/posts\/2653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/technologyagency.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/technologyagency.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/technologyagency.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/technologyagency.net\/wordpress\/wp-json\/wp\/v2\/comments?post=2653"}],"version-history":[{"count":22,"href":"https:\/\/technologyagency.net\/wordpress\/wp-json\/wp\/v2\/posts\/2653\/revisions"}],"predecessor-version":[{"id":2675,"href":"https:\/\/technologyagency.net\/wordpress\/wp-json\/wp\/v2\/posts\/2653\/revisions\/2675"}],"wp:attachment":[{"href":"https:\/\/technologyagency.net\/wordpress\/wp-json\/wp\/v2\/media?parent=2653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/technologyagency.net\/wordpress\/wp-json\/wp\/v2\/categories?post=2653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/technologyagency.net\/wordpress\/wp-json\/wp\/v2\/tags?post=2653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}