@Retention(value=RUNTIME)
@Target(value=FIELD)
public @interface Represented
ReprUtil.
Add this annotation to all fields that need to be part of the object's representation.
Then use ReprUtil to automatically serialize and deserialize your object according to these annotations.
ReprUtil| Modifier and Type | Optional Element and Description |
|---|---|
java.lang.String |
restorer
Specifies the name of the restorer to use to restore the fields value after having been serialized.
|
public abstract java.lang.String restorer
Usually, this is just a name like "G1", meaning that the serialization and deserialization of this field
should be handled by the restorer registered with name "G1".
If this is a Collection or a Map field, the restorer string must explain
how to restore its elements.
For example, for a list/set whose elements should be deserialized by restorer "G1",
you'd write "[G1]" (i.e. a list/set of elements each of which is restorable by restorer "G1").
For a map, whose keys are handled by "G1" and whose values by "G2", write "G1 -> G2".
These can be combined, e.g., "G1 -> [[G2]]" for a map whose keys are handled by "G1"
and whose values are lists of lists of elements handled by "G2".
You can use parentheses to ensure precedence, e.g., "(G1 -> G2) -> G3" is a map whose keys are maps
from G1 to G2.
If the type is simple (i.e. StandaloneRepresentable, BigInteger, Integer,
String, Boolean, or byte[]), this value is ignored.
This is again true for nested expressions, e.g., "FOO -> G2" works for a map from String to
GroupElement, as the string "FOO" is simply ignored.
Keep in mind that the unwrapped variants such as int or boolean are not supported.