|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Documented @Inherited @Restriction @Retention(value=SOURCE) @Target(value=TYPE) public @interface Value
Value annotation describes objects whose identity is not important,
but that are completely described by its state instead, like Strings,
Numbers and Dates.
More formally, classes marked as Value must grant that it is possible
to have two instances such that a != b && a.equals(b)
Classes annotated this way grant that all their instances observe the
following Value protocol
Annotation.equals(Object)Object.hashCode() contractValues implement Object.toString() in order to provide a
descriptive representation of the object stateSerializable
Although Value objects are usually immutable, this annotation does
not make any assumption about it, as it only imposes restrictions regarding
identity. Mutability aspect is covered by other annotations, like
Immutable, Unmodifiable and the rest of the annotations
defined in this package
Immutable,
Unmodifiable,
Restriction
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||