mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-01-04 08:18:49 +08:00
(fix)(chat)Remove spaces when obtaining a MemoryReviewResult (#1594)
This commit is contained in:
@@ -1,9 +1,21 @@
|
||||
package com.tencent.supersonic.chat.api.pojo.enums;
|
||||
|
||||
|
||||
import com.tencent.supersonic.common.pojo.exception.InvalidArgumentException;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public enum MemoryReviewResult {
|
||||
|
||||
POSITIVE,
|
||||
NEGATIVE
|
||||
NEGATIVE;
|
||||
|
||||
public static MemoryReviewResult getMemoryReviewResult(String value) {
|
||||
String validValue = StringUtils.trim(value);
|
||||
for (MemoryReviewResult reviewRet : MemoryReviewResult.values()) {
|
||||
if (StringUtils.equalsIgnoreCase(reviewRet.name(), validValue)) {
|
||||
return reviewRet;
|
||||
}
|
||||
}
|
||||
throw new InvalidArgumentException("Invalid MemoryReviewResult type:[" + value + "]");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user