|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ValueSemanticsProvider<T>
Provides a mechanism for providing a set of value semantics.
As explained in the Javadoc of the Value annotation, value semantics only actually implies that the
type is aggregated. However, values are very often also Parseable,
Encodable, Immutable and implement EqualByContent semantics. In addition, there
may be a default value.
This interface is used by Value to allow these semantics to be provided through a single point.
Alternatively, Value supports this information being provided via the configuration files.
Whatever the class that implements this interface, it must also expose either a public no-arg constructor, or (for implementations that also are Facets) a public constructor that accepts a single FacetHolder. This constructor allows the framework to instantiate the object reflectively.
Parser,
EncoderDecoder,
DefaultsProvider| Method Summary | |
|---|---|
DefaultsProvider<T> |
getDefaultsProvider()
The DefaultsProvider, if any. |
EncoderDecoder<T> |
getEncoderDecoder()
The EncoderDecoder, if any. |
Parser<T> |
getParser()
The Parser, if any. |
boolean |
isEqualByContent()
Whether the value has equal by content semantics. |
boolean |
isImmutable()
Whether the value is Immutable. |
| Method Detail |
|---|
Parser<T> getParser()
Parser, if any.
If not null, implies that the value is Parseable.
EncoderDecoder<T> getEncoderDecoder()
EncoderDecoder, if any.
If not null, implies that the value is Encodable.
DefaultsProvider<T> getDefaultsProvider()
DefaultsProvider, if any.
If not null, implies that the value has (or may have) a default.
boolean isImmutable()
Immutable.
boolean isEqualByContent()
equal by content semantics.
If so, then it must implement equals(Object) and hashCode() consistently.
Examples in the Java language that do this are String and BigDecimal, for example.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||