public class Attribute<T> extends Object implements IAttribute<T>
| Modifier | Constructor and Description |
|---|---|
protected |
Attribute(String identifier,
String name,
String description,
ContentType<T> contentType)
Protected constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> ICanonicalAccessorFactory<T> |
attr(String identifier,
ContentType<T> contentType) |
static <T> IAttribute<T> |
attr(String identifier,
String name,
ContentType<T> contentType)
Obtain an attribute.
|
static <T> IAttribute<T> |
attr(String identifier,
String name,
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. |
<U> IMemberAccessor<V,U> |
customAccessor(IType<U> type)
Override to construct deriving accessors.
|
boolean |
equals(Object obj) |
<U> IMemberAccessor<V,U> |
getAccessor(IType<U> type)
Gets the accessor for specified type.
|
ContentType<T> |
getContentType()
The content type of this attribute.
|
String |
getDescription() |
String |
getIdentifier()
A identifier is a text string identifying the attribute.
|
IAccessorKey<V> |
getKey() |
String |
getName() |
int |
hashCode() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAccessor, getContentType, getIdentifier, getKeyprotected Attribute(String identifier, String name, 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(String identifier, String name, 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(String identifier, 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(String identifier, ContentType<T> contentType)
public 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 canonicalizeIllegalStateException - if an equivalent attribute has already been canonicalizedpublic String getName()
getName in interface IDescribablepublic String getDescription()
getDescription in interface IDescribablepublic final <U> IMemberAccessor<V,U> getAccessor(IType<U> type)
IAccessorFactorygetAccessor in interface IAccessorFactory<V>getAccessor in interface ICanonicalAccessorFactory<V>U - input type classtype - type that the accessor should work fornull if the type cannot provide such valuespublic <U> IMemberAccessor<V,U> customAccessor(IType<U> type)
U - input type classtype - type to create accessor forpublic IAccessorKey<V> getKey()
getKey in interface ICanonicalAccessorFactory<V>public ContentType<T> getContentType()
IAccessorKeyIItem.getContentType in interface IAccessorKey<T>public String getIdentifier()
IAccessorKeyField.getName().)getIdentifier in interface IAccessorKey<T>Copyright © 2019. All rights reserved.