当前位置:网站首页>Two usages of enumeration classes
Two usages of enumeration classes
2022-06-27 12:20:00 【Jinlin】
/** * */ package com.***.enums; /** * Find the province of the invoice according to the invoice code * * @author jinyulinlang date:2018 year 7 month 26 Japan */ public enum CityEnum { BJS(" The Beijing municipal ", "11"), SHHS(" Shanghai ", "31"), TJS(" tianjin ", "12"), CHQS(" Chongqing City ", "50"), XGTBXZQ(" Hong Kong Special Administrative Region ", "xg"), AMTBXZQ( " Macao SAR ", "am"), HEBS(" Hebei Province ", "13"), ZJS(" Zhejiang Province ", "33"), LNS(" Liaoning Province ", "21"), HUBS(" Hubei province ", "42"), JSS(" Jiangsu Province ", "32"), NMGZZQ(" Inner Mongolia Autonomous Region ", "15"), JXS(" Jiangxi Province ", "36"), SXS(" Shanxi Province ", "14"), GSS(" Gansu Province ", "62"), SDS(" Shandong Province ", "37"), HLJS(" Heilongjiang Province ", "23"), FJS(" Fujian Province ", "35"), GDS(" Guangdong province, ", "44"), SCS(" Sichuan Province ", "52"), HUNS(" Hunan province ", "43"), HENS(" Henan province ", "41"), YNS(" Yunnan Province ", "53"), AHS(" Anhui Province ", "34"), NXZZQ(" Ningxia Hui Autonomous Region ", "64"), JLS(" Jilin Province ", "22"), GXZZQ(" Guangxi Zhuang Autonomous Region ", "45"), GZS(" Guizhou Province ", "52"), SHXS(" Shaanxi Province ", "61"), QHS(" Qinghai Province ", "63"), HINS(" Hainan ", "46"), XZ(" Tibet Autonomous Region ", "54"), XJZZQ(" Xinjiang Uygur Autonomous Region ", "65"); private String name; private String index; /** * Constructors * * @param name * @param index */ private CityEnum(String name, String index) { this.name = name; this.index = index; } public static String getName(String index) { for (CityEnum city : CityEnum.values()) { if (city.index.equals(index)) { return city.name; } } return " The system does not support invoice related businesses in Hong Kong, Macao and Taiwan for the time being !"; } /** * test * * @param args */ public static void main(String[] args) { String name2 = getName("41"); System.out.println(name2); } } /** * */ package com.*****.test; import com.sun.glass.ui.TouchInputSupport; /** * @Title: TestEnum.java * @author jinyulinlang * @date 2018 year 9 month 27 Japan * @version V1.0 */ public enum TestEnum { NONE("NoPadding"), ISO10126("ISO10126Padding"), OAEP("OAEPPadding"), OAEPWithMd5AndMgf1( "OAEPWithMD5AndMGF1Padding"), OAEPWithSha1AndMgf1("OAEPWithSHA-1AndMGF1Padding"), OAEPWithSha256AndMgf1( "OAEPWithSHA-256AndMGF1Padding"), OAEPWithSha384AndMgf1( "OAEPWithSHA-384AndMGF1Padding"), OAEPWithSha512AndMgf1( "OAEPWithSHA-512AndMGF1Padding"), PKCS1( "PKCS1Padding"), PKCS5("PKCS5Padding"), SSL3("SSL3Padding"); private String name; private TestEnum(String name) { this.name = name; } public String getname() { return this.name; } public static TestEnum getName(String name) { for (TestEnum testEnum : TestEnum.values()) { if (testEnum.name.equals(name)) { return testEnum; } } return null; } public static void main(String[] args) { TestEnum name2 = getName("OAEPPadding"); System.out.println(name2); } }
边栏推荐
- MapReduce原理剖析(深入源码)
- R language uses GLM function to build Poisson logarithm linear regression model, processes three-dimensional contingency table data to build saturation model, uses step function to realize stepwise re
- What is the TCP 3-time handshake process?
- Topic37——64. Minimum path sum
- Microservice splitting
- 秒云荣获《2022爱分析 · IT运维厂商全景报告》智能运维AIOps市场代表厂商
- esp32s3 IPERF例程测试 esp32s3吞吐量测试
- 自学ADT和OOP
- Salesforce 容器化 ISV 场景下的软件供应链安全落地实践
- R语言使用MASS包的polr函数构建有序多分类logistic回归模型、使用VGAM包的vglm函数对有序多分类logistic回归模型进行平行性假设作检验
猜你喜欢

Drive to APasS! Use Mingdao cloud to manage F1 events

Unlock the secret of C language key words (issue 6)

What's the matter with Amazon's evaluation dropping and failing to stay? How to deal with it?

MapReduce实战小案例(自定义排序、二次排序、分组、分区)

pull request

dried food! What problems will the intelligent management of retail industry encounter? It is enough to understand this article

Wechat applet realizes five-star evaluation

动态规划【三】(区间dp)石子合并

解开C语言的秘密《关键字》(第六期)

MySQL高阶语句(一)
随机推荐
Microservice splitting
聊聊 Go 语言与云原生技术
pull request
Hands on API development
Take stock of some easy-to-use and niche markdown editors
亚马逊测评掉评、留不上评是怎么回事呢?要如何应对?
Mathematical knowledge -- ideas and examples of game theory (bash game, Nim game, wizov game)
R language uses GLM function to build Poisson logarithm linear regression model, processes three-dimensional contingency table data to build saturation model, uses step function to realize stepwise re
号称史上最难618,淘宝数据盘点你做对了吗?
Go Web 编程入门:验证器
In 2021, the global professional liability insurance revenue was about USD 44740million, and it is expected to reach USD 55980million in 2028. From 2022 to 2028, the CAGR was 3.5%
threejs的环境光+点光源+平行光源+球面光 以及hepler理解+阴影()
Time management understood after being urged to work at home
MapReduce实战小案例(自定义排序、二次排序、分组、分区)
R语言使用MASS包的polr函数构建有序多分类logistic回归模型、使用VGAM包的vglm函数对有序多分类logistic回归模型进行平行性假设作检验
StarCraft's Bug King ia retired for 2 years to engage in AI, and lamented that it was inferior
Online bidding of Oracle project management system
Nifi from introduction to practice (nanny level tutorial) - identity authentication
巅峰小店APP仿站开发玩法模式讲解源码分享
最短编辑距离(线性dp写法)