public final class AnnotationToComparatorDictionary extends Object
Contains default comparisons but can register new annotations to comparator mappings at runtime.
| Modifier and Type | Method and Description |
|---|---|
Comparator |
getComparatorForAnnotation(Annotation annotation)
Gets the comparator assigned to the provided annotation
|
static AnnotationToComparatorDictionary |
getInstance() |
AbstractAbortCondition |
getPreComparisonCheckForAnnotation(Annotation annotation)
Gets the comparator assigned to the provided annotation
|
AbstractValidation |
getValidationForAnnotation(Annotation annotation)
Gets the comparator assigned to the provided annotation
|
boolean |
hasComparatorAssigned(Annotation annotation)
Checks if provided annotation is linked to a comparator
|
boolean |
hasPreConditionalCheckAssigned(Annotation candidate)
Checks if provided annotation is linked to a comparator
|
boolean |
hasValidationCheckAssigned(Annotation candidate)
Checks if provided annotation is linked to a validator
|
void |
setComparatorForAnnotation(Class<? extends Comparator> comparator,
Class<?> annotation)
Register or overwrite a mapping between an annotation and a comparator
|
void |
setPreConditionalCheckForAnnotation(Class<? extends AbstractAbortCondition> comparator,
Class<?> annotation)
Register or overwrite a mapping between an annotation and a comparator
|
void |
setValidatorForAnnotation(Class<? extends AbstractValidation> comparator,
Class<?> annotation)
Register or overwrite a mapping between an annotation and a comparator
|
public static AnnotationToComparatorDictionary getInstance()
public boolean hasComparatorAssigned(Annotation annotation)
annotation - annotation to checkpublic boolean hasPreConditionalCheckAssigned(Annotation candidate)
candidate - annotation to checkpublic boolean hasValidationCheckAssigned(Annotation candidate)
candidate - annotation to checkpublic void setComparatorForAnnotation(Class<? extends Comparator> comparator, Class<?> annotation)
comparator - comparator to registerannotation - annotation to registerJEntityTestException - in case the comparator or annotation is nullpublic void setPreConditionalCheckForAnnotation(Class<? extends AbstractAbortCondition> comparator, Class<?> annotation)
comparator - comparator to registerannotation - annotation to registerJEntityTestException - in case the comparator or annotation is nullpublic void setValidatorForAnnotation(Class<? extends AbstractValidation> comparator, Class<?> annotation)
comparator - comparator to registerannotation - annotation to registerJEntityTestException - in case the comparator or annotation is nullpublic Comparator getComparatorForAnnotation(Annotation annotation)
annotation - annotationJEntityTestException - in case comparator could not be providedpublic AbstractAbortCondition getPreComparisonCheckForAnnotation(Annotation annotation)
annotation - annotationJEntityTestException - in case comparator could not be providedpublic AbstractValidation getValidationForAnnotation(Annotation annotation)
annotation - annotationJEntityTestException - in case comparator could not be providedCopyright © 2021. All rights reserved.