This commit is contained in:
crusader 2018-06-11 23:20:42 +09:00
parent 41e1e9e209
commit 5b641d15e8
3 changed files with 38 additions and 4 deletions

View File

@ -13,7 +13,7 @@
<groupId>com.loafle.overflow</groupId>
<artifactId>commons-java</artifactId>
<packaging>jar</packaging>
<version>1.0.39-SNAPSHOT</version>
<version>1.0.40-SNAPSHOT</version>
<name>com.loafle.overflow.commons-java</name>
<properties>

View File

@ -55,4 +55,41 @@ public class MetaIPType {
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public static enum Enum {
V4((short) 1), V6((short) 2),;
private final Short value;
/**
* @param value
*/
Enum(final Short value) {
this.value = value;
}
public MetaIPType to() {
return new MetaIPType(this.value);
}
public Enum from(MetaIPType metaIPType) {
switch (metaIPType.id) {
case 2:
return V6;
default:
return V4;
}
}
public Enum from(String metaIPTypeKey) {
switch (metaIPTypeKey) {
case "V6":
return V6;
default:
return V4;
}
}
}
}

View File

@ -1,8 +1,5 @@
package com.loafle.overflow.model.meta;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.*;
/**