public interface Encodable
Encodable
is declaring that its
internal state can be encoded as a String.
The general contract for an object implementing this interface is to:
toEncodedString
to create a string that embodies the state of the instance valueOf(String)
which will
return an instance re-constituted from the given encoded string valueOf()
method should throw NullPointerException
and
IllegalArgumentException
as appropriate.
For SomeEncodable
that implements Encodable
the following
should hold true:
SomeEncodable some = new SomeEncodable(...); String blueprint = some.toEncodedString(); SomeEncodable copy = SomeEncodable.valueOf(blueprint); assert copy.equals(some);
Modifier and Type | Method and Description |
---|---|
String |
toEncodedString()
Returns a string that is an encodement of this instance.
|
String toEncodedString()
Copyright © 2015. All Rights Reserved.