Last active
November 16, 2018 18:54
-
-
Save BumpeiShimada/48ac2bdf3d9811c191f3a5c65b8ce433 to your computer and use it in GitHub Desktop.
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
/** | |
* Types for categorizing validation classes | |
*/ | |
enum ValidateType { | |
/** | |
* Applicable to all events | |
*/ | |
ALL_EVENTS, | |
/** | |
* Only applicable when the event is an exclusive one | |
*/ | |
EXCLUSIVE_EVENT_ONLY, | |
/** | |
* Only applicable when the event is "not" an exclusive one | |
*/ | |
PUBLIC_EVENT_ONLY; | |
/** | |
* This returns what kind of validation class will be applicable to the target Event. | |
* It's only used in ValidatorFactory class for filtering unnecessary validation class. | |
* | |
* @param isExclusive: the boolean value indicate whether the event is the exclusive one or not | |
* @return Validate types to use this case | |
*/ | |
public static EnumSet<ValidateType> getEventTypes(boolean isExclusive) { | |
if (isExclusive) { | |
return EnumSet.of(ALL_EVENTS, EXCLUSIVE_EVENT_ONLY); | |
} | |
return EnumSet.of(ALL_EVENTS, PUBLIC_EVENT_ONLY); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment