Package de.cuioss.test.valueobjects.util
Class ObjectContractHelper
java.lang.Object
de.cuioss.test.valueobjects.util.ObjectContractHelper
Utility class for dealing with
ObjectTestContracts
and the
VetoObjectTestContract
and VetoObjectTestContracts
annotations.- Author:
- Oliver Wolff
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Set<VetoObjectTestContract>
extractConfiguredVetoObjectContracts
(Class<?> annotated) Checks the given type for the annotationVetoObjectTestContract
andVetoObjectTestContracts
and puts all found in the immutable list to be returnedstatic Set<ObjectTestContracts>
handleOptedInContracts
(Class<?> annotated) Checks the given type for the annotationVerifyObjectTestContract
and creates a set with all correspondingObjectTestContracts
.static Set<ObjectTestContracts>
handleVetoedContracts
(Class<?> annotated) Checks the given type for the annotationVetoObjectTestContract
andVetoObjectTestContracts
creates a set with allObjectTestContracts.OBJECT_CONTRACTS
but the vetoed contracts.
-
Constructor Details
-
ObjectContractHelper
public ObjectContractHelper()
-
-
Method Details
-
handleVetoedContracts
Checks the given type for the annotationVetoObjectTestContract
andVetoObjectTestContracts
creates a set with allObjectTestContracts.OBJECT_CONTRACTS
but the vetoed contracts.- Parameters:
annotated
- the class that may or may not provide the annotations, must not be null- Returns:
- immutable set of found
ObjectTestContracts
elements.
-
extractConfiguredVetoObjectContracts
Checks the given type for the annotationVetoObjectTestContract
andVetoObjectTestContracts
and puts all found in the immutable list to be returned- Parameters:
annotated
- the class that may or may not provide the annotations, must not be null- Returns:
- immutable
Set
of foundVetoObjectTestContract
elements.
-
handleOptedInContracts
Checks the given type for the annotationVerifyObjectTestContract
and creates a set with all correspondingObjectTestContracts
.- Parameters:
annotated
- the class that may or may not provide the annotations, must not be null- Returns:
- immutable set of found
ObjectTestContracts
elements.
-