public class AnnotatedUbrUtil
extends java.lang.Object
@UniqueByteRepresented.
Specifically, the updateAccumulator() method only has to be implemented as
return AnnotatedUbrUtil.autoAccumulate(accumulator, this);This will append the annotated object members (including those of superclasses) to the accumulator.
It is guaranteed that for objects i1 and i2, if !i1.x.equals(i2.x)
(for some annotated object member x), then the data appended by
AnnotatedUbrUtil.autoAccumulate(acc, i1) is different from AnnotatedUbrUtil.autoAccumulate(acc, i1).
This depends on correct implementation of the UniqueByteRepresentable interface of used classes.
Furthermore, the contract of UniqueByteRepresentable applies.
The utility can handle arbitrarily nested lists, sets, arrays, etc.
For a complete list of types it can handle, refer to accumulateObject(ByteAccumulator, Object).
| Modifier and Type | Field and Description |
|---|---|
protected static java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> |
annotationClassList
Contains all annotations used to mark fields that should be automatically accumulated by this class.
|
protected static byte |
nullSymbol
The symbol used to represent null values in unique byte representations.
|
| Constructor and Description |
|---|
AnnotatedUbrUtil() |
| Modifier and Type | Method and Description |
|---|---|
static ByteAccumulator |
autoAccumulate(ByteAccumulator accumulator,
java.lang.Object instance)
Adds all
@UniqueByteRepresented-annotated fields within the given instance object to the accumulator. |
protected static final byte nullSymbol
protected static final java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> annotationClassList
public static ByteAccumulator autoAccumulate(ByteAccumulator accumulator, java.lang.Object instance)
@UniqueByteRepresented-annotated fields within the given instance object to the accumulator.accumulator - ByteAccumulator to append toinstance - instance of class with annotated member variables