TASK:mannequin;
This commit is contained in:
41
src/main/java/com/ai/da/model/enums/CollectionType.java
Normal file
41
src/main/java/com/ai/da/model/enums/CollectionType.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package com.ai.da.model.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
public enum CollectionType implements IEnumDisplay {
|
||||
DESIGN("Design"),
|
||||
TO_PRODUCT_IMAGE("ToProductImage"),
|
||||
RELIGHT("Relight"),
|
||||
POSE_TRANSFORM("PoseTransfer")
|
||||
;
|
||||
|
||||
private String value;
|
||||
|
||||
CollectionType(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public static CollectionType getAgeGroup(String value) {
|
||||
for (CollectionType group : values()) {
|
||||
if (group.value.equalsIgnoreCase(value)) {
|
||||
return group;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("No matching constant for [" + value + "]");
|
||||
}
|
||||
|
||||
public static boolean isValidName(String name) {
|
||||
for (CollectionType ageGroup : CollectionType.values()) {
|
||||
if (ageGroup.name().equalsIgnoreCase(name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user