public interface Describable
Objects supporting persistent descriptions of their identity. Components implementing this interface can write information about their identity to a description, suitable for hashing, etc. Unlike serialization, this is not reversible; objects are expected to write enough information to uniquely identify themselves in a persistent fashion, but not necessarily to reconstruct themselves.
Describable objects will generally be immutable. If they are not, they should write their current description.
Modifier and Type | Method and Description |
---|---|
void |
describeTo(DescriptionWriter writer)
Write this class’s description to a sink.
|
void describeTo(DescriptionWriter writer)
Write this class’s description to a sink. Anything relevant to this object’s identity should be digested; the idea is that, barring hash collisions, two objects with the same digest are equivalent. Used for things like deterministically generating cache file names.
writer
- The description writer to use.