{"id":579,"date":"2022-10-28T01:54:36","date_gmt":"2022-08-25T11:36:46","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8benum\/"},"modified":"2025-08-01T00:46:10","modified_gmt":"2025-07-31T15:46:10","slug":"java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8benum","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8benum\/","title":{"rendered":"Java\u306b\u304a\u3051\u308bEnum"},"content":{"rendered":"<p>Java 1.5\u3067\u3001\u5b9a\u6570\u306e\u56fa\u5b9a\u30bb\u30c3\u30c8\u304b\u3089\u306a\u308b\u65b0\u3057\u3044\u30bf\u30a4\u30d7\u3068\u3057\u3066Enum\u304c\u5c0e\u5165\u3055\u308c\u307e\u3057\u305f\u3002\u4f8b\u3048\u3070\u3001Java Enum\u3068\u3057\u3066\u65b9\u89d2\u3092EAST\u3001WEST\u3001NORTH\u3001\u305d\u3057\u3066SOUTH\u3068\u3044\u3046\u56fa\u5b9a\u30d5\u30a3\u30fc\u30eb\u30c9\u3067\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>Java\u306e\u5217\u6319\u578b<\/h2>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/6564965fdaa94e2bdf7bfae9\/2-0.jpg\" alt=\"java enum, enums in java\" \/><\/div>\n<h2>Java Enum \u306e\u4f8b<\/h2>\n<p>Java\u306eenum\u30ad\u30fc\u30ef\u30fc\u30c9\u306f\u3001enum\u30bf\u30a4\u30d7\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002Java\u306eenum\u306e\u4f8b\u984c\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.enums;\r\n\r\npublic enum ThreadStates {\r\n\tSTART,\r\n\tRUNNING,\r\n\tWAITING,\r\n\tDEAD;\r\n}\r\n<\/code><\/pre>\n<p>\u4e0a\u8a18\u306e\u4f8b\u3067\u306f\u3001ThreadStates\u306f\u56fa\u5b9a\u306e\u5b9a\u6570\u30d5\u30a3\u30fc\u30eb\u30c9\u3001\u300cSTART\u300d\u3001\u300cRUNNING\u300d\u3001\u300cWAITING\u300d\u304a\u3088\u3073\u300cDEAD\u300d\u3092\u6301\u3064\u5217\u6319\u578b\u3067\u3059\u3002<\/p>\n<h2>Java\u306eEnum\u3068\u5b9a\u6570\u306e\u9055\u3044\u306f\u4f55\u3067\u3059\u304b\uff1f<\/h2>\n<p>\u3055\u3066\u3001Java\u306eenum\u304c\u901a\u5e38\u306e\u5b9a\u6570\u30d5\u30a3\u30fc\u30eb\u30c9\u3088\u308a\u3082\u512a\u308c\u3066\u3044\u308b\u306e\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002Java\u30af\u30e9\u30b9\u3067\u4f3c\u305f\u3088\u3046\u306a\u5b9a\u6570\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.enums;\r\n\r\npublic class ThreadStatesConstant {\r\n\tpublic static final int START = 1;\r\n\tpublic static final int WAITING = 2;\r\n\tpublic static final int RUNNING = 3;\r\n\tpublic static final int DEAD = 4;\r\n}\r\n<\/code><\/pre>\n<p>\u3067\u306f\u3001Java\u30d7\u30ed\u30b0\u30e9\u30e0\u3067enum\u3068\u5b9a\u6570\u304c\u3069\u306e\u3088\u3046\u306b\u4f7f\u308f\u308c\u308b\u304b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"post-pre\"><code>\/**\r\n* This method shows the benefit of using Enum over Constants\r\n*\/\r\nprivate static void benefitsOfEnumOverConstants() {\r\n\t\/\/Enum values are fixed\r\n\tsimpleEnumExample(ThreadStates.START);\r\n\tsimpleEnumExample(ThreadStates.WAITING);\r\n\tsimpleEnumExample(ThreadStates.RUNNING);\r\n\tsimpleEnumExample(ThreadStates.DEAD);\r\n\tsimpleEnumExample(null);\r\n\t\t\r\n\tsimpleConstantsExample(1);\r\n\tsimpleConstantsExample(2);\r\n\tsimpleConstantsExample(3);\r\n\tsimpleConstantsExample(4);\r\n\t\/\/we can pass any int constant\r\n\tsimpleConstantsExample(5);\r\n}\r\n\r\nprivate static void simpleEnumExample(ThreadStates th) {\r\n\tif(th == ThreadStates.START) System.out.println(\"Thread started\");\r\n\telse if (th == ThreadStates.WAITING) System.out.println(\"Thread is waiting\");\r\n\telse if (th == ThreadStates.RUNNING) System.out.println(\"Thread is running\");\r\n\telse System.out.println(\"Thread is dead\");\r\n}\r\n\t\r\nprivate static void simpleConstantsExample(int i) {\r\n\tif(i == ThreadStatesConstant.START) System.out.println(\"Thread started\");\r\n\telse if (i == ThreadStatesConstant.WAITING) System.out.println(\"Thread is waiting\");\r\n\telse if (i == ThreadStatesConstant.RUNNING) System.out.println(\"Thread is running\");\r\n\telse System.out.println(\"Thread is dead\");\r\n}\r\n<\/code><\/pre>\n<p>\u4e0a\u8a18\u306e\u4f8b\u3092\u898b\u308b\u3068\u3001\u5b9a\u6570\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306b\u306f\u89e3\u6c7a\u3067\u304d\u306a\u30442\u3064\u306e\u30ea\u30b9\u30af\u304c\u3042\u308a\u307e\u3059\u304c\u3001enum\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u305d\u308c\u3089\u3092\u89e3\u6c7a\u3067\u304d\u307e\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u30b7\u30f3\u30d7\u30eb\u306a\u5b9a\u6570\u306e\u4f8b\u30e1\u30bd\u30c3\u30c9\u306b\u306f\u4efb\u610f\u306eint\u5b9a\u6570\u3092\u6e21\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001simpleEnumExample\u306b\u306f\u56fa\u5b9a\u5024\u306e\u307f\u3092\u6e21\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u306e\u3067\u3001\u578b\u306e\u5b89\u5168\u6027\u304c\u63d0\u4f9b\u3055\u308c\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>ThreadStatesConstant\u30af\u30e9\u30b9\u306eint\u5b9a\u6570\u306e\u5024\u3092\u5909\u66f4\u3057\u3066\u3082\u3001\u4e0a\u8a18\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u4f8b\u5916\u3092\u30b9\u30ed\u30fc\u3057\u307e\u305b\u3093\u3002\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u4e88\u671f\u3057\u306a\u3044\u52d5\u4f5c\u3092\u3059\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001enum\u5b9a\u6570\u3092\u5909\u66f4\u3059\u308b\u3068\u3001\u5b9f\u884c\u6642\u306e\u554f\u984c\u306e\u53ef\u80fd\u6027\u3092\u6392\u9664\u3059\u308b\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/ol>\n<h2>Java\u306eenum\u306e\u30e1\u30bd\u30c3\u30c9<\/h2>\n<p>\u3067\u306f\u3001\u4f8b\u3092\u4f7f\u3063\u3066Java\u306eenum\u306e\u3055\u3089\u306a\u308b\u6a5f\u80fd\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.enums;\r\n\r\nimport java.io.Closeable;\r\nimport java.io.IOException;\r\n\r\n\/**\r\n * This Enum example shows all the things we can do with Enum types\r\n *\r\n *\/\r\npublic enum ThreadStatesEnum implements Closeable{\r\n\tSTART(1){\r\n\t\t@Override\r\n\t\tpublic String toString(){\r\n\t\t\treturn \"START implementation. Priority=\"+getPriority();\r\n\t\t}\r\n\r\n\t\t@Override\r\n\t\tpublic String getDetail() {\r\n\t\t\treturn \"START\";\r\n\t\t}\r\n\t},\r\n\tRUNNING(2){\r\n\t\t@Override\r\n\t\tpublic String getDetail() {\r\n\t\t\treturn \"RUNNING\";\r\n\t\t}\r\n\t},\r\n\tWAITING(3){\r\n\t\t@Override\r\n\t\tpublic String getDetail() {\r\n\t\t\treturn \"WAITING\";\r\n\t\t}\r\n\t},\r\n\tDEAD(4){\r\n\t\t@Override\r\n\t\tpublic String getDetail() {\r\n\t\t\treturn \"DEAD\";\r\n\t\t}\r\n\t};\r\n\t\r\n\tprivate int priority;\r\n\t\r\n\tpublic abstract String getDetail();\r\n\t\/\/Enum constructors should always be private.\r\n\tprivate ThreadStatesEnum(int i){\r\n\t\tpriority = i;\r\n\t}\r\n\t\r\n\t\/\/Enum can have methods\r\n\tpublic int getPriority(){\r\n\t\treturn this.priority;\r\n\t}\r\n\t\r\n\tpublic void setPriority(int p){\r\n\t\tthis.priority = p;\r\n\t}\r\n\t\r\n\t\/\/Enum can override functions\r\n\t@Override\r\n\tpublic String toString(){\r\n\t\treturn \"Default ThreadStatesConstructors implementation. Priority=\"+getPriority();\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void close() throws IOException {\r\n\t\tSystem.out.println(\"Close of Enum\");\r\n\t}\r\n}\r\n<\/code><\/pre>\n<h2>Java\u306e\u5217\u6319\u578b\u306e\u91cd\u8981\u306a\u30dd\u30a4\u30f3\u30c8<\/h2>\n<p>\u4ee5\u4e0b\u306f\u3001Java\u306b\u304a\u3051\u308bEnums\u306e\u91cd\u8981\u306a\u30dd\u30a4\u30f3\u30c8\u306e\u4e00\u90e8\u3067\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u3059\u3079\u3066\u306eJava\u306e\u5217\u6319\u578b\u306f\u3001\u6697\u9ed9\u7684\u306bjava.lang.Enum\u30af\u30e9\u30b9\u3092\u62e1\u5f35\u3057\u3066\u304a\u308a\u3001\u3053\u306e\u30af\u30e9\u30b9\u306fObject\u30af\u30e9\u30b9\u3092\u62e1\u5f35\u3057\u3001Serializable\u3068Comparable\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u5217\u6319\u578b\u3067\u306f\u4ed6\u306e\u30af\u30e9\u30b9\u3092\u62e1\u5f35\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>\u5217\u6319\u578b\u306f\u30ad\u30fc\u30ef\u30fc\u30c9\u306a\u306e\u3067\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u306e\u672b\u5c3e\u306b\u306f\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\u3002\u4f8b\u3048\u3070com.scdev.enum\u306f\u6709\u52b9\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u5217\u6319\u578b\u306f\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u4e0a\u8a18\u306e\u5217\u6319\u578b\u306e\u4f8b\u3067\u306fCloseable\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5217\u6319\u578b\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306f\u5e38\u306bprivate\u3067\u3059\u3002<\/p>\n<p>new\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3057\u3066\u5217\u6319\u578b\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>Java\u306e\u5217\u6319\u578b\u3067\u306f\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u3092\u5ba3\u8a00\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001\u305d\u306e\u5834\u5408\u306f\u5168\u3066\u306e\u5217\u6319\u578b\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u305d\u306e\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u88c5\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002\u4e0a\u8a18\u306e\u4f8b\u3067\u306fgetDetail()\u304c\u62bd\u8c61\u30e1\u30bd\u30c3\u30c9\u3067\u3042\u308a\u3001\u5168\u3066\u306e\u5217\u6319\u578b\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u305d\u308c\u3092\u5b9f\u88c5\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5217\u6319\u578b\u5185\u3067\u30e1\u30bd\u30c3\u30c9\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u5217\u6319\u578b\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3082\u305d\u308c\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001toString()\u30e1\u30bd\u30c3\u30c9\u306f\u5217\u6319\u578b\u3067\u5b9a\u7fa9\u3055\u308c\u3001\u5217\u6319\u578b\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3067\u3042\u308bSTART\u3067\u3082\u305d\u308c\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Java\u306e\u5217\u6319\u578b\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u306f\u540d\u524d\u7a7a\u9593\u304c\u3042\u308a\u3001ThreadStates.START\u306e\u3088\u3046\u306b\u30af\u30e9\u30b9\u540d\u3068\u5171\u306b\u5217\u6319\u578b\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u5217\u6319\u578b\u306fswitch\u6587\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u5f8c\u534a\u3067\u5b9f\u969b\u306e\u4f7f\u7528\u4f8b\u3092\u898b\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u65e2\u5b58\u306e\u5217\u6319\u578b\u3092\u62e1\u5f35\u3059\u308b\u3053\u3068\u306f\u3001\u65e2\u5b58\u306e\u6a5f\u80fd\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u3053\u3068\u306a\u304f\u53ef\u80fd\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001ThreadStates\u5217\u6319\u578b\u306b\u65b0\u3057\u3044\u30d5\u30a3\u30fc\u30eb\u30c9NEW\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u5217\u6319\u578b\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306f\u5b9a\u6570\u3067\u3042\u308a\u3001Java\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3067\u306f\u5927\u6587\u5b57\u3068\u30a2\u30f3\u30c0\u30fc\u30b9\u30b3\u30a2\u3092\u4f7f\u7528\u3057\u3066\u547d\u540d\u3059\u308b\u3053\u3068\u304c\u63a8\u5968\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u4f8b\u3048\u3070EAST\u3001WEST\u3001EAST_DIRECTION\u306a\u3069\u3067\u3059\u3002<\/p>\n<p>\u5217\u6319\u578b\u306e\u5b9a\u6570\u306f\u6697\u9ed9\u7684\u306bstatic\u304a\u3088\u3073final\u3067\u3059\u3002<\/p>\n<p>\u5217\u6319\u578b\u306e\u5b9a\u6570\u306ffinal\u3067\u3059\u304c\u3001\u305d\u306e\u5909\u6570\u306f\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001setPriority()\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u5217\u6319\u578b\u306e\u5b9a\u6570\u306e\u512a\u5148\u5ea6\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u4f8b\u3067\u305d\u308c\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u5217\u6319\u578b\u306e\u5b9a\u6570\u306ffinal\u306a\u306e\u3067\u3001\u300c==\u300d\u6f14\u7b97\u5b50\u3084equals()\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u5b89\u5168\u306b\u6bd4\u8f03\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4e21\u8005\u306e\u7d50\u679c\u306f\u540c\u3058\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>Java\u306eEnumSet\u3001EnumMap\u3001valueOf()<\/h2>\n<p>Enum\u306e\u307b\u3068\u3093\u3069\u306e\u6a5f\u80fd\u3092\u77e5\u3063\u3066\u3044\u308b\u306e\u3067\u3001Java\u306eEnum\u306e\u4f8b\u984c\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u305d\u306e\u5f8c\u3001enum\u306e\u3055\u3089\u306a\u308b\u6a5f\u80fd\u306b\u3064\u3044\u3066\u5b66\u3073\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.enums;\r\n\r\nimport java.io.IOException;\r\nimport java.util.EnumMap;\r\nimport java.util.EnumSet;\r\nimport java.util.Set;\r\n\r\npublic class JavaEnumExamples {\r\n\r\n\tpublic static void main(String[] args) throws IOException {\r\n\t\t\t\t\r\n\t\tusingEnumMethods();\r\n\t\t\r\n\t\tusingEnumValueOf();\r\n\t\t\r\n\t\tusingEnumValues();\r\n\t\t\r\n\t\tusingEnumInSwitch(ThreadStatesEnum.START);\r\n\t\tusingEnumInSwitch(ThreadStatesEnum.DEAD);\r\n\t\t\r\n\t\tusingEnumMap();\r\n\t\t\r\n\t\tusingEnumSet();\r\n\t\t\r\n\t}\r\n\r\n\tprivate static void usingEnumSet() {\r\n\t\tEnumSet enumSet = EnumSet.allOf(ThreadStatesEnum.class);\r\n\t\tfor(ThreadStatesEnum tsenum : enumSet){\r\n\t\t\tSystem.out.println(\"Using EnumSet, priority = \"+tsenum.getPriority());\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static void usingEnumMap() {\r\n\t\tEnumMap&lt;ThreadStatesEnum, String&gt; enumMap = new EnumMap&lt;ThreadStatesEnum,String&gt;(ThreadStatesEnum.class);\r\n\t\tenumMap.put(ThreadStatesEnum.START, \"Thread is started\");\r\n\t\tenumMap.put(ThreadStatesEnum.RUNNING, \"Thread is running\");\r\n\t\tenumMap.put(ThreadStatesEnum.WAITING, \"Thread is waiting\");\r\n\t\tenumMap.put(ThreadStatesEnum.DEAD, \"Thread is dead\");\r\n\t\t\r\n\t\tSet keySet = enumMap.keySet();\r\n\t\tfor(ThreadStatesEnum key : keySet){\r\n\t\t\tSystem.out.println(\"key=\"+key.toString()+\":: value=\"+enumMap.get(key));\r\n\t\t}\r\n\t\t\r\n\t}\r\n\r\n\tprivate static void usingEnumInSwitch(ThreadStatesEnum th) {\r\n\t\tswitch (th){\r\n\t\tcase START:\r\n\t\t\tSystem.out.println(\"START thread\");\r\n\t\t\tbreak;\r\n\t\tcase WAITING:\r\n\t\t\tSystem.out.println(\"WAITING thread\");\r\n\t\t\tbreak;\r\n\t\tcase RUNNING:\r\n\t\t\tSystem.out.println(\"RUNNING thread\");\r\n\t\t\tbreak;\r\n\t\tcase DEAD:\r\n\t\t\tSystem.out.println(\"DEAD thread\");\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static void usingEnumValues() {\r\n\t\tThreadStatesEnum[] thArray = ThreadStatesEnum.values();\r\n\t\t\r\n\t\tfor(ThreadStatesEnum th : thArray){\r\n\t\t\tSystem.out.println(th.toString() + \"::priority=\"+th.getPriority());\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static void usingEnumValueOf() {\r\n\t\tThreadStatesEnum th = Enum.valueOf(ThreadStatesEnum.class, \"START\");\r\n\t\tSystem.out.println(\"th priority=\"+th.getPriority());\r\n\t}\r\n\r\n\tprivate static void usingEnumMethods() throws IOException {\r\n\t\tThreadStatesEnum thc = ThreadStatesEnum.DEAD;\r\n\t\tSystem.out.println(\"priority is:\"+thc.getPriority());\r\n\t\t\r\n\t\tthc = ThreadStatesEnum.DEAD;\r\n\t\tSystem.out.println(\"Using overriden method.\"+thc.toString());\r\n\t\t\r\n\t\tthc = ThreadStatesEnum.START;\r\n\t\tSystem.out.println(\"Using overriden method.\"+thc.toString());\r\n\t\tthc.setPriority(10);\r\n\t\tSystem.out.println(\"Enum Constant variable changed priority value=\"+thc.getPriority());\r\n\t\tthc.close();\r\n\t}\r\n\r\n}\r\n<\/code><\/pre>\n<p>enum\u306e\u4ed6\u306e\u91cd\u8981\u306a\u6a5f\u80fd\u3092\u8aac\u660e\u3059\u308b\u524d\u306b\u3001\u4e0a\u8a18\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u51fa\u529b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"post-pre\"><code>priority is:4\r\nUsing overriden method.Default ThreadStatesConstructors implementation. Priority=4\r\nUsing overriden method.START implementation. Priority=1\r\nEnum Constant variable changed priority value=10\r\nClose of Enum\r\nth priority=10\r\nSTART implementation. Priority=10::priority=10\r\nDefault ThreadStatesConstructors implementation. Priority=2::priority=2\r\nDefault ThreadStatesConstructors implementation. Priority=3::priority=3\r\nDefault ThreadStatesConstructors implementation. Priority=4::priority=4\r\nSTART thread\r\nDEAD thread\r\nkey=START:: value=Thread is started\r\nkey=RUNNING:: value=Thread is running\r\nkey=WAITING:: value=Thread is waiting\r\nkey=DEAD:: value=Thread is dead\r\nUsing EnumSet, priority = 10\r\nUsing EnumSet, priority = 2\r\nUsing EnumSet, priority = 3\r\nUsing EnumSet, priority = 4\r\n<\/code><\/pre>\n<h2>\u91cd\u8981\u306a\u30dd\u30a4\u30f3\u30c8<\/h2>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>usingEnumMethods\uff08\uff09\u30e1\u30bd\u30c3\u30c9\u306f\u3001enum\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u3001\u305d\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u307e\u305f\u3001setPriority\uff08int i\uff09\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066enum\u306e\u5909\u6570\u3092\u5909\u66f4\u3059\u308b\u65b9\u6cd5\u3082\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>usingEnumValueOf\uff08\uff09\u306f\u3001java.util.Enum valueOf\uff08enumType\u3001name\uff09\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u793a\u3057\u3066\u304a\u308a\u3001\u3053\u308c\u3092\u4f7f\u7528\u3057\u3066\u6587\u5b57\u5217\u304b\u3089enum\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002\u6307\u5b9a\u3055\u308c\u305fenum\u30bf\u30a4\u30d7\u306b\u6307\u5b9a\u3055\u308c\u305f\u540d\u524d\u306e\u5b9a\u6570\u304c\u306a\u3044\u5834\u5408\u3001\u307e\u305f\u306f\u6307\u5b9a\u3055\u308c\u305f\u30af\u30e9\u30b9\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304cenum\u30bf\u30a4\u30d7\u3092\u8868\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u3001IllegalArgumentException\u304c\u30b9\u30ed\u30fc\u3055\u308c\u307e\u3059\u3002\u307e\u305f\u3001\u5f15\u6570\u306e\u3044\u305a\u308c\u304b\u304cnull\u306e\u5834\u5408\u3001NullPointerException\u304c\u30b9\u30ed\u30fc\u3055\u308c\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>usingEnumValues\uff08\uff09\u30e1\u30bd\u30c3\u30c9\u306f\u3001enum\u306e\u5024\u3092\u5ba3\u8a00\u3055\u308c\u305f\u9806\u5e8f\u3067\u542b\u3080\u914d\u5217\u3092\u8fd4\u3059values\uff08\uff09\u30e1\u30bd\u30c3\u30c9\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u3001java\u306e\u30b3\u30f3\u30d1\u30a4\u30e9\u306b\u3088\u3063\u3066\u81ea\u52d5\u7684\u306b\u751f\u6210\u3055\u308c\u308b\u305f\u3081\u3001java.util.Enum\u30af\u30e9\u30b9\u306evalues\uff08\uff09\u306e\u5b9f\u88c5\u306f\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>usingEnumInSwitch\uff08\uff09\u30e1\u30bd\u30c3\u30c9\u306f\u3001enum\u5b9a\u6570\u3092switch\u30b1\u30fc\u30b9\u3067\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>usingEnumMap\uff08\uff09\u30e1\u30bd\u30c3\u30c9\u306f\u3001Java 1.5\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u5c0e\u5165\u3055\u308c\u305fjava.util.EnumMap\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002EnumMap\u306f\u3001enum\u578b\u30ad\u30fc\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306eMap\u5b9f\u88c5\u3067\u3059\u3002Enum\u30de\u30c3\u30d7\u306e\u3059\u3079\u3066\u306e\u30ad\u30fc\u306f\u3001\u30de\u30c3\u30d7\u304c\u4f5c\u6210\u3055\u308c\u308b\u3068\u304d\u306b\u660e\u793a\u7684\u307e\u305f\u306f\u6697\u9ed9\u306b\u6307\u5b9a\u3055\u308c\u308b\u5358\u4e00\u306eenum\u30bf\u30a4\u30d7\u304b\u3089\u6765\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002EnumMap\u3067\u306f\u30ad\u30fc\u3068\u3057\u3066null\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u305a\u3001EnumMap\u306f\u540c\u671f\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>usingEnumSet\uff08\uff09\u30e1\u30bd\u30c3\u30c9\u306f\u3001Java\u306e java.util.EnumSet\u3092\u4f7f\u7528\u3057\u305fSet\u5b9f\u88c5\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002Enum\u30bb\u30c3\u30c8\u306e\u3059\u3079\u3066\u306e\u8981\u7d20\u306f\u3001\u30bb\u30c3\u30c8\u304c\u4f5c\u6210\u3055\u308c\u308b\u3068\u304d\u306b\u660e\u793a\u7684\u307e\u305f\u306f\u6697\u9ed9\u306b\u6307\u5b9a\u3055\u308c\u308b\u5358\u4e00\u306eenum\u30bf\u30a4\u30d7\u304b\u3089\u6765\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002EnumSet\u306f\u540c\u671f\u3055\u308c\u3066\u304a\u3089\u305a\u3001null\u8981\u7d20\u306f\u8a31\u53ef\u3055\u308c\u307e\u305b\u3093\u3002\u307e\u305f\u3001Collection c\u306ecopyOf\uff08\uff09\u30e1\u30bd\u30c3\u30c9\u3001of\uff08E first\u3001E &#8230; rest\uff09\u30e1\u30bd\u30c3\u30c9\u3001\u304a\u3088\u3073complementOf\uff08EnumSet s\uff09\u30e1\u30bd\u30c3\u30c9\u306a\u3069\u3001\u3044\u304f\u3064\u304b\u306e\u4fbf\u5229\u306a\u30e1\u30bd\u30c3\u30c9\u3082\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002<\/ol>\n<p>\u79c1\u305f\u3061\u306eGitHub\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089\u3001\u3059\u3079\u3066\u306e\u4f8b\u3092\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u53c2\u7167\u5148\uff1a\u30aa\u30e9\u30af\u30eb\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Java 1.5\u3067\u3001\u5b9a\u6570\u306e\u56fa\u5b9a\u30bb\u30c3\u30c8\u304b\u3089\u306a\u308b\u65b0\u3057\u3044\u30bf\u30a4\u30d7\u3068\u3057\u3066Enum\u304c\u5c0e\u5165\u3055\u308c\u307e\u3057\u305f\u3002\u4f8b\u3048\u3070\u3001Java Enum\u3068\u3057\u3066\u65b9\u89d2\u3092EAST\u3001WEST\u3001NORTH\u3001\u305d\u3057\u3066SOUTH\u3068\u3044\u3046\u56fa\u5b9a\u30d5\u30a3\u30fc\u30eb\u30c9\u3067\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26,61],"class_list":["post-579","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-26","tag-61"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java\u306b\u304a\u3051\u308bEnum - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"Java\u306b\u304a\u3051\u308bEnum\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/ja\/blog\/java\u306b\u304a\u3051\u308benum\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java\u306b\u304a\u3051\u308bEnum\" \/>\n<meta property=\"og:description\" content=\"Java\u306b\u304a\u3051\u308bEnum\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/java\u306b\u304a\u3051\u308benum\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-25T11:36:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T15:46:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/6564965fdaa94e2bdf7bfae9\/2-0.jpg\" \/>\n<meta name=\"author\" content=\"\u6d77\u6597, \u8475\" \/>\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=\"\u6d77\u6597, \u8475\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"22\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8benum\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8benum\/\",\"name\":\"Java\u306b\u304a\u3051\u308bEnum - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2022-08-25T11:36:46+00:00\",\"dateModified\":\"2025-07-31T15:46:10+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6\"},\"description\":\"Java\u306b\u304a\u3051\u308bEnum\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8benum\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8benum\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8benum\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\u306b\u304a\u3051\u308bEnum\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6\",\"name\":\"\u6d77\u6597, \u8475\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g\",\"caption\":\"\u6d77\u6597, \u8475\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/kaitoaoi\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8benum\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Java\u306b\u304a\u3051\u308bEnum - Blog - Silicon Cloud","description":"Java\u306b\u304a\u3051\u308bEnum\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","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:\/\/www.silicloud.com\/ja\/blog\/java\u306b\u304a\u3051\u308benum\/","og_locale":"ja_JP","og_type":"article","og_title":"Java\u306b\u304a\u3051\u308bEnum","og_description":"Java\u306b\u304a\u3051\u308bEnum\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/java\u306b\u304a\u3051\u308benum\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2022-08-25T11:36:46+00:00","article_modified_time":"2025-07-31T15:46:10+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/6564965fdaa94e2bdf7bfae9\/2-0.jpg"}],"author":"\u6d77\u6597, \u8475","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u6d77\u6597, \u8475","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"22\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8benum\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8benum\/","name":"Java\u306b\u304a\u3051\u308bEnum - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2022-08-25T11:36:46+00:00","dateModified":"2025-07-31T15:46:10+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6"},"description":"Java\u306b\u304a\u3051\u308bEnum\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8benum\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8benum\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8benum\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"Java\u306b\u304a\u3051\u308bEnum"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6","name":"\u6d77\u6597, \u8475","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g","caption":"\u6d77\u6597, \u8475"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/kaitoaoi\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8benum\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/579","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=579"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/579\/revisions"}],"predecessor-version":[{"id":42396,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/579\/revisions\/42396"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}