mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-13 18:45:06 +08:00
enum 增加 valueOfType
This commit is contained in:
@ -23,4 +23,14 @@ public enum ChatRoleSourceEnum {
|
||||
private String type;
|
||||
|
||||
private String name;
|
||||
|
||||
|
||||
public static ChatRoleSourceEnum valueOfType(String type) {
|
||||
for (ChatRoleSourceEnum itemEnum : ChatRoleSourceEnum.values()) {
|
||||
if (itemEnum.getType().equals(type)) {
|
||||
return itemEnum;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Invalid MessageType value: " + type);
|
||||
}
|
||||
}
|
||||
|
@ -22,4 +22,15 @@ public enum ChatRoleVisibilityEnum {
|
||||
private String type;
|
||||
|
||||
private String name;
|
||||
|
||||
|
||||
public static ChatRoleVisibilityEnum valueOfType(String type) {
|
||||
for (ChatRoleVisibilityEnum itemEnum : ChatRoleVisibilityEnum.values()) {
|
||||
if (itemEnum.getType().equals(type)) {
|
||||
return itemEnum;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Invalid MessageType value: " + type);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user