33 lines
730 B
Java
33 lines
730 B
Java
package com.myoa.engineering.crawl.ppomppu.receiver.handler.message.text;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import lombok.Getter;
|
|
import lombok.NoArgsConstructor;
|
|
|
|
/**
|
|
* CommandTextCode
|
|
* @author Shin Woo-jin (woo-jin.shin@linecorp.com)
|
|
* @since 2021-09-05
|
|
*
|
|
*/
|
|
@Getter
|
|
@NoArgsConstructor
|
|
public enum TextCommandCode {
|
|
EMPTY(null),
|
|
START("/start"),
|
|
;
|
|
private String value;
|
|
|
|
TextCommandCode(String value) {
|
|
this.value = value;
|
|
}
|
|
|
|
public static TextCommandCode find(String value) {
|
|
return Arrays.stream(TextCommandCode.values())
|
|
.filter(e -> e.getValue().startsWith(value))
|
|
.findFirst()
|
|
.orElse(TextCommandCode.EMPTY);
|
|
}
|
|
}
|