|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fu_berlin.ties.io.BaseStorable
public abstract class BaseStorable
Convenience implementations of the Storable
interface that implements the toString()
method based on the field
map created by Storable.storeFields()
.
Classes that cannot extend this interface can easily implement this method
by delegating to the static toString(Storable)
method provided by
this class, passing itself as argument and returning the result.
The Object.equals(java.lang.Object)
and
Object.hashCode()
methods are not overwritten by
this class because it would not only be inefficent, but also error-prone
to do this based on the field map (e.g. a number could by represented either
by a Number
object or by a string representation, thus
classes might be equal even if their field map serializations are not).
Non-abstract Storable
implementations should
provide their own implementations of these methods, e.g. using the builder
tools from Jakarta
Commons Lang.
Constructor Summary | |
---|---|
protected |
BaseStorable()
Creates a new instance. |
Method Summary | |
---|---|
String |
toString()
Returns a String representation of this object, printing all field name/value pairs in the order used to insert them into the FieldMap . |
static String |
toString(Storable storable)
Returns a String representation of a Storable object,
printing all field name/value pairs in the order used to insert them
into the FieldMap . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.fu_berlin.ties.io.Storable |
---|
storeFields |
Constructor Detail |
---|
protected BaseStorable()
Method Detail |
---|
public static String toString(Storable storable)
Storable
object,
printing all field name/value pairs in the order used to insert them
into the FieldMap
.
storable
- the storable to represent
public String toString()
FieldMap
.
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |