Interface CanonicalValue<T extends CanonicalValue<T>>

Type Parameters:
T - Canonical value type
All Superinterfaces:
Comparable<T>, Immutable, Serializable
All Known Implementing Classes:
CachingDerivedString, Decimal64, DerivedString, Uint16, Uint32, Uint64, Uint8

@Beta @NonNullByDefault public interface CanonicalValue<T extends CanonicalValue<T>> extends Comparable<T>, Immutable, Serializable
A typed value in its internal Java representation. Implementations of this interface are required to:
  • be immutable
  • be Serializable
  • accurately define total ordering of values

Aside from providing the ability to hold a canonical value, this interface and its implementations support carrying additional information about how the value has been validated -- allowing efficient interchange of already-validated values between users. validator() provides the link to a CanonicalValueValidator which has declared the value conform to it. Users can query the validator to establish whether the value needs to be further validated to conform to their requirement.

Author:
Robert Varga