public class RepresentableRepresentation extends Representation
(getRepresentedTypeName(), getRepresentation()) tuple, useful
for storing StandaloneRepresentables.
This is useful for storing a StandaloneRepresentable, as it can later be restored by simply calling
recreateRepresentable().
| Modifier and Type | Field and Description |
|---|---|
protected Representation |
representation
The representation of the stored object.
|
protected java.lang.String |
representedTypeName
The type name of the represented object.
|
| Constructor and Description |
|---|
RepresentableRepresentation(java.lang.Enum<?> enumValue) |
RepresentableRepresentation(Representable r) |
RepresentableRepresentation(java.lang.String representedTypeName,
Representation representation) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
Representation |
getRepresentation()
Returns the stored representation.
|
java.lang.String |
getRepresentedTypeName()
Returns the type name of the object stored in this representation.
|
int |
hashCode() |
java.lang.Object |
recreateRepresentable()
Tries to recreate the represented object given by the representation.
|
java.lang.String |
toString() |
protected final java.lang.String representedTypeName
protected final Representation representation
public RepresentableRepresentation(Representable r)
public RepresentableRepresentation(java.lang.Enum<?> enumValue)
public RepresentableRepresentation(java.lang.String representedTypeName,
Representation representation)
public java.lang.String getRepresentedTypeName()
Acts as a hint that can be used to find the correct constructor to reconstruct the object from the representation.
public Representation getRepresentation()
public java.lang.Object recreateRepresentable()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object