TASK:cloud;
This commit is contained in:
44
src/main/java/com/ai/da/model/enums/UserBehaviorType.java
Normal file
44
src/main/java/com/ai/da/model/enums/UserBehaviorType.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package com.ai.da.model.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
public enum UserBehaviorType implements IEnumDisplay {
|
||||
|
||||
PORTFOLIO_CLICK("portfolioClick"),
|
||||
PORTFOLIO_LIKE("portfolioLike"),
|
||||
SECOND_CREATION("secondCreation"),
|
||||
SKETCH_LIKE("sketchLike")
|
||||
|
||||
// CHILD("Child")
|
||||
;
|
||||
|
||||
private String value;
|
||||
|
||||
UserBehaviorType(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static boolean isValidName(String name) {
|
||||
for (Sex sex : Sex.values()) {
|
||||
if (sex.name().equalsIgnoreCase(name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public static UserBehaviorType getType(String value) {
|
||||
for (UserBehaviorType type : values()) {
|
||||
if (type.value.equalsIgnoreCase(value)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("No matching constant for [" + value + "]");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user