DC
- Represented descriptor comparator typeD
- Bare form of suitable descriptor representationT
- Unguarded form base typepublic class ComparisonContextImpl<DC extends DescriptorComparator<D>,D extends Descriptor,T extends Serializable> extends Object implements ComparisonContext<DC,D,T>
ComparisonContext
interface.
Note that the represented DescriptorComparator
is passed as a factory function reference. The function is
invoked from descriptorComparator()
with this
argument. This allows the comparator instance to
properly reference this context instance.Guarded.EnsureThat, Guarded.New
Constructor and Description |
---|
ComparisonContextImpl(UnguardedContext<D,T> unguardedContext,
DC descriptorComparator,
DescriptorSerializer<D> descriptorSerializer)
Construct.
|
Modifier and Type | Method and Description |
---|---|
DC |
descriptorComparator()
Comparator to compare the bare/rich form of the descriptors.
|
DescriptorSerializer<D> |
descriptorSerializer()
Serializer to transform descriptors to/from String representation.
|
Object |
getGuardObject()
Gets the guard object associated to the generated descriptors/utilities.
|
String |
toString() |
UnguardedContext<D,T> |
unguardedContext()
Represented unguarded context.
|
public ComparisonContextImpl(UnguardedContext<D,T> unguardedContext, DC descriptorComparator, DescriptorSerializer<D> descriptorSerializer)
unguardedContext
- Represented unguarded contextdescriptorComparator
- Represented descriptor comparatordescriptorSerializer
- Represented descriptor serializerpublic UnguardedContext<D,T> unguardedContext()
ComparisonContext
unguardedContext
in interface ComparisonContext<DC extends DescriptorComparator<D>,D extends Descriptor,T extends Serializable>
public DC descriptorComparator()
ComparisonContext
ComparisonContext.unguardedContext()
.descriptorComparator
in interface ComparisonContext<DC extends DescriptorComparator<D>,D extends Descriptor,T extends Serializable>
public Object getGuardObject()
Guarded
This method is intended to use only for ensuring the compatibility of manipulated objects.
Implementations might use the associated DescriptorGenerator
or DescriptorParameters
reference as
the guard object, however it is a non recommended practice to use this method to access the associated generator
to perform further operations on it.
getGuardObject
in interface Guarded
null
.public DescriptorSerializer<D> descriptorSerializer()
ComparisonContext
descriptorSerializer
in interface ComparisonContext<DC extends DescriptorComparator<D>,D extends Descriptor,T extends Serializable>