public class Attribute<T> extends CanonicalAccessorFactory<T> implements IAttribute<T>
| Modifier and Type | Field and Description |
|---|---|
private static java.util.Map<IAccessorKey<?>,IAttribute<?>> |
CANONICAL_MAP |
private java.lang.String |
description |
private java.lang.String |
name |
| Modifier | Constructor and Description |
|---|---|
protected |
Attribute(java.lang.String identifier,
java.lang.String name,
java.lang.String description,
ContentType<T> contentType)
Protected constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> ICanonicalAccessorFactory<T> |
attr(java.lang.String identifier,
ContentType<T> contentType) |
static <T> IAttribute<T> |
attr(java.lang.String identifier,
java.lang.String name,
ContentType<T> contentType)
Obtain an attribute.
|
static <T> IAttribute<T> |
attr(java.lang.String identifier,
java.lang.String name,
java.lang.String description,
ContentType<T> contentType)
Obtain an attribute.
|
static <T> IAttribute<T> |
canonicalize(Attribute<T> key)
Set
key as the canonical (and only allowed) attribute for its equivalence class. |
private static <T> IAttribute<T> |
getCanonical(Attribute<T> key)
If the attribute
key has a canonical equivalent, get that. |
private static <T> ICanonicalAccessorFactory<T> |
getCanonical(CanonicalAccessorFactory<T> key)
If the attribute
key has a canonical equivalent, get that. |
java.lang.String |
getDescription() |
java.lang.String |
getName() |
customAccessor, getAccessor, getKeyequals, getContentType, getIdentifier, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAccessor, getContentType, getIdentifier, getKeyprivate static java.util.Map<IAccessorKey<?>,IAttribute<?>> CANONICAL_MAP
private final java.lang.String name
private final java.lang.String description
protected Attribute(java.lang.String identifier,
java.lang.String name,
java.lang.String description,
ContentType<T> contentType)
identifier - attribute idname - attribute namedescription - attribute descriptioncontentType - content type of the attribute valuesattr(String, String, String, ContentType),
attr(String, String, ContentType)public static final <T> IAttribute<T> attr(java.lang.String identifier, java.lang.String name, java.lang.String description, ContentType<T> contentType)
T - attribute value typeidentifier - attribute idname - attribute namedescription - attribute descriptioncontentType - content type of the attribute valuespublic static final <T> IAttribute<T> attr(java.lang.String identifier, java.lang.String name, ContentType<T> contentType)
T - attribute value typeidentifier - attribute idname - attribute namecontentType - content type of the attribute valuespublic static final <T> ICanonicalAccessorFactory<T> attr(java.lang.String identifier, ContentType<T> contentType)
private static <T> ICanonicalAccessorFactory<T> getCanonical(CanonicalAccessorFactory<T> key)
key has a canonical equivalent, get that. Otherwise, use
key.key - key or a canonical equivalentprivate static <T> IAttribute<T> getCanonical(Attribute<T> key)
key has a canonical equivalent, get that. Otherwise, use
key.key - key or a canonical equivalentpublic static <T> IAttribute<T> canonicalize(Attribute<T> key)
key as the canonical (and only allowed) attribute for its equivalence class.T - attribute value typekey - attribute to canonicalizejava.lang.IllegalStateException - if an equivalent attribute has already been canonicalizedpublic java.lang.String getName()
getName in interface IDescribablepublic java.lang.String getDescription()
getDescription in interface IDescribable