当前位置:网站首页>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); } }
边栏推荐
- R language uses the polR function of mass package to construct the ordered multi classification logistic regression model, and uses the vglm function of VGAM package to test the parallelism hypothesis
- Rxjs mergeMap 的使用场合
- namespace ‘rlang’ 0.2.0 is being loaded, but >= 0.3.0 is required
- Unzip log. GZ file
- C # WPF realizes undo redo function
- Wechat applet payment password input
- 【On nacos】快速上手 Nacos
- The R language uses the follow up The plot function visualizes the longitudinal follow-up map of multiple ID (case) monitoring indicators, and uses stress The labels parameter adds label information t
- threejs的环境光+点光源+平行光源+球面光 以及hepler理解+阴影()
- 面试突击60:什么情况会导致 MySQL 索引失效?
猜你喜欢

Topic37——64. Minimum path sum

TiDB 6.0:让 TSO 更高效丨TiDB Book Rush

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

How histrix works

MySQL learning 1: installing MySQL

面试突击60:什么情况会导致 MySQL 索引失效?

动态规划【四】(计数类dp)例题:整数划分

MapReduce principle analysis (in-depth source code)

Research Report on the overall scale, major manufacturers, major regions, products and application segments of hydraulic torque in the global market in 2022

StarCraft's Bug King ia retired for 2 years to engage in AI, and lamented that it was inferior
随机推荐
picocli-入门
c/s 架构
Safe landing practice of software supply chain under salesforce containerized ISV scenario
$15.8 billion! 2021 the world's top15 most profitable hedge fund giant
Unlock the secret of C language key words (issue 6)
Youboxun attended the openharmony technology day to create a new generation of secure payment terminals
The DBSCAN function of FPC package in R language performs density clustering analysis on data, and the plot function visualizes the clustering graph
application.properties 的配置信息
pull request
【粉丝福利】今天给大家介绍一个白捡钱的方法-可转债,本人亲自验证,每年每人能获利1500元
今晚战码先锋润和赛道第2期直播丨如何参与OpenHarmony代码贡献
Unzip log. GZ file
深入理解 happens-before 原则
行业洞察 | 新零售业态下,品牌电商应如何重塑增长?
Building crud applications in golang
Don't miss it. New media operates 15 treasure official account to share
Fork/Join 框架基本使用和原理
Thinkphp6 interface limits user access frequency
MySQL learning 1: installing MySQL
MapReduce原理剖析(深入源码)