D - The data type of this resource type.
Supported Types include: String, Long, Double, and Booleanpublic class AttributeTypeImpl<D> extends TypeImpl<AttributeType<D>,Attribute<D>> implements AttributeType<D>
An ontological element which models and categorises the various Attribute in the graph.
This ontological element behaves similarly to Type when defining how it relates to other
types. It has two additional functions to be aware of:
1. It has a AttributeType.DataType constraining the data types of the values it's instances may take.
2. Any of it's instances are unique to the type.
For example if you have a AttributeType modelling month throughout the year there can only be one January.
AttributeType.DataType<D>| Modifier and Type | Method and Description |
|---|---|
static <D> AttributeTypeImpl<D> |
create(VertexElement vertexElement,
AttributeType<D> type,
AttributeType.DataType<D> dataType) |
static <D> AttributeTypeImpl<D> |
get(VertexElement vertexElement) |
Attribute<D> |
getAttribute(D value) |
AttributeType.DataType<D> |
getDataType() |
String |
getRegex() |
Attribute<D> |
putAttribute(D value) |
AttributeType<D> |
setRegex(String regex) |
AttributeType<D> |
sup(AttributeType<D> superType)
This method is overridden so that we can check that the regex of the new super type (if it has a regex)
can be applied to all the existing instances.
|
attribute, attributes, delete, deleteAttribute, deleteKey, deletePlays, directPlays, from, instances, isAbstract, key, keys, plays, plays, plays, property, setAbstract, txCacheClear, txCacheFlushfrom, getLabel, getLabelId, getRulesOfConclusion, getRulesOfHypothesis, innerToString, isImplicit, setLabel, sub, subs, sup, superSetaddEdge, baseType, compareTo, createShard, currentShard, deleteNode, equals, getId, getShardCount, hashCode, isDeleted, setShardCount, shards, toString, vertexclone, finalize, getClass, notify, notifyAll, wait, wait, waitasAttributeType, attribute, deleteAttribute, deleteKey, deletePlays, instances, isAttributeType, key, plays, setAbstract, setLabel, sub, subs, supasType, attributes, isAbstract, isType, keys, playsasSchemaConcept, getLabel, getLabelId, getRulesOfConclusion, getRulesOfHypothesis, isImplicit, isSchemaConceptasAttribute, asEntity, asEntityType, asRelationship, asRelationshipType, asRole, asRule, asThing, delete, getId, isAttribute, isDeleted, isEntity, isEntityType, isRelationship, isRelationshipType, isRole, isRule, isThingcompareTofromfrompublic static <D> AttributeTypeImpl<D> get(VertexElement vertexElement)
public static <D> AttributeTypeImpl<D> create(VertexElement vertexElement, AttributeType<D> type, AttributeType.DataType<D> dataType)
public AttributeType<D> sup(AttributeType<D> superType)
sup in interface AttributeType<D>sup in class SchemaConceptImpl<AttributeType<D>>superType - This type's super typepublic AttributeType<D> setRegex(String regex)
setRegex in interface AttributeType<D>regex - The regular expression which instances of this resource must conform to.AttributeType itself.public Attribute<D> putAttribute(D value)
putAttribute in interface AttributeType<D>public Attribute<D> getAttribute(D value)
getAttribute in interface AttributeType<D>public AttributeType.DataType<D> getDataType()
getDataType in interface AttributeType<D>public String getRegex()
getRegex in interface AttributeType<D>Copyright © 2017 Grakn Labs Ltd. All rights reserved.