-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
( 온라인신청, 방문신청, 우편신청, 그 외 )
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
src/main/java/com/cmc/zenefitserver/domain/policy/domain/enums/PolicyMethodType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.cmc.zenefitserver.domain.policy.domain.enums; | ||
|
||
import lombok.Getter; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.stream.Stream; | ||
|
||
@Getter | ||
public enum PolicyMethodType { | ||
|
||
ONLINE("온라인신청", Arrays.asList("온라인", "누리집", "홈페이지", "포털", "블로그", "이메일", "모바일", "email", "e-mail", "e-메일", "팩스", "전화", "워크넷", "https", "www")), | ||
LETTER("우편신청", Arrays.asList("우편")), | ||
VISIT("방문신청", Arrays.asList("방문", "읍면", "사무소", "사무실", "센터", "관할", "내방")), | ||
BLANK("빈값", Collections.emptyList()); | ||
|
||
private final String description; | ||
|
||
private final List<String> keywords; | ||
|
||
PolicyMethodType(String description, List<String> keywords) { | ||
this.description = description; | ||
this.keywords = keywords; | ||
} | ||
|
||
public static PolicyMethodType findPolicyMethodTypeByKeywords(String text) { | ||
return Arrays.stream(PolicyMethodType.values()) | ||
.filter(policyMethodType -> policyMethodType.keywords.stream().anyMatch(text::contains)) | ||
.findFirst() | ||
.orElse(BLANK); | ||
} | ||
} |