import jp.co.sint.webshop.code.CodeAttribute;
public enum TicketUse implements CodeAttribute {
UNENABLED("不可使用", "0"),
ENABLED("可使用", "1");
private String name;
private String value;
private TicketUse(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return this.name;
}
public String getValue() {
return this.value;
}
public Long longValue() {
return Long.valueOf(this.getValue());
}
public static TicketUse fromName(String name) {
for (TicketUse p : TicketUse.values()) {
if (p.getName().equals(name)) {
return p;
}
}
return null;
}
public static TicketUse fromValue(String value) {
for (TicketUse p : TicketUse.values()) {
if (p.getValue().equals(value)) {
return p;
}
}
return null;
}
public static TicketUse fromValue(Long value) {
return fromValue(Long.toString(value));
}
public static boolean isValid(String value) {
if (StringUtil.hasValue(value)) {
for (TicketUse p : TicketUse.values()) {
if (p.getValue().equals(value)) {
return true;
}
}
}
return false;
}
public static boolean isValid(Long value) {
return isValid(Long.toString(value));
}
}
public interface CodeAttribute {
String getName();
String getValue();
}