/ProductVersionType.java Secret
Created
March 7, 2021 11:49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.shlee.toy1.repository.product.type; | |
public enum ProductVersionType { | |
VERSION1("1_VERSION", "VAL1"), | |
VERSION2("2_VERSION", "VAL2"); | |
public String code; | |
public String value; | |
private ProductVersionType(String code, String value) { | |
this.code = code; | |
this.value = value; | |
} | |
public String getCode() { | |
return code; | |
} | |
public String getValue() { | |
return value; | |
} | |
public static ProductVersionType get(String code) { | |
for (ProductVersionType element : values()) { | |
if (element.code.equalsIgnoreCase(code)) { | |
return element; | |
} | |
} | |
return null; | |
} | |
public static ProductVersionType lookup(String code) { | |
for (ProductVersionType element : ProductVersionType.values()) { | |
if (element.code.equalsIgnoreCase(code)) { | |
return element; | |
} | |
} | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment