mirror of
https://gitee.com/dromara/hmily.git
synced 2024-12-05 04:39:09 +08:00
code optimize
This commit is contained in:
parent
3c0cff5d8b
commit
19869494f7
@ -22,7 +22,6 @@ import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* The enum Tcc action enum.
|
||||
@ -64,11 +63,9 @@ public enum TccActionEnum {
|
||||
* @return the tcc action enum
|
||||
*/
|
||||
public static TccActionEnum acquireByCode(final int code) {
|
||||
Optional<TccActionEnum> tccActionEnum =
|
||||
Arrays.stream(TccActionEnum.values())
|
||||
return Arrays.stream(TccActionEnum.values())
|
||||
.filter(v -> Objects.equals(v.getCode(), code))
|
||||
.findFirst();
|
||||
return tccActionEnum.orElse(TccActionEnum.TRYING);
|
||||
.findFirst().orElse(TccActionEnum.TRYING);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user