net.sf.staccatocommons.restrictions.value
Annotation Type Value


@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

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

Author:
flbulgarelli
See Also:
Immutable, Unmodifiable, Restriction



Copyright © 2010-2012 StaccatoCommons. All Rights Reserved.