Java driver API reference
Connection
TypeDB
Package: com.typedb.driver
Name | Type | Description |
---|---|---|
|
|
driver
public static Driver driver(java.lang.String address,
Credentials credentials,
DriverOptions driverOptions)
throws TypeDBDriverException
Open a TypeDB Driver to a TypeDB server available at the provided address.
Name | Description | Type |
---|---|---|
|
The address of the TypeDB server |
|
|
The credentials to connect with |
|
|
The connection settings to connect with |
|
public static Driver
TypeDB.driver(address);
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/connection/TypeDBDriver.adoc[]
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/connection/TypeDBCredential.adoc[]
DatabaseManager
Package: com.typedb.driver.api.database
Provides access to all database management methods.
all
@CheckReturnValue
java.util.List<Database> all()
throws TypeDBDriverException
Retrieves all databases present on the TypeDB server
java.util.List<Database>
driver.databases().all()
contains
@CheckReturnValue
boolean contains(java.lang.String name)
throws TypeDBDriverException
Checks if a database with the given name exists
Name | Description | Type |
---|---|---|
|
The database name to be checked |
|
boolean
driver.databases().contains(name)
Database
Package: com.typedb.driver.api.database
delete
void delete()
throws TypeDBDriverException
Deletes this database.
void
database.delete()
name
@CheckReturnValue
java.lang.String name()
The database name as a string.
java.lang.String
schema
@CheckReturnValue
java.lang.String schema()
throws TypeDBDriverException
A full schema text as a valid TypeQL define query string.
java.lang.String
database.schema()
typeSchema
@CheckReturnValue
java.lang.String typeSchema()
throws TypeDBDriverException
The types in the schema as a valid TypeQL define query string.
java.lang.String
database.typeSchema()
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/connection/Database.Replica.adoc[]
UserManager
Package: com.typedb.driver.api.user
Provides access to all user management methods.
all
java.util.Set<User> all()
throws TypeDBDriverException
Retrieves all users which exist on the TypeDB server.
java.util.Set<User>
driver.users().all();
contains
@CheckReturnValue
boolean contains(java.lang.String username)
throws TypeDBDriverException
Checks if a user with the given name exists.
Name | Description | Type |
---|---|---|
|
The user name to be checked |
|
boolean
driver.users().contains(username);
create
void create(java.lang.String username,
java.lang.String password)
throws TypeDBDriverException
Creates a user with the given name & password.
Name | Description | Type |
---|---|---|
|
The name of the user to be created |
|
|
The password of the user to be created |
|
void
driver.users().create(username, password);
Session
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/session/TypeDBSession.adoc[]
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/session/TypeDBSession.Type.adoc[]
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/session/TypeDBOptions.adoc[]
Transaction
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/transaction/TypeDBTransaction.adoc[]
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/transaction/TypeDBTransaction.Type.adoc[]
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/transaction/QueryManager.adoc[]
Answer
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/answer/ConceptMapGroup.adoc[]
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/answer/ConceptMap.adoc[]
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/answer/ValueGroup.adoc[]
JSON
Package: com.typedb.driver.api.answer
Promise<T>
Package: com.typedb.driver.common
A Promise
represents an asynchronous network operation.
The request it represents is performed immediately. The response is only retrieved once the Promise
is resolve
d.
Promise
public Promise(java.util.function.Supplier<T> inner)
Promise constructor
Name | Description | Type |
---|---|---|
|
The supplier to function to wrap into the promise |
|
public
new Promise(supplier)
map
public static <T,U> Promise<U> map(java.util.function.Supplier<T> promise,
java.util.function.Function<T,U> fn)
Helper function to map promises.
Name | Description | Type |
---|---|---|
|
The supplier function to wrap into the promise |
|
|
The mapping function |
|
public static <T,U> Promise<U>
Promise.map(supplier, mapper);
resolve
public T resolve()
Retrieves the result of the Promise.
public T
promise.resolve()
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/answer/ConceptMap.Explainables.adoc[]
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/answer/ConceptMap.Explainable.adoc[]
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/answer/Explanation.adoc[]
Concept
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/concept/ConceptManager.adoc[]
Concept
Package: com.typedb.driver.api.concept
Name | Type | Description |
---|---|---|
|
|
asAttribute
default Attribute asAttribute()
Casts the concept to Attribute
.
Attribute
concept.asAttribute();
asAttributeType
default AttributeType asAttributeType()
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType();
asEntity
default Entity asEntity()
Casts the concept to Entity
.
Entity
concept.asEntity();
asEntityType
default EntityType asEntityType()
Casts the concept to EntityType
.
EntityType
concept.asEntityType();
asInstance
default Instance asInstance()
Casts the concept to Instance
.
Instance
concept.asInstance();
asRelation
default Relation asRelation()
Casts the concept to Relation
.
Relation
concept.asRelation();
asRelationType
default RelationType asRelationType()
Casts the concept to RelationType
.
RelationType
concept.asRelationType();
asRoleType
default RoleType asRoleType()
Casts the concept to RoleType
.
RoleType
concept.asRoleType();
asType
default Type asType()
Casts the concept to Type
.
Type
concept.asType();
asValue
default Value asValue()
Casts the concept to Value
.
Value
concept.asValue();
getLabel
@CheckReturnValue
java.lang.String getLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance ("unknown" if type fetching is disabled). If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.lang.String
concept.getLabel();
isAttribute
@CheckReturnValue
default boolean isAttribute()
Checks if the concept is an Attribute
.
boolean
concept.isAttribute();
isAttributeType
@CheckReturnValue
default boolean isAttributeType()
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType();
isBoolean
@CheckReturnValue
boolean isBoolean()
Returns true
if the value which this Concept
holds is of type boolean
or if this Concept
is an AttributeType
of type boolean
. Otherwise, returns false
.
boolean
concept.isBoolean()
isDate
@CheckReturnValue
boolean isDate()
Returns true
if the value which this Concept
holds is of type date
or if this Concept
is an AttributeType
of type date
. Otherwise, returns false
.
boolean
concept.isDate();
isDatetime
@CheckReturnValue
boolean isDatetime()
Returns true
if the value which this Concept
holds is of type datetime
or if this Concept
is an AttributeType
of type datetime
. Otherwise, returns false
.
boolean
concept.isDatetime();
isDatetimeTZ
@CheckReturnValue
boolean isDatetimeTZ()
Returns true
if the value which this Concept
holds is of type datetime-tz
or if this Concept
is an AttributeType
of type datetime-tz
. Otherwise, returns false
.
boolean
concept.isDatetimeTZ();
isDecimal
@CheckReturnValue
boolean isDecimal()
Returns true
if the value which this Concept
holds is of type decimal
or if this Concept
is an AttributeType
of type decimal
. Otherwise, returns false
.
boolean
concept.isDecimal();
isDouble
@CheckReturnValue
boolean isDouble()
Returns true
if the value which this Concept
holds is of type double
or if this Concept
is an AttributeType
of type double
. Otherwise, returns false
.
boolean
concept.isDouble();
isDuration
@CheckReturnValue
boolean isDuration()
Returns true
if the value which this Concept
holds is of type duration
or if this Concept
is an AttributeType
of type duration
. Otherwise, returns false
.
boolean
concept.isDuration();
isEntity
@CheckReturnValue
default boolean isEntity()
Checks if the concept is an Entity
.
boolean
concept.isEntity();
isEntityType
@CheckReturnValue
default boolean isEntityType()
Checks if the concept is an EntityType
.
boolean
concept.isEntityType();
isInstance
@CheckReturnValue
default boolean isInstance()
Checks if the concept is an Instance
.
boolean
concept.isInstance();
isInteger
@CheckReturnValue
boolean isInteger()
Returns true
if the value which this Concept
holds is of type integer
or if this Concept
is an AttributeType
of type integer
. Otherwise, returns false
.
boolean
concept.isInteger();
isRelation
@CheckReturnValue
default boolean isRelation()
Checks if the concept is a Relation
.
boolean
concept.isRelation();
isRelationType
@CheckReturnValue
default boolean isRelationType()
Checks if the concept is a RelationType
.
boolean
concept.isRelationType();
isRoleType
@CheckReturnValue
default boolean isRoleType()
Checks if the concept is a RoleType
.
boolean
concept.isRoleType();
isString
@CheckReturnValue
boolean isString()
Returns true
if the value which this Concept
holds is of type string
or if this Concept
is an AttributeType
of type string
. Otherwise, returns false
.
boolean
concept.isString();
isStruct
@CheckReturnValue
boolean isStruct()
Returns true
if the value which this Concept
holds is of type struct
or if this Concept
is an AttributeType
of type struct
. Otherwise, returns false
.
boolean
concept.isStruct();
isType
@CheckReturnValue
default boolean isType()
Checks if the concept is a Type
.
boolean
concept.isType();
isValue
@CheckReturnValue
default boolean isValue()
Checks if the concept is a Value
.
boolean
concept.isValue();
tryGetBoolean
java.util.Optional<java.lang.Boolean> tryGetBoolean()
Returns a boolean
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Boolean>
concept.tryGetBoolean();
tryGetDate
java.util.Optional<java.time.LocalDate> tryGetDate()
Returns a date
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDate>
concept.tryGetDate();
tryGetDatetime
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
Returns a datetime
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDateTime>
concept.tryGetDatetime();
tryGetDatetimeTZ
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
Returns a datetime-tz
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.ZonedDateTime>
concept.tryGetDatetimeTZ();
tryGetDecimal
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
Returns a decimal
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.math.BigDecimal>
concept.tryGetDecimal();
tryGetDouble
java.util.Optional<java.lang.Double> tryGetDouble()
Returns a double
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Double>
concept.tryGetDouble();
tryGetDuration
java.util.Optional<Duration> tryGetDuration()
Returns a duration
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<Duration>
concept.tryGetDuration();
tryGetIID
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
Retrieves the unique id of the Concept
. Returns null
if absent.
java.util.Optional<java.lang.String>
concept.tryGetIID();
tryGetInteger
java.util.Optional<java.lang.Long> tryGetInteger()
Returns a integer
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Long>
concept.tryGetInteger();
tryGetLabel
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance (null
if type fetching is disabled). Returns null
if type fetching is disabled. If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.util.Optional<java.lang.String>
concept.tryGetLabel();
tryGetString
java.util.Optional<java.lang.String> tryGetString()
Returns a string
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.String>
concept.tryGetString();
tryGetStruct
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>> tryGetStruct()
Returns a struct
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>>
concept.tryGetStruct();
Schema
Type
Package: com.typedb.driver.api.concept.type
Superinterfaces:
-
Concept
asAttribute
default Attribute asAttribute()
Casts the concept to Attribute
.
Attribute
concept.asAttribute();
asAttributeType
default AttributeType asAttributeType()
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType();
asEntity
default Entity asEntity()
Casts the concept to Entity
.
Entity
concept.asEntity();
asEntityType
default EntityType asEntityType()
Casts the concept to EntityType
.
EntityType
concept.asEntityType();
asInstance
default Instance asInstance()
Casts the concept to Instance
.
Instance
concept.asInstance();
asRelation
default Relation asRelation()
Casts the concept to Relation
.
Relation
concept.asRelation();
asRelationType
default RelationType asRelationType()
Casts the concept to RelationType
.
RelationType
concept.asRelationType();
asRoleType
default RoleType asRoleType()
Casts the concept to RoleType
.
RoleType
concept.asRoleType();
asType
@CheckReturnValue
default Type asType()
Casts the concept to Type
.
Type
concept.asType();
asValue
default Value asValue()
Casts the concept to Value
.
Value
concept.asValue();
getLabel
@CheckReturnValue
java.lang.String getLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance ("unknown" if type fetching is disabled). If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.lang.String
concept.getLabel();
isAttribute
@CheckReturnValue
default boolean isAttribute()
Checks if the concept is an Attribute
.
boolean
concept.isAttribute();
isAttributeType
@CheckReturnValue
default boolean isAttributeType()
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType();
isBoolean
@CheckReturnValue
boolean isBoolean()
Returns true
if the value which this Concept
holds is of type boolean
or if this Concept
is an AttributeType
of type boolean
. Otherwise, returns false
.
boolean
concept.isBoolean()
isDate
@CheckReturnValue
boolean isDate()
Returns true
if the value which this Concept
holds is of type date
or if this Concept
is an AttributeType
of type date
. Otherwise, returns false
.
boolean
concept.isDate();
isDatetime
@CheckReturnValue
boolean isDatetime()
Returns true
if the value which this Concept
holds is of type datetime
or if this Concept
is an AttributeType
of type datetime
. Otherwise, returns false
.
boolean
concept.isDatetime();
isDatetimeTZ
@CheckReturnValue
boolean isDatetimeTZ()
Returns true
if the value which this Concept
holds is of type datetime-tz
or if this Concept
is an AttributeType
of type datetime-tz
. Otherwise, returns false
.
boolean
concept.isDatetimeTZ();
isDecimal
@CheckReturnValue
boolean isDecimal()
Returns true
if the value which this Concept
holds is of type decimal
or if this Concept
is an AttributeType
of type decimal
. Otherwise, returns false
.
boolean
concept.isDecimal();
isDouble
@CheckReturnValue
boolean isDouble()
Returns true
if the value which this Concept
holds is of type double
or if this Concept
is an AttributeType
of type double
. Otherwise, returns false
.
boolean
concept.isDouble();
isDuration
@CheckReturnValue
boolean isDuration()
Returns true
if the value which this Concept
holds is of type duration
or if this Concept
is an AttributeType
of type duration
. Otherwise, returns false
.
boolean
concept.isDuration();
isEntity
@CheckReturnValue
default boolean isEntity()
Checks if the concept is an Entity
.
boolean
concept.isEntity();
isEntityType
@CheckReturnValue
default boolean isEntityType()
Checks if the concept is an EntityType
.
boolean
concept.isEntityType();
isInstance
@CheckReturnValue
default boolean isInstance()
Checks if the concept is an Instance
.
boolean
concept.isInstance();
isInteger
@CheckReturnValue
boolean isInteger()
Returns true
if the value which this Concept
holds is of type integer
or if this Concept
is an AttributeType
of type integer
. Otherwise, returns false
.
boolean
concept.isInteger();
isRelation
@CheckReturnValue
default boolean isRelation()
Checks if the concept is a Relation
.
boolean
concept.isRelation();
isRelationType
@CheckReturnValue
default boolean isRelationType()
Checks if the concept is a RelationType
.
boolean
concept.isRelationType();
isRoleType
@CheckReturnValue
default boolean isRoleType()
Checks if the concept is a RoleType
.
boolean
concept.isRoleType();
isString
@CheckReturnValue
boolean isString()
Returns true
if the value which this Concept
holds is of type string
or if this Concept
is an AttributeType
of type string
. Otherwise, returns false
.
boolean
concept.isString();
isStruct
@CheckReturnValue
boolean isStruct()
Returns true
if the value which this Concept
holds is of type struct
or if this Concept
is an AttributeType
of type struct
. Otherwise, returns false
.
boolean
concept.isStruct();
isType
@CheckReturnValue
default boolean isType()
Checks if the concept is a Type
.
boolean
concept.isType();
isValue
@CheckReturnValue
default boolean isValue()
Checks if the concept is a Value
.
boolean
concept.isValue();
tryGetBoolean
java.util.Optional<java.lang.Boolean> tryGetBoolean()
Returns a boolean
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Boolean>
concept.tryGetBoolean();
tryGetDate
java.util.Optional<java.time.LocalDate> tryGetDate()
Returns a date
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDate>
concept.tryGetDate();
tryGetDatetime
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
Returns a datetime
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDateTime>
concept.tryGetDatetime();
tryGetDatetimeTZ
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
Returns a datetime-tz
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.ZonedDateTime>
concept.tryGetDatetimeTZ();
tryGetDecimal
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
Returns a decimal
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.math.BigDecimal>
concept.tryGetDecimal();
tryGetDouble
java.util.Optional<java.lang.Double> tryGetDouble()
Returns a double
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Double>
concept.tryGetDouble();
tryGetDuration
java.util.Optional<Duration> tryGetDuration()
Returns a duration
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<Duration>
concept.tryGetDuration();
tryGetIID
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
Retrieves the unique id of the Concept
. Returns null
if absent.
java.util.Optional<java.lang.String>
concept.tryGetIID();
tryGetInteger
java.util.Optional<java.lang.Long> tryGetInteger()
Returns a integer
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Long>
concept.tryGetInteger();
tryGetLabel
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance (null
if type fetching is disabled). Returns null
if type fetching is disabled. If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.util.Optional<java.lang.String>
concept.tryGetLabel();
tryGetString
java.util.Optional<java.lang.String> tryGetString()
Returns a string
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.String>
concept.tryGetString();
tryGetStruct
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>> tryGetStruct()
Returns a struct
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>>
concept.tryGetStruct();
tryGetValue
@CheckReturnValue
java.util.Optional<Value> tryGetValue()
Retrieves the value which this Concept
holds. Returns null
if this Concept
does not hold any value.
java.util.Optional<Value>
concept.tryGetValue();
tryGetValueType
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()
Retrieves the String
describing the value type of this Concept
. Returns null
if not absent.
java.util.Optional<java.lang.String>
concept.tryGetValueType();
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/schema/Label.adoc[]
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/schema/ThingType.adoc[]
EntityType
Package: com.typedb.driver.api.concept.type
Superinterfaces:
-
Concept
-
Type
Entity types represent the classification of independent objects in the data model of the business domain.
asAttribute
default Attribute asAttribute()
Casts the concept to Attribute
.
Attribute
concept.asAttribute();
asAttributeType
default AttributeType asAttributeType()
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType();
asEntity
default Entity asEntity()
Casts the concept to Entity
.
Entity
concept.asEntity();
asEntityType
@CheckReturnValue
default EntityType asEntityType()
Casts the concept to EntityType
.
EntityType
concept.asEntityType();
asInstance
default Instance asInstance()
Casts the concept to Instance
.
Instance
concept.asInstance();
asRelation
default Relation asRelation()
Casts the concept to Relation
.
Relation
concept.asRelation();
asRelationType
default RelationType asRelationType()
Casts the concept to RelationType
.
RelationType
concept.asRelationType();
asRoleType
default RoleType asRoleType()
Casts the concept to RoleType
.
RoleType
concept.asRoleType();
asValue
default Value asValue()
Casts the concept to Value
.
Value
concept.asValue();
getLabel
@CheckReturnValue
java.lang.String getLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance ("unknown" if type fetching is disabled). If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.lang.String
concept.getLabel();
isAttribute
@CheckReturnValue
default boolean isAttribute()
Checks if the concept is an Attribute
.
boolean
concept.isAttribute();
isAttributeType
@CheckReturnValue
default boolean isAttributeType()
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType();
isBoolean
@CheckReturnValue
boolean isBoolean()
Returns true
if the value which this Concept
holds is of type boolean
or if this Concept
is an AttributeType
of type boolean
. Otherwise, returns false
.
boolean
concept.isBoolean()
isDate
@CheckReturnValue
boolean isDate()
Returns true
if the value which this Concept
holds is of type date
or if this Concept
is an AttributeType
of type date
. Otherwise, returns false
.
boolean
concept.isDate();
isDatetime
@CheckReturnValue
boolean isDatetime()
Returns true
if the value which this Concept
holds is of type datetime
or if this Concept
is an AttributeType
of type datetime
. Otherwise, returns false
.
boolean
concept.isDatetime();
isDatetimeTZ
@CheckReturnValue
boolean isDatetimeTZ()
Returns true
if the value which this Concept
holds is of type datetime-tz
or if this Concept
is an AttributeType
of type datetime-tz
. Otherwise, returns false
.
boolean
concept.isDatetimeTZ();
isDecimal
@CheckReturnValue
boolean isDecimal()
Returns true
if the value which this Concept
holds is of type decimal
or if this Concept
is an AttributeType
of type decimal
. Otherwise, returns false
.
boolean
concept.isDecimal();
isDouble
@CheckReturnValue
boolean isDouble()
Returns true
if the value which this Concept
holds is of type double
or if this Concept
is an AttributeType
of type double
. Otherwise, returns false
.
boolean
concept.isDouble();
isDuration
@CheckReturnValue
boolean isDuration()
Returns true
if the value which this Concept
holds is of type duration
or if this Concept
is an AttributeType
of type duration
. Otherwise, returns false
.
boolean
concept.isDuration();
isEntity
@CheckReturnValue
default boolean isEntity()
Checks if the concept is an Entity
.
boolean
concept.isEntity();
isEntityType
@CheckReturnValue
default boolean isEntityType()
Checks if the concept is an EntityType
.
boolean
concept.isEntityType();
isInstance
@CheckReturnValue
default boolean isInstance()
Checks if the concept is an Instance
.
boolean
concept.isInstance();
isInteger
@CheckReturnValue
boolean isInteger()
Returns true
if the value which this Concept
holds is of type integer
or if this Concept
is an AttributeType
of type integer
. Otherwise, returns false
.
boolean
concept.isInteger();
isRelation
@CheckReturnValue
default boolean isRelation()
Checks if the concept is a Relation
.
boolean
concept.isRelation();
isRelationType
@CheckReturnValue
default boolean isRelationType()
Checks if the concept is a RelationType
.
boolean
concept.isRelationType();
isRoleType
@CheckReturnValue
default boolean isRoleType()
Checks if the concept is a RoleType
.
boolean
concept.isRoleType();
isString
@CheckReturnValue
boolean isString()
Returns true
if the value which this Concept
holds is of type string
or if this Concept
is an AttributeType
of type string
. Otherwise, returns false
.
boolean
concept.isString();
isStruct
@CheckReturnValue
boolean isStruct()
Returns true
if the value which this Concept
holds is of type struct
or if this Concept
is an AttributeType
of type struct
. Otherwise, returns false
.
boolean
concept.isStruct();
isValue
@CheckReturnValue
default boolean isValue()
Checks if the concept is a Value
.
boolean
concept.isValue();
tryGetBoolean
java.util.Optional<java.lang.Boolean> tryGetBoolean()
Returns a boolean
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Boolean>
concept.tryGetBoolean();
tryGetDate
java.util.Optional<java.time.LocalDate> tryGetDate()
Returns a date
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDate>
concept.tryGetDate();
tryGetDatetime
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
Returns a datetime
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDateTime>
concept.tryGetDatetime();
tryGetDatetimeTZ
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
Returns a datetime-tz
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.ZonedDateTime>
concept.tryGetDatetimeTZ();
tryGetDecimal
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
Returns a decimal
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.math.BigDecimal>
concept.tryGetDecimal();
tryGetDouble
java.util.Optional<java.lang.Double> tryGetDouble()
Returns a double
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Double>
concept.tryGetDouble();
tryGetDuration
java.util.Optional<Duration> tryGetDuration()
Returns a duration
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<Duration>
concept.tryGetDuration();
tryGetIID
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
Retrieves the unique id of the Concept
. Returns null
if absent.
java.util.Optional<java.lang.String>
concept.tryGetIID();
tryGetInteger
java.util.Optional<java.lang.Long> tryGetInteger()
Returns a integer
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Long>
concept.tryGetInteger();
tryGetLabel
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance (null
if type fetching is disabled). Returns null
if type fetching is disabled. If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.util.Optional<java.lang.String>
concept.tryGetLabel();
tryGetString
java.util.Optional<java.lang.String> tryGetString()
Returns a string
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.String>
concept.tryGetString();
tryGetStruct
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>> tryGetStruct()
Returns a struct
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>>
concept.tryGetStruct();
RelationType
Package: com.typedb.driver.api.concept.type
Superinterfaces:
-
Concept
-
Type
Relation types (or subtypes of the relation root type) represent relationships between types. Relation types have roles. Other types can play roles in relations if it’s mentioned in their definition. A relation type must specify at least one role.
asAttribute
default Attribute asAttribute()
Casts the concept to Attribute
.
Attribute
concept.asAttribute();
asAttributeType
default AttributeType asAttributeType()
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType();
asEntity
default Entity asEntity()
Casts the concept to Entity
.
Entity
concept.asEntity();
asEntityType
default EntityType asEntityType()
Casts the concept to EntityType
.
EntityType
concept.asEntityType();
asInstance
default Instance asInstance()
Casts the concept to Instance
.
Instance
concept.asInstance();
asRelation
default Relation asRelation()
Casts the concept to Relation
.
Relation
concept.asRelation();
asRelationType
@CheckReturnValue
default RelationType asRelationType()
Casts the concept to RelationType
.
RelationType
concept.asRelationType();
asRoleType
default RoleType asRoleType()
Casts the concept to RoleType
.
RoleType
concept.asRoleType();
asValue
default Value asValue()
Casts the concept to Value
.
Value
concept.asValue();
getLabel
@CheckReturnValue
java.lang.String getLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance ("unknown" if type fetching is disabled). If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.lang.String
concept.getLabel();
isAttribute
@CheckReturnValue
default boolean isAttribute()
Checks if the concept is an Attribute
.
boolean
concept.isAttribute();
isAttributeType
@CheckReturnValue
default boolean isAttributeType()
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType();
isBoolean
@CheckReturnValue
boolean isBoolean()
Returns true
if the value which this Concept
holds is of type boolean
or if this Concept
is an AttributeType
of type boolean
. Otherwise, returns false
.
boolean
concept.isBoolean()
isDate
@CheckReturnValue
boolean isDate()
Returns true
if the value which this Concept
holds is of type date
or if this Concept
is an AttributeType
of type date
. Otherwise, returns false
.
boolean
concept.isDate();
isDatetime
@CheckReturnValue
boolean isDatetime()
Returns true
if the value which this Concept
holds is of type datetime
or if this Concept
is an AttributeType
of type datetime
. Otherwise, returns false
.
boolean
concept.isDatetime();
isDatetimeTZ
@CheckReturnValue
boolean isDatetimeTZ()
Returns true
if the value which this Concept
holds is of type datetime-tz
or if this Concept
is an AttributeType
of type datetime-tz
. Otherwise, returns false
.
boolean
concept.isDatetimeTZ();
isDecimal
@CheckReturnValue
boolean isDecimal()
Returns true
if the value which this Concept
holds is of type decimal
or if this Concept
is an AttributeType
of type decimal
. Otherwise, returns false
.
boolean
concept.isDecimal();
isDouble
@CheckReturnValue
boolean isDouble()
Returns true
if the value which this Concept
holds is of type double
or if this Concept
is an AttributeType
of type double
. Otherwise, returns false
.
boolean
concept.isDouble();
isDuration
@CheckReturnValue
boolean isDuration()
Returns true
if the value which this Concept
holds is of type duration
or if this Concept
is an AttributeType
of type duration
. Otherwise, returns false
.
boolean
concept.isDuration();
isEntity
@CheckReturnValue
default boolean isEntity()
Checks if the concept is an Entity
.
boolean
concept.isEntity();
isEntityType
@CheckReturnValue
default boolean isEntityType()
Checks if the concept is an EntityType
.
boolean
concept.isEntityType();
isInstance
@CheckReturnValue
default boolean isInstance()
Checks if the concept is an Instance
.
boolean
concept.isInstance();
isInteger
@CheckReturnValue
boolean isInteger()
Returns true
if the value which this Concept
holds is of type integer
or if this Concept
is an AttributeType
of type integer
. Otherwise, returns false
.
boolean
concept.isInteger();
isRelation
@CheckReturnValue
default boolean isRelation()
Checks if the concept is a Relation
.
boolean
concept.isRelation();
isRelationType
@CheckReturnValue
default boolean isRelationType()
Checks if the concept is a RelationType
.
boolean
concept.isRelationType();
isRoleType
@CheckReturnValue
default boolean isRoleType()
Checks if the concept is a RoleType
.
boolean
concept.isRoleType();
isString
@CheckReturnValue
boolean isString()
Returns true
if the value which this Concept
holds is of type string
or if this Concept
is an AttributeType
of type string
. Otherwise, returns false
.
boolean
concept.isString();
isStruct
@CheckReturnValue
boolean isStruct()
Returns true
if the value which this Concept
holds is of type struct
or if this Concept
is an AttributeType
of type struct
. Otherwise, returns false
.
boolean
concept.isStruct();
isValue
@CheckReturnValue
default boolean isValue()
Checks if the concept is a Value
.
boolean
concept.isValue();
tryGetBoolean
java.util.Optional<java.lang.Boolean> tryGetBoolean()
Returns a boolean
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Boolean>
concept.tryGetBoolean();
tryGetDate
java.util.Optional<java.time.LocalDate> tryGetDate()
Returns a date
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDate>
concept.tryGetDate();
tryGetDatetime
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
Returns a datetime
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDateTime>
concept.tryGetDatetime();
tryGetDatetimeTZ
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
Returns a datetime-tz
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.ZonedDateTime>
concept.tryGetDatetimeTZ();
tryGetDecimal
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
Returns a decimal
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.math.BigDecimal>
concept.tryGetDecimal();
tryGetDouble
java.util.Optional<java.lang.Double> tryGetDouble()
Returns a double
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Double>
concept.tryGetDouble();
tryGetDuration
java.util.Optional<Duration> tryGetDuration()
Returns a duration
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<Duration>
concept.tryGetDuration();
tryGetIID
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
Retrieves the unique id of the Concept
. Returns null
if absent.
java.util.Optional<java.lang.String>
concept.tryGetIID();
tryGetInteger
java.util.Optional<java.lang.Long> tryGetInteger()
Returns a integer
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Long>
concept.tryGetInteger();
tryGetLabel
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance (null
if type fetching is disabled). Returns null
if type fetching is disabled. If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.util.Optional<java.lang.String>
concept.tryGetLabel();
tryGetString
java.util.Optional<java.lang.String> tryGetString()
Returns a string
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.String>
concept.tryGetString();
tryGetStruct
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>> tryGetStruct()
Returns a struct
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>>
concept.tryGetStruct();
RoleType
Package: com.typedb.driver.api.concept.type
Superinterfaces:
-
Concept
-
Type
Roles are special internal types used by relations. We can not create an instance of a role in a database. But we can set an instance of another type (role player) to play a role in a particular instance of a relation type. Roles allow a schema to enforce logical constraints on types of role players.
asAttribute
default Attribute asAttribute()
Casts the concept to Attribute
.
Attribute
concept.asAttribute();
asAttributeType
default AttributeType asAttributeType()
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType();
asEntity
default Entity asEntity()
Casts the concept to Entity
.
Entity
concept.asEntity();
asEntityType
default EntityType asEntityType()
Casts the concept to EntityType
.
EntityType
concept.asEntityType();
asInstance
default Instance asInstance()
Casts the concept to Instance
.
Instance
concept.asInstance();
asRelation
default Relation asRelation()
Casts the concept to Relation
.
Relation
concept.asRelation();
asRelationType
default RelationType asRelationType()
Casts the concept to RelationType
.
RelationType
concept.asRelationType();
asRoleType
@CheckReturnValue
default RoleType asRoleType()
Casts the concept to RoleType
.
RoleType
concept.asRoleType();
asValue
default Value asValue()
Casts the concept to Value
.
Value
concept.asValue();
getLabel
@CheckReturnValue
java.lang.String getLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance ("unknown" if type fetching is disabled). If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.lang.String
concept.getLabel();
isAttribute
@CheckReturnValue
default boolean isAttribute()
Checks if the concept is an Attribute
.
boolean
concept.isAttribute();
isAttributeType
@CheckReturnValue
default boolean isAttributeType()
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType();
isBoolean
@CheckReturnValue
boolean isBoolean()
Returns true
if the value which this Concept
holds is of type boolean
or if this Concept
is an AttributeType
of type boolean
. Otherwise, returns false
.
boolean
concept.isBoolean()
isDate
@CheckReturnValue
boolean isDate()
Returns true
if the value which this Concept
holds is of type date
or if this Concept
is an AttributeType
of type date
. Otherwise, returns false
.
boolean
concept.isDate();
isDatetime
@CheckReturnValue
boolean isDatetime()
Returns true
if the value which this Concept
holds is of type datetime
or if this Concept
is an AttributeType
of type datetime
. Otherwise, returns false
.
boolean
concept.isDatetime();
isDatetimeTZ
@CheckReturnValue
boolean isDatetimeTZ()
Returns true
if the value which this Concept
holds is of type datetime-tz
or if this Concept
is an AttributeType
of type datetime-tz
. Otherwise, returns false
.
boolean
concept.isDatetimeTZ();
isDecimal
@CheckReturnValue
boolean isDecimal()
Returns true
if the value which this Concept
holds is of type decimal
or if this Concept
is an AttributeType
of type decimal
. Otherwise, returns false
.
boolean
concept.isDecimal();
isDouble
@CheckReturnValue
boolean isDouble()
Returns true
if the value which this Concept
holds is of type double
or if this Concept
is an AttributeType
of type double
. Otherwise, returns false
.
boolean
concept.isDouble();
isDuration
@CheckReturnValue
boolean isDuration()
Returns true
if the value which this Concept
holds is of type duration
or if this Concept
is an AttributeType
of type duration
. Otherwise, returns false
.
boolean
concept.isDuration();
isEntity
@CheckReturnValue
default boolean isEntity()
Checks if the concept is an Entity
.
boolean
concept.isEntity();
isEntityType
@CheckReturnValue
default boolean isEntityType()
Checks if the concept is an EntityType
.
boolean
concept.isEntityType();
isInstance
@CheckReturnValue
default boolean isInstance()
Checks if the concept is an Instance
.
boolean
concept.isInstance();
isInteger
@CheckReturnValue
boolean isInteger()
Returns true
if the value which this Concept
holds is of type integer
or if this Concept
is an AttributeType
of type integer
. Otherwise, returns false
.
boolean
concept.isInteger();
isRelation
@CheckReturnValue
default boolean isRelation()
Checks if the concept is a Relation
.
boolean
concept.isRelation();
isRelationType
@CheckReturnValue
default boolean isRelationType()
Checks if the concept is a RelationType
.
boolean
concept.isRelationType();
isRoleType
@CheckReturnValue
default boolean isRoleType()
Checks if the concept is a RoleType
.
boolean
concept.isRoleType();
isString
@CheckReturnValue
boolean isString()
Returns true
if the value which this Concept
holds is of type string
or if this Concept
is an AttributeType
of type string
. Otherwise, returns false
.
boolean
concept.isString();
isStruct
@CheckReturnValue
boolean isStruct()
Returns true
if the value which this Concept
holds is of type struct
or if this Concept
is an AttributeType
of type struct
. Otherwise, returns false
.
boolean
concept.isStruct();
isValue
@CheckReturnValue
default boolean isValue()
Checks if the concept is a Value
.
boolean
concept.isValue();
tryGetBoolean
java.util.Optional<java.lang.Boolean> tryGetBoolean()
Returns a boolean
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Boolean>
concept.tryGetBoolean();
tryGetDate
java.util.Optional<java.time.LocalDate> tryGetDate()
Returns a date
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDate>
concept.tryGetDate();
tryGetDatetime
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
Returns a datetime
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDateTime>
concept.tryGetDatetime();
tryGetDatetimeTZ
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
Returns a datetime-tz
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.ZonedDateTime>
concept.tryGetDatetimeTZ();
tryGetDecimal
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
Returns a decimal
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.math.BigDecimal>
concept.tryGetDecimal();
tryGetDouble
java.util.Optional<java.lang.Double> tryGetDouble()
Returns a double
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Double>
concept.tryGetDouble();
tryGetDuration
java.util.Optional<Duration> tryGetDuration()
Returns a duration
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<Duration>
concept.tryGetDuration();
tryGetIID
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
Retrieves the unique id of the Concept
. Returns null
if absent.
java.util.Optional<java.lang.String>
concept.tryGetIID();
tryGetInteger
java.util.Optional<java.lang.Long> tryGetInteger()
Returns a integer
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Long>
concept.tryGetInteger();
tryGetLabel
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance (null
if type fetching is disabled). Returns null
if type fetching is disabled. If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.util.Optional<java.lang.String>
concept.tryGetLabel();
tryGetString
java.util.Optional<java.lang.String> tryGetString()
Returns a string
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.String>
concept.tryGetString();
tryGetStruct
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>> tryGetStruct()
Returns a struct
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>>
concept.tryGetStruct();
AttributeType
Package: com.typedb.driver.api.concept.type
Superinterfaces:
-
Concept
-
Type
Attribute types represent properties that other types can own.
Attribute types have a value type. This value type is fixed and unique for every given instance of the attribute type.
Other types can own an attribute type. That means that instances of these other types can own an instance of this attribute type. This usually means that an object in our domain has a property with the matching value.
Multiple types can own the same attribute type, and different instances of the same type or different types can share ownership of the same attribute instance.
asAttribute
default Attribute asAttribute()
Casts the concept to Attribute
.
Attribute
concept.asAttribute();
asAttributeType
@CheckReturnValue
default AttributeType asAttributeType()
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType();
asEntity
default Entity asEntity()
Casts the concept to Entity
.
Entity
concept.asEntity();
asEntityType
default EntityType asEntityType()
Casts the concept to EntityType
.
EntityType
concept.asEntityType();
asInstance
default Instance asInstance()
Casts the concept to Instance
.
Instance
concept.asInstance();
asRelation
default Relation asRelation()
Casts the concept to Relation
.
Relation
concept.asRelation();
asRelationType
default RelationType asRelationType()
Casts the concept to RelationType
.
RelationType
concept.asRelationType();
asRoleType
default RoleType asRoleType()
Casts the concept to RoleType
.
RoleType
concept.asRoleType();
asValue
default Value asValue()
Casts the concept to Value
.
Value
concept.asValue();
getLabel
@CheckReturnValue
java.lang.String getLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance ("unknown" if type fetching is disabled). If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.lang.String
concept.getLabel();
isAttribute
@CheckReturnValue
default boolean isAttribute()
Checks if the concept is an Attribute
.
boolean
concept.isAttribute();
isAttributeType
@CheckReturnValue
default boolean isAttributeType()
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType();
isBoolean
@CheckReturnValue
boolean isBoolean()
Returns true
if the value which this Concept
holds is of type boolean
or if this Concept
is an AttributeType
of type boolean
. Otherwise, returns false
.
boolean
concept.isBoolean()
isDate
@CheckReturnValue
boolean isDate()
Returns true
if the value which this Concept
holds is of type date
or if this Concept
is an AttributeType
of type date
. Otherwise, returns false
.
boolean
concept.isDate();
isDatetime
@CheckReturnValue
boolean isDatetime()
Returns true
if the value which this Concept
holds is of type datetime
or if this Concept
is an AttributeType
of type datetime
. Otherwise, returns false
.
boolean
concept.isDatetime();
isDatetimeTZ
@CheckReturnValue
boolean isDatetimeTZ()
Returns true
if the value which this Concept
holds is of type datetime-tz
or if this Concept
is an AttributeType
of type datetime-tz
. Otherwise, returns false
.
boolean
concept.isDatetimeTZ();
isDecimal
@CheckReturnValue
boolean isDecimal()
Returns true
if the value which this Concept
holds is of type decimal
or if this Concept
is an AttributeType
of type decimal
. Otherwise, returns false
.
boolean
concept.isDecimal();
isDouble
@CheckReturnValue
boolean isDouble()
Returns true
if the value which this Concept
holds is of type double
or if this Concept
is an AttributeType
of type double
. Otherwise, returns false
.
boolean
concept.isDouble();
isDuration
@CheckReturnValue
boolean isDuration()
Returns true
if the value which this Concept
holds is of type duration
or if this Concept
is an AttributeType
of type duration
. Otherwise, returns false
.
boolean
concept.isDuration();
isEntity
@CheckReturnValue
default boolean isEntity()
Checks if the concept is an Entity
.
boolean
concept.isEntity();
isEntityType
@CheckReturnValue
default boolean isEntityType()
Checks if the concept is an EntityType
.
boolean
concept.isEntityType();
isInstance
@CheckReturnValue
default boolean isInstance()
Checks if the concept is an Instance
.
boolean
concept.isInstance();
isInteger
@CheckReturnValue
boolean isInteger()
Returns true
if the value which this Concept
holds is of type integer
or if this Concept
is an AttributeType
of type integer
. Otherwise, returns false
.
boolean
concept.isInteger();
isRelation
@CheckReturnValue
default boolean isRelation()
Checks if the concept is a Relation
.
boolean
concept.isRelation();
isRelationType
@CheckReturnValue
default boolean isRelationType()
Checks if the concept is a RelationType
.
boolean
concept.isRelationType();
isRoleType
@CheckReturnValue
default boolean isRoleType()
Checks if the concept is a RoleType
.
boolean
concept.isRoleType();
isString
@CheckReturnValue
boolean isString()
Returns true
if the value which this Concept
holds is of type string
or if this Concept
is an AttributeType
of type string
. Otherwise, returns false
.
boolean
concept.isString();
isStruct
@CheckReturnValue
boolean isStruct()
Returns true
if the value which this Concept
holds is of type struct
or if this Concept
is an AttributeType
of type struct
. Otherwise, returns false
.
boolean
concept.isStruct();
isValue
@CheckReturnValue
default boolean isValue()
Checks if the concept is a Value
.
boolean
concept.isValue();
tryGetBoolean
java.util.Optional<java.lang.Boolean> tryGetBoolean()
Returns a boolean
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Boolean>
concept.tryGetBoolean();
tryGetDate
java.util.Optional<java.time.LocalDate> tryGetDate()
Returns a date
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDate>
concept.tryGetDate();
tryGetDatetime
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
Returns a datetime
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDateTime>
concept.tryGetDatetime();
tryGetDatetimeTZ
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
Returns a datetime-tz
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.ZonedDateTime>
concept.tryGetDatetimeTZ();
tryGetDecimal
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
Returns a decimal
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.math.BigDecimal>
concept.tryGetDecimal();
tryGetDouble
java.util.Optional<java.lang.Double> tryGetDouble()
Returns a double
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Double>
concept.tryGetDouble();
tryGetDuration
java.util.Optional<Duration> tryGetDuration()
Returns a duration
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<Duration>
concept.tryGetDuration();
tryGetIID
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
Retrieves the unique id of the Concept
. Returns null
if absent.
java.util.Optional<java.lang.String>
concept.tryGetIID();
tryGetInteger
java.util.Optional<java.lang.Long> tryGetInteger()
Returns a integer
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Long>
concept.tryGetInteger();
tryGetLabel
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance (null
if type fetching is disabled). Returns null
if type fetching is disabled. If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.util.Optional<java.lang.String>
concept.tryGetLabel();
tryGetString
java.util.Optional<java.lang.String> tryGetString()
Returns a string
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.String>
concept.tryGetString();
tryGetStruct
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>> tryGetStruct()
Returns a struct
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>>
concept.tryGetStruct();
tryGetValue
@CheckReturnValue
java.util.Optional<Value> tryGetValue()
Retrieves the value which this Concept
holds. Returns null
if this Concept
does not hold any value.
java.util.Optional<Value>
concept.tryGetValue();
tryGetValueType
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()
Retrieves the String
describing the value type of this Concept
. Returns null
if not absent.
java.util.Optional<java.lang.String>
concept.tryGetValueType();
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/schema/ThingType.Annotation.adoc[]
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/schema/Concept.Transitivity.adoc[]
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/schema/Value.Type.adoc[]
Data
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/data/Thing.adoc[]
Entity
Package: com.typedb.driver.api.concept.instance
Superinterfaces:
-
Concept
-
Instance
Instance of data of an entity type, representing a standalone object that exists in the data model independently. Entity does not have a value. It is usually addressed by its ownership over attribute instances and/or roles played in relation instances.
asAttribute
default Attribute asAttribute()
Casts the concept to Attribute
.
Attribute
concept.asAttribute();
asAttributeType
default AttributeType asAttributeType()
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType();
asEntity
@CheckReturnValue
default Entity asEntity()
Casts the concept to Entity
.
Entity
entity.asEntity();
asEntityType
default EntityType asEntityType()
Casts the concept to EntityType
.
EntityType
concept.asEntityType();
asRelation
default Relation asRelation()
Casts the concept to Relation
.
Relation
concept.asRelation();
asRelationType
default RelationType asRelationType()
Casts the concept to RelationType
.
RelationType
concept.asRelationType();
asRoleType
default RoleType asRoleType()
Casts the concept to RoleType
.
RoleType
concept.asRoleType();
asType
default Type asType()
Casts the concept to Type
.
Type
concept.asType();
asValue
default Value asValue()
Casts the concept to Value
.
Value
concept.asValue();
getIID
@CheckReturnValue
java.lang.String getIID()
Retrieves the unique id of the Entity
.
java.lang.String
entity.getIID();
getLabel
@CheckReturnValue
java.lang.String getLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance ("unknown" if type fetching is disabled). If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.lang.String
concept.getLabel();
getType
@CheckReturnValue
EntityType getType()
Retrieves the type which this Entity
belongs to.
EntityType
entity.getType();
isAttribute
@CheckReturnValue
default boolean isAttribute()
Checks if the concept is an Attribute
.
boolean
concept.isAttribute();
isAttributeType
@CheckReturnValue
default boolean isAttributeType()
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType();
isBoolean
@CheckReturnValue
boolean isBoolean()
Returns true
if the value which this Concept
holds is of type boolean
or if this Concept
is an AttributeType
of type boolean
. Otherwise, returns false
.
boolean
concept.isBoolean()
isDate
@CheckReturnValue
boolean isDate()
Returns true
if the value which this Concept
holds is of type date
or if this Concept
is an AttributeType
of type date
. Otherwise, returns false
.
boolean
concept.isDate();
isDatetime
@CheckReturnValue
boolean isDatetime()
Returns true
if the value which this Concept
holds is of type datetime
or if this Concept
is an AttributeType
of type datetime
. Otherwise, returns false
.
boolean
concept.isDatetime();
isDatetimeTZ
@CheckReturnValue
boolean isDatetimeTZ()
Returns true
if the value which this Concept
holds is of type datetime-tz
or if this Concept
is an AttributeType
of type datetime-tz
. Otherwise, returns false
.
boolean
concept.isDatetimeTZ();
isDecimal
@CheckReturnValue
boolean isDecimal()
Returns true
if the value which this Concept
holds is of type decimal
or if this Concept
is an AttributeType
of type decimal
. Otherwise, returns false
.
boolean
concept.isDecimal();
isDouble
@CheckReturnValue
boolean isDouble()
Returns true
if the value which this Concept
holds is of type double
or if this Concept
is an AttributeType
of type double
. Otherwise, returns false
.
boolean
concept.isDouble();
isDuration
@CheckReturnValue
boolean isDuration()
Returns true
if the value which this Concept
holds is of type duration
or if this Concept
is an AttributeType
of type duration
. Otherwise, returns false
.
boolean
concept.isDuration();
isEntity
@CheckReturnValue
default boolean isEntity()
Checks if the concept is an Entity
.
boolean
entity.isEntity();
isEntityType
@CheckReturnValue
default boolean isEntityType()
Checks if the concept is an EntityType
.
boolean
concept.isEntityType();
isInteger
@CheckReturnValue
boolean isInteger()
Returns true
if the value which this Concept
holds is of type integer
or if this Concept
is an AttributeType
of type integer
. Otherwise, returns false
.
boolean
concept.isInteger();
isRelation
@CheckReturnValue
default boolean isRelation()
Checks if the concept is a Relation
.
boolean
concept.isRelation();
isRelationType
@CheckReturnValue
default boolean isRelationType()
Checks if the concept is a RelationType
.
boolean
concept.isRelationType();
isRoleType
@CheckReturnValue
default boolean isRoleType()
Checks if the concept is a RoleType
.
boolean
concept.isRoleType();
isString
@CheckReturnValue
boolean isString()
Returns true
if the value which this Concept
holds is of type string
or if this Concept
is an AttributeType
of type string
. Otherwise, returns false
.
boolean
concept.isString();
isStruct
@CheckReturnValue
boolean isStruct()
Returns true
if the value which this Concept
holds is of type struct
or if this Concept
is an AttributeType
of type struct
. Otherwise, returns false
.
boolean
concept.isStruct();
isType
@CheckReturnValue
default boolean isType()
Checks if the concept is a Type
.
boolean
concept.isType();
isValue
@CheckReturnValue
default boolean isValue()
Checks if the concept is a Value
.
boolean
concept.isValue();
tryGetBoolean
java.util.Optional<java.lang.Boolean> tryGetBoolean()
Returns a boolean
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Boolean>
concept.tryGetBoolean();
tryGetDate
java.util.Optional<java.time.LocalDate> tryGetDate()
Returns a date
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDate>
concept.tryGetDate();
tryGetDatetime
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
Returns a datetime
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDateTime>
concept.tryGetDatetime();
tryGetDatetimeTZ
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
Returns a datetime-tz
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.ZonedDateTime>
concept.tryGetDatetimeTZ();
tryGetDecimal
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
Returns a decimal
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.math.BigDecimal>
concept.tryGetDecimal();
tryGetDouble
java.util.Optional<java.lang.Double> tryGetDouble()
Returns a double
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Double>
concept.tryGetDouble();
tryGetDuration
java.util.Optional<Duration> tryGetDuration()
Returns a duration
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<Duration>
concept.tryGetDuration();
tryGetIID
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
Retrieves the unique id of the Concept
. Returns null
if absent.
java.util.Optional<java.lang.String>
concept.tryGetIID();
tryGetInteger
java.util.Optional<java.lang.Long> tryGetInteger()
Returns a integer
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Long>
concept.tryGetInteger();
tryGetLabel
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance (null
if type fetching is disabled). Returns null
if type fetching is disabled. If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.util.Optional<java.lang.String>
concept.tryGetLabel();
tryGetString
java.util.Optional<java.lang.String> tryGetString()
Returns a string
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.String>
concept.tryGetString();
tryGetStruct
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>> tryGetStruct()
Returns a struct
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>>
concept.tryGetStruct();
Relation
Package: com.typedb.driver.api.concept.instance
Superinterfaces:
-
Concept
-
Instance
Relation is an instance of a relation type and can be uniquely addressed by a combination of its type, owned attributes and role players.
asAttribute
default Attribute asAttribute()
Casts the concept to Attribute
.
Attribute
concept.asAttribute();
asAttributeType
default AttributeType asAttributeType()
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType();
asEntity
default Entity asEntity()
Casts the concept to Entity
.
Entity
concept.asEntity();
asEntityType
default EntityType asEntityType()
Casts the concept to EntityType
.
EntityType
concept.asEntityType();
asRelation
@CheckReturnValue
default Relation asRelation()
Casts the concept to Relation
.
Relation
relation.asRelation();
asRelationType
default RelationType asRelationType()
Casts the concept to RelationType
.
RelationType
concept.asRelationType();
asRoleType
default RoleType asRoleType()
Casts the concept to RoleType
.
RoleType
concept.asRoleType();
asType
default Type asType()
Casts the concept to Type
.
Type
concept.asType();
asValue
default Value asValue()
Casts the concept to Value
.
Value
concept.asValue();
getIID
@CheckReturnValue
java.lang.String getIID()
Retrieves the unique id of the Relation
.
java.lang.String
relation.getIID();
getLabel
@CheckReturnValue
java.lang.String getLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance ("unknown" if type fetching is disabled). If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.lang.String
concept.getLabel();
getType
@CheckReturnValue
RelationType getType()
Retrieves the type which this Relation
belongs to.
RelationType
relation.getType();
isAttribute
@CheckReturnValue
default boolean isAttribute()
Checks if the concept is an Attribute
.
boolean
concept.isAttribute();
isAttributeType
@CheckReturnValue
default boolean isAttributeType()
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType();
isBoolean
@CheckReturnValue
boolean isBoolean()
Returns true
if the value which this Concept
holds is of type boolean
or if this Concept
is an AttributeType
of type boolean
. Otherwise, returns false
.
boolean
concept.isBoolean()
isDate
@CheckReturnValue
boolean isDate()
Returns true
if the value which this Concept
holds is of type date
or if this Concept
is an AttributeType
of type date
. Otherwise, returns false
.
boolean
concept.isDate();
isDatetime
@CheckReturnValue
boolean isDatetime()
Returns true
if the value which this Concept
holds is of type datetime
or if this Concept
is an AttributeType
of type datetime
. Otherwise, returns false
.
boolean
concept.isDatetime();
isDatetimeTZ
@CheckReturnValue
boolean isDatetimeTZ()
Returns true
if the value which this Concept
holds is of type datetime-tz
or if this Concept
is an AttributeType
of type datetime-tz
. Otherwise, returns false
.
boolean
concept.isDatetimeTZ();
isDecimal
@CheckReturnValue
boolean isDecimal()
Returns true
if the value which this Concept
holds is of type decimal
or if this Concept
is an AttributeType
of type decimal
. Otherwise, returns false
.
boolean
concept.isDecimal();
isDouble
@CheckReturnValue
boolean isDouble()
Returns true
if the value which this Concept
holds is of type double
or if this Concept
is an AttributeType
of type double
. Otherwise, returns false
.
boolean
concept.isDouble();
isDuration
@CheckReturnValue
boolean isDuration()
Returns true
if the value which this Concept
holds is of type duration
or if this Concept
is an AttributeType
of type duration
. Otherwise, returns false
.
boolean
concept.isDuration();
isEntity
@CheckReturnValue
default boolean isEntity()
Checks if the concept is an Entity
.
boolean
concept.isEntity();
isEntityType
@CheckReturnValue
default boolean isEntityType()
Checks if the concept is an EntityType
.
boolean
concept.isEntityType();
isInteger
@CheckReturnValue
boolean isInteger()
Returns true
if the value which this Concept
holds is of type integer
or if this Concept
is an AttributeType
of type integer
. Otherwise, returns false
.
boolean
concept.isInteger();
isRelation
@CheckReturnValue
default boolean isRelation()
Checks if the concept is a Relation
.
boolean
relation.isRelation();
isRelationType
@CheckReturnValue
default boolean isRelationType()
Checks if the concept is a RelationType
.
boolean
concept.isRelationType();
isRoleType
@CheckReturnValue
default boolean isRoleType()
Checks if the concept is a RoleType
.
boolean
concept.isRoleType();
isString
@CheckReturnValue
boolean isString()
Returns true
if the value which this Concept
holds is of type string
or if this Concept
is an AttributeType
of type string
. Otherwise, returns false
.
boolean
concept.isString();
isStruct
@CheckReturnValue
boolean isStruct()
Returns true
if the value which this Concept
holds is of type struct
or if this Concept
is an AttributeType
of type struct
. Otherwise, returns false
.
boolean
concept.isStruct();
isType
@CheckReturnValue
default boolean isType()
Checks if the concept is a Type
.
boolean
concept.isType();
isValue
@CheckReturnValue
default boolean isValue()
Checks if the concept is a Value
.
boolean
concept.isValue();
tryGetBoolean
java.util.Optional<java.lang.Boolean> tryGetBoolean()
Returns a boolean
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Boolean>
concept.tryGetBoolean();
tryGetDate
java.util.Optional<java.time.LocalDate> tryGetDate()
Returns a date
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDate>
concept.tryGetDate();
tryGetDatetime
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
Returns a datetime
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDateTime>
concept.tryGetDatetime();
tryGetDatetimeTZ
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
Returns a datetime-tz
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.ZonedDateTime>
concept.tryGetDatetimeTZ();
tryGetDecimal
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
Returns a decimal
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.math.BigDecimal>
concept.tryGetDecimal();
tryGetDouble
java.util.Optional<java.lang.Double> tryGetDouble()
Returns a double
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Double>
concept.tryGetDouble();
tryGetDuration
java.util.Optional<Duration> tryGetDuration()
Returns a duration
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<Duration>
concept.tryGetDuration();
tryGetIID
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
Retrieves the unique id of the Concept
. Returns null
if absent.
java.util.Optional<java.lang.String>
concept.tryGetIID();
tryGetInteger
java.util.Optional<java.lang.Long> tryGetInteger()
Returns a integer
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Long>
concept.tryGetInteger();
tryGetLabel
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance (null
if type fetching is disabled). Returns null
if type fetching is disabled. If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.util.Optional<java.lang.String>
concept.tryGetLabel();
tryGetString
java.util.Optional<java.lang.String> tryGetString()
Returns a string
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.String>
concept.tryGetString();
tryGetStruct
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>> tryGetStruct()
Returns a struct
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>>
concept.tryGetStruct();
Attribute
Package: com.typedb.driver.api.concept.instance
Superinterfaces:
-
Concept
-
Instance
Attribute is an instance of the attribute type and has a value. This value is fixed and unique for every given instance of the attribute type.
Attributes can be uniquely addressed by their type and value.
asAttribute
@CheckReturnValue
default Attribute asAttribute()
Casts the concept to Attribute
.
Attribute
concept.asAttribute();
asAttributeType
default AttributeType asAttributeType()
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType();
asEntity
default Entity asEntity()
Casts the concept to Entity
.
Entity
concept.asEntity();
asEntityType
default EntityType asEntityType()
Casts the concept to EntityType
.
EntityType
concept.asEntityType();
asRelation
default Relation asRelation()
Casts the concept to Relation
.
Relation
concept.asRelation();
asRelationType
default RelationType asRelationType()
Casts the concept to RelationType
.
RelationType
concept.asRelationType();
asRoleType
default RoleType asRoleType()
Casts the concept to RoleType
.
RoleType
concept.asRoleType();
asType
default Type asType()
Casts the concept to Type
.
Type
concept.asType();
asValue
default Value asValue()
Casts the concept to Value
.
Value
concept.asValue();
getBoolean
boolean getBoolean()
Returns a boolean
value of the value concept that this attribute holds. If the value has another type, raises an exception.
boolean
attribute.getBoolean();
getDate
java.time.LocalDate getDate()
Returns a date
value of the value concept that this attribute holds. If the value has another type, raises an exception.
java.time.LocalDate
attribute.getDate();
getDatetime
java.time.LocalDateTime getDatetime()
Returns a datetime
value of the value concept that this attribute holds. If the value has another type, raises an exception.
java.time.LocalDateTime
attribute.getDatetime();
getDatetimeTZ
java.time.ZonedDateTime getDatetimeTZ()
Returns a datetime-tz
value of the value concept that this attribute holds. If the value has another type, raises an exception.
java.time.ZonedDateTime
attribute.getDatetimeTZ();
getDecimal
java.math.BigDecimal getDecimal()
Returns a decimal
value of the value concept that this attribute holds. If the value has another type, raises an exception.
java.math.BigDecimal
attribute.getDecimal();
getDouble
double getDouble()
Returns a double
value of the value concept that this attribute holds. If the value has another type, raises an exception.
double
attribute.getDouble();
getDuration
Duration getDuration()
Returns a duration
value of the value concept that this attribute holds. If the value has another type, raises an exception.
Duration
attribute.getDuration();
getInteger
long getInteger()
Returns a integer
value of the value concept that this attribute holds. If the value has another type, raises an exception.
long
attribute.getInteger();
getLabel
@CheckReturnValue
java.lang.String getLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance ("unknown" if type fetching is disabled). If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.lang.String
concept.getLabel();
getString
java.lang.String getString()
Returns a string
value of the value concept that this attribute holds. If the value has another type, raises an exception.
java.lang.String
attribute.getString();
getStruct
java.util.Map<java.lang.String,java.util.Optional<Value>> getStruct()
Returns a struct
value of the value concept that this attribute holds represented as a map from field names to values. If the value has another type, raises an exception.
java.util.Map<java.lang.String,java.util.Optional<Value>>
attribute.getStruct();
getType
@CheckReturnValue
AttributeType getType()
Retrieves the type which this Attribute
belongs to.
AttributeType
attribute.getType();
getValue
@CheckReturnValue
Value getValue()
Retrieves the value which the Attribute
instance holds.
Value
attribute.getValue();
getValueType
@CheckReturnValue
java.lang.String getValueType()
Retrieves the description of the value type of the value which the Attribute
instance holds.
java.lang.String
attribute.getValueType();
isAttribute
@CheckReturnValue
default boolean isAttribute()
Checks if the concept is an Attribute
.
boolean
concept.isAttribute();
isAttributeType
@CheckReturnValue
default boolean isAttributeType()
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType();
isBoolean
@CheckReturnValue
boolean isBoolean()
Returns true
if the value which this Concept
holds is of type boolean
or if this Concept
is an AttributeType
of type boolean
. Otherwise, returns false
.
boolean
concept.isBoolean()
isDate
@CheckReturnValue
boolean isDate()
Returns true
if the value which this Concept
holds is of type date
or if this Concept
is an AttributeType
of type date
. Otherwise, returns false
.
boolean
concept.isDate();
isDatetime
@CheckReturnValue
boolean isDatetime()
Returns true
if the value which this Concept
holds is of type datetime
or if this Concept
is an AttributeType
of type datetime
. Otherwise, returns false
.
boolean
concept.isDatetime();
isDatetimeTZ
@CheckReturnValue
boolean isDatetimeTZ()
Returns true
if the value which this Concept
holds is of type datetime-tz
or if this Concept
is an AttributeType
of type datetime-tz
. Otherwise, returns false
.
boolean
concept.isDatetimeTZ();
isDecimal
@CheckReturnValue
boolean isDecimal()
Returns true
if the value which this Concept
holds is of type decimal
or if this Concept
is an AttributeType
of type decimal
. Otherwise, returns false
.
boolean
concept.isDecimal();
isDouble
@CheckReturnValue
boolean isDouble()
Returns true
if the value which this Concept
holds is of type double
or if this Concept
is an AttributeType
of type double
. Otherwise, returns false
.
boolean
concept.isDouble();
isDuration
@CheckReturnValue
boolean isDuration()
Returns true
if the value which this Concept
holds is of type duration
or if this Concept
is an AttributeType
of type duration
. Otherwise, returns false
.
boolean
concept.isDuration();
isEntity
@CheckReturnValue
default boolean isEntity()
Checks if the concept is an Entity
.
boolean
concept.isEntity();
isEntityType
@CheckReturnValue
default boolean isEntityType()
Checks if the concept is an EntityType
.
boolean
concept.isEntityType();
isInteger
@CheckReturnValue
boolean isInteger()
Returns true
if the value which this Concept
holds is of type integer
or if this Concept
is an AttributeType
of type integer
. Otherwise, returns false
.
boolean
concept.isInteger();
isRelation
@CheckReturnValue
default boolean isRelation()
Checks if the concept is a Relation
.
boolean
concept.isRelation();
isRelationType
@CheckReturnValue
default boolean isRelationType()
Checks if the concept is a RelationType
.
boolean
concept.isRelationType();
isRoleType
@CheckReturnValue
default boolean isRoleType()
Checks if the concept is a RoleType
.
boolean
concept.isRoleType();
isString
@CheckReturnValue
boolean isString()
Returns true
if the value which this Concept
holds is of type string
or if this Concept
is an AttributeType
of type string
. Otherwise, returns false
.
boolean
concept.isString();
isStruct
@CheckReturnValue
boolean isStruct()
Returns true
if the value which this Concept
holds is of type struct
or if this Concept
is an AttributeType
of type struct
. Otherwise, returns false
.
boolean
concept.isStruct();
isType
@CheckReturnValue
default boolean isType()
Checks if the concept is a Type
.
boolean
concept.isType();
isValue
@CheckReturnValue
default boolean isValue()
Checks if the concept is a Value
.
boolean
concept.isValue();
tryGetBoolean
java.util.Optional<java.lang.Boolean> tryGetBoolean()
Returns a boolean
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Boolean>
concept.tryGetBoolean();
tryGetDate
java.util.Optional<java.time.LocalDate> tryGetDate()
Returns a date
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDate>
concept.tryGetDate();
tryGetDatetime
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
Returns a datetime
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDateTime>
concept.tryGetDatetime();
tryGetDatetimeTZ
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
Returns a datetime-tz
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.ZonedDateTime>
concept.tryGetDatetimeTZ();
tryGetDecimal
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
Returns a decimal
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.math.BigDecimal>
concept.tryGetDecimal();
tryGetDouble
java.util.Optional<java.lang.Double> tryGetDouble()
Returns a double
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Double>
concept.tryGetDouble();
tryGetDuration
java.util.Optional<Duration> tryGetDuration()
Returns a duration
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<Duration>
concept.tryGetDuration();
tryGetIID
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
Retrieves the unique id of the Concept
. Returns null
if absent.
java.util.Optional<java.lang.String>
concept.tryGetIID();
tryGetInteger
java.util.Optional<java.lang.Long> tryGetInteger()
Returns a integer
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Long>
concept.tryGetInteger();
tryGetLabel
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance (null
if type fetching is disabled). Returns null
if type fetching is disabled. If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.util.Optional<java.lang.String>
concept.tryGetLabel();
tryGetString
java.util.Optional<java.lang.String> tryGetString()
Returns a string
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.String>
concept.tryGetString();
tryGetStruct
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>> tryGetStruct()
Returns a struct
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>>
concept.tryGetStruct();
Value
Package: com.typedb.driver.api.concept.value
Superinterfaces:
-
Concept
asAttribute
default Attribute asAttribute()
Casts the concept to Attribute
.
Attribute
concept.asAttribute();
asAttributeType
default AttributeType asAttributeType()
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType();
asEntity
default Entity asEntity()
Casts the concept to Entity
.
Entity
concept.asEntity();
asEntityType
default EntityType asEntityType()
Casts the concept to EntityType
.
EntityType
concept.asEntityType();
asInstance
default Instance asInstance()
Casts the concept to Instance
.
Instance
concept.asInstance();
asRelation
default Relation asRelation()
Casts the concept to Relation
.
Relation
concept.asRelation();
asRelationType
default RelationType asRelationType()
Casts the concept to RelationType
.
RelationType
concept.asRelationType();
asRoleType
default RoleType asRoleType()
Casts the concept to RoleType
.
RoleType
concept.asRoleType();
asType
default Type asType()
Casts the concept to Type
.
Type
concept.asType();
asValue
default Value asValue()
Casts the concept to Value
.
Value
concept.asValue();
get
java.lang.Object get()
Returns an untyped Object
value of this value concept. This is useful for value equality or printing without having to switch on the actual contained value.
java.lang.Object
value.get();
getBoolean
boolean getBoolean()
Returns a boolean
value of this value concept. If the value has another type, raises an exception.
boolean
value.getBoolean();
getDate
java.time.LocalDate getDate()
Returns a date
value of this value concept. If the value has another type, raises an exception.
java.time.LocalDate
value.getDate();
getDatetime
java.time.LocalDateTime getDatetime()
Returns a datetime
value of this value concept. If the value has another type, raises an exception.
java.time.LocalDateTime
value.getDatetime();
getDatetimeTZ
java.time.ZonedDateTime getDatetimeTZ()
Returns a datetime-tz
value of this value concept. If the value has another type, raises an exception.
java.time.ZonedDateTime
value.getDatetimeTZ();
getDecimal
java.math.BigDecimal getDecimal()
Returns a decimal
value of this value concept. If the value has another type, raises an exception.
java.math.BigDecimal
value.getDecimal();
getDouble
double getDouble()
Returns a double
value of this value concept. If the value has another type, raises an exception.
double
value.getDouble();
getDuration
Duration getDuration()
Returns a duration
value of this value concept. If the value has another type, raises an exception.
Duration
value.getDuration();
getInteger
long getInteger()
Returns a integer
value of this value concept. If the value has another type, raises an exception.
long
value.getInteger();
getLabel
@CheckReturnValue
java.lang.String getLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance ("unknown" if type fetching is disabled). If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.lang.String
concept.getLabel();
getString
java.lang.String getString()
Returns a string
value of this value concept. If the value has another type, raises an exception.
java.lang.String
value.getString();
getStruct
java.util.Map<java.lang.String,java.util.Optional<Value>> getStruct()
Returns a struct
value of this value concept represented as a map from field names to values. If the value has another type, raises an exception.
java.util.Map<java.lang.String,java.util.Optional<Value>>
value.getStruct();
getType
java.lang.String getType()
Retrieves the String
describing the value type of this Value
concept.
java.lang.String
value.getType()
isAttribute
@CheckReturnValue
default boolean isAttribute()
Checks if the concept is an Attribute
.
boolean
concept.isAttribute();
isAttributeType
@CheckReturnValue
default boolean isAttributeType()
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType();
isBoolean
@CheckReturnValue
boolean isBoolean()
Returns true
if the value which this Concept
holds is of type boolean
or if this Concept
is an AttributeType
of type boolean
. Otherwise, returns false
.
boolean
concept.isBoolean()
isDate
@CheckReturnValue
boolean isDate()
Returns true
if the value which this Concept
holds is of type date
or if this Concept
is an AttributeType
of type date
. Otherwise, returns false
.
boolean
concept.isDate();
isDatetime
@CheckReturnValue
boolean isDatetime()
Returns true
if the value which this Concept
holds is of type datetime
or if this Concept
is an AttributeType
of type datetime
. Otherwise, returns false
.
boolean
concept.isDatetime();
isDatetimeTZ
@CheckReturnValue
boolean isDatetimeTZ()
Returns true
if the value which this Concept
holds is of type datetime-tz
or if this Concept
is an AttributeType
of type datetime-tz
. Otherwise, returns false
.
boolean
concept.isDatetimeTZ();
isDecimal
@CheckReturnValue
boolean isDecimal()
Returns true
if the value which this Concept
holds is of type decimal
or if this Concept
is an AttributeType
of type decimal
. Otherwise, returns false
.
boolean
concept.isDecimal();
isDouble
@CheckReturnValue
boolean isDouble()
Returns true
if the value which this Concept
holds is of type double
or if this Concept
is an AttributeType
of type double
. Otherwise, returns false
.
boolean
concept.isDouble();
isDuration
@CheckReturnValue
boolean isDuration()
Returns true
if the value which this Concept
holds is of type duration
or if this Concept
is an AttributeType
of type duration
. Otherwise, returns false
.
boolean
concept.isDuration();
isEntity
@CheckReturnValue
default boolean isEntity()
Checks if the concept is an Entity
.
boolean
concept.isEntity();
isEntityType
@CheckReturnValue
default boolean isEntityType()
Checks if the concept is an EntityType
.
boolean
concept.isEntityType();
isInstance
@CheckReturnValue
default boolean isInstance()
Checks if the concept is an Instance
.
boolean
concept.isInstance();
isInteger
@CheckReturnValue
boolean isInteger()
Returns true
if the value which this Concept
holds is of type integer
or if this Concept
is an AttributeType
of type integer
. Otherwise, returns false
.
boolean
concept.isInteger();
isRelation
@CheckReturnValue
default boolean isRelation()
Checks if the concept is a Relation
.
boolean
concept.isRelation();
isRelationType
@CheckReturnValue
default boolean isRelationType()
Checks if the concept is a RelationType
.
boolean
concept.isRelationType();
isRoleType
@CheckReturnValue
default boolean isRoleType()
Checks if the concept is a RoleType
.
boolean
concept.isRoleType();
isString
@CheckReturnValue
boolean isString()
Returns true
if the value which this Concept
holds is of type string
or if this Concept
is an AttributeType
of type string
. Otherwise, returns false
.
boolean
concept.isString();
isStruct
@CheckReturnValue
boolean isStruct()
Returns true
if the value which this Concept
holds is of type struct
or if this Concept
is an AttributeType
of type struct
. Otherwise, returns false
.
boolean
concept.isStruct();
isType
@CheckReturnValue
default boolean isType()
Checks if the concept is a Type
.
boolean
concept.isType();
isValue
default boolean isValue()
Checks if the concept is a Value
.
boolean
concept.isValue();
tryGetBoolean
java.util.Optional<java.lang.Boolean> tryGetBoolean()
Returns a boolean
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Boolean>
concept.tryGetBoolean();
tryGetDate
java.util.Optional<java.time.LocalDate> tryGetDate()
Returns a date
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDate>
concept.tryGetDate();
tryGetDatetime
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
Returns a datetime
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.LocalDateTime>
concept.tryGetDatetime();
tryGetDatetimeTZ
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
Returns a datetime-tz
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.time.ZonedDateTime>
concept.tryGetDatetimeTZ();
tryGetDecimal
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
Returns a decimal
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.math.BigDecimal>
concept.tryGetDecimal();
tryGetDouble
java.util.Optional<java.lang.Double> tryGetDouble()
Returns a double
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Double>
concept.tryGetDouble();
tryGetDuration
java.util.Optional<Duration> tryGetDuration()
Returns a duration
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<Duration>
concept.tryGetDuration();
tryGetIID
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
Retrieves the unique id of the Concept
. Returns null
if absent.
java.util.Optional<java.lang.String>
concept.tryGetIID();
tryGetInteger
java.util.Optional<java.lang.Long> tryGetInteger()
Returns a integer
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.Long>
concept.tryGetInteger();
tryGetLabel
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
Retrieves the unique label of the concept. If this is an Instance
, return the label of the type of this instance (null
if type fetching is disabled). Returns null
if type fetching is disabled. If this is a Value
, return the label of the value type of the value. If this is a Type
, return the label of the type.
java.util.Optional<java.lang.String>
concept.tryGetLabel();
tryGetString
java.util.Optional<java.lang.String> tryGetString()
Returns a string
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.lang.String>
concept.tryGetString();
tryGetStruct
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>> tryGetStruct()
Returns a struct
value of this Concept
. If it’s not a Value
or it has another type, returns null
.
java.util.Optional<java.util.Map<java.lang.String,java.util.Optional<Value>>>
concept.tryGetStruct();
Logic
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/logic/LogicManager.adoc[]
Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/logic/Rule.adoc[]