Package yapion.hierarchy.validators
Class ValidatorCluster
- java.lang.Object
- 
- yapion.hierarchy.validators.ValidatorCluster
 
- 
 public final class ValidatorCluster extends java.lang.Object
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classValidatorCluster.ClusterMode
 - 
Constructor SummaryConstructors Constructor Description ValidatorCluster()
 - 
Method SummaryModifier and Type Method Description ValidatorClusteradd(Validator validator)Add a newValidatorto thisValidatorCluster.booleanvalidate(YAPIONObject yapionObject)Checks if the inputtedYAPIONObjectmatches oneValidator.booleanvalidate(YAPIONObject yapionObject, int validNumber)Checks if the inputtedYAPIONObjectmatches oneValidator.booleanvalidate(ValidatorCluster.ClusterMode clusterMode, YAPIONObject yapionObject)Checks if the inputtedYAPIONObjectmatches theValidatorwith the specifiedValidatorCluster.ClusterMode.booleanvalidate(ValidatorCluster.ClusterMode clusterMode, YAPIONObject yapionObject, int validNumber)Checks if the inputtedYAPIONObjectmatches theValidatorwith the specifiedValidatorCluster.ClusterMode.
 
- 
- 
- 
Method Detail- 
addpublic ValidatorCluster add(Validator validator) Add a newValidatorto thisValidatorCluster.- Parameters:
- validator- the- Validatorto add
 
 - 
validatepublic boolean validate(YAPIONObject yapionObject) Checks if the inputtedYAPIONObjectmatches oneValidator. It uses theValidatorCluster.ClusterMode.ANY_VALID.- Parameters:
- yapionObject- the- YAPIONObjectto validate
- Returns:
- trueif any- Validatorreturns- true,- falseotherwise
 
 - 
validatepublic boolean validate(YAPIONObject yapionObject, int validNumber) Checks if the inputtedYAPIONObjectmatches oneValidator. It uses theValidatorCluster.ClusterMode.LEAST_VALID.- Parameters:
- yapionObject- the- YAPIONObjectto validate
- validNumber- the- Validatorthreshold
- Returns:
- trueif at least n- Validator's returned- true,- falseotherwise
 
 - 
validatepublic boolean validate(ValidatorCluster.ClusterMode clusterMode, YAPIONObject yapionObject) Checks if the inputtedYAPIONObjectmatches theValidatorwith the specifiedValidatorCluster.ClusterMode.- Parameters:
- clusterMode- the- ValidatorCluster.ClusterModeto use
- yapionObject- the- YAPIONObjectto validate
- Returns:
- trueif the specification of the- ClusterModeare met- ValidatorCluster.ClusterMode.ANY_VALIDand- ValidatorCluster.ClusterMode.LEAST_VALIDwill behave the same- ValidatorCluster.ClusterMode.SPECIFIC_VALIDwill behave as one and only one is valid- ValidatorCluster.ClusterMode.MOST_VALIDwill behave as one valid or none valid
 
 - 
validatepublic boolean validate(ValidatorCluster.ClusterMode clusterMode, YAPIONObject yapionObject, int validNumber) Checks if the inputtedYAPIONObjectmatches theValidatorwith the specifiedValidatorCluster.ClusterMode.- Parameters:
- clusterMode- the- ValidatorCluster.ClusterModeto use
- yapionObject- the- YAPIONObjectto validate
- validNumber- the- Validatorthreshold
- Returns:
- trueif the specification of the- ValidatorCluster.ClusterModeare met,- falseotherwise
 
 
- 
 
-