Java driver API reference
Connection
TypeDB
Package: com.typedb.driver
Name | Type | Description |
---|---|---|
|
|
cloudDriver
public static Driver cloudDriver(java.lang.String address,
Credentials credentials,
DriverOptions driverOptions)
throws TypeDBDriverException
Open a TypeDB Driver to a TypeDB Cloud server available at the provided address, using the provided credential.
Name | Description | Type |
---|---|---|
|
The address of the TypeDB server |
|
|
The credential to connect with |
|
|
The connection settings to connect with |
|
public static Driver
TypeDB.cloudDriver(address, credential);
cloudDriver
public static Driver cloudDriver(java.util.Set<java.lang.String> addresses,
Credentials credentials,
DriverOptions driverOptions)
throws TypeDBDriverException
Open a TypeDB Driver to TypeDB Cloud server(s) available at the provided addresses, using the provided credential.
Name | Description | Type |
---|---|---|
|
The address(es) of the TypeDB server(s) |
|
|
The credential to connect with |
|
|
The connection settings to connect with |
|
public static Driver
TypeDB.cloudDriver(addresses, credential);
cloudDriver
public static Driver cloudDriver(java.util.Map<java.lang.String,java.lang.String> addressTranslation,
Credentials credentials,
DriverOptions driverOptions)
throws TypeDBDriverException
Open a TypeDB Driver to TypeDB Cloud server(s), using provided address translation, with the provided credential.
Name | Description | Type |
---|---|---|
|
Translation map from addresses to be used by the driver for connection to addresses received from the TypeDB server(s) |
|
|
The credential to connect with |
|
|
The connection settings to connect with |
|
public static Driver
TypeDB.cloudDriver(addressTranslation, credential);
coreDriver
public static Driver coreDriver(java.lang.String address,
Credentials credentials,
DriverOptions driverOptions)
throws TypeDBDriverException
Open a TypeDB Driver to a TypeDB Core 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.coreDriver(address);
Driver
Package: com.typedb.driver.api
Superinterfaces:
-
java.lang.AutoCloseable
Name | Type | Description |
---|---|---|
|
|
close
void close()
Closes the driver. Before instantiating a new driver, the driver that’s currently open should first be closed.
void
driver.close()
databases
@CheckReturnValue
DatabaseManager databases()
The DatabaseManager
for this connection, providing access to database management methods.
DatabaseManager
isOpen
@CheckReturnValue
boolean isOpen()
Checks whether this connection is presently open.
boolean
driver.isOpen();
transaction
@CheckReturnValue
Transaction transaction(java.lang.String database,
Transaction.Type type)
throws TypeDBDriverException
Opens a communication tunnel (transaction) to the given database on the running TypeDB server.
Name | Description | Type |
---|---|---|
|
The name of the database with which the transaction connects |
|
|
The type of transaction to be created (READ, WRITE, or SCHEMA) |
|
Transaction
driver.transaction(database, sessionType);
Credentials
Package: com.typedb.driver.api
User credentials for connecting to TypeDB Server.
Credential credentials = new Credential(username, password);
DriverOptions
Package: com.typedb.driver.api
User connection settings (TLS encryption, etc.) for connecting to TypeDB Server.
DriverOptions driverOptions = new DriverOptions(true, Path.of("path/to/ca-certificate.pem"));
DriverOptions
public DriverOptions(boolean isTlsEnabled,
java.lang.String tlsRootCAPath)
Name | Description | Type |
---|---|---|
|
Specify whether the connection to TypeDB Server must be done over TLS. |
|
|
Path to the CA certificate to use for authenticating server certificates. |
|
public
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
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);
Transaction
Transaction
Package: com.typedb.driver.api
Superinterfaces:
-
java.lang.AutoCloseable
close
void close()
throws TypeDBDriverException
Closes the transaction.
void
transaction.close()
commit
void commit()
throws TypeDBDriverException
Commits the changes made via this transaction to the TypeDB database. Whether or not the transaction is commited successfully, it gets closed after the commit call.
void
transaction.commit()
getType
@CheckReturnValue
Transaction.Type getType()
The transaction’s type (READ, WRITE, or SCHEMA)
Transaction.Type
transaction.getType();
isOpen
@CheckReturnValue
boolean isOpen()
Checks whether this transaction is open.
boolean
transaction.isOpen();
onClose
void onClose(java.util.function.Consumer<java.lang.Throwable> function)
Registers a callback function which will be executed when this transaction is closed.
Name | Description | Type |
---|---|---|
|
The callback function. |
|
void
transaction.onClose(function);
query
@CheckReturnValue
Promise<? extends QueryAnswer> query(java.lang.String query)
throws TypeDBDriverException
Execute a TypeQL query in this transaction.
Name | Description | Type |
---|---|---|
|
The query to execute. |
|
Promise<? extends QueryAnswer>
// TODO: Add more usage examples, how to unpack answers!
transaction.query("define entity person;");
Transaction.Type
Package: com.typedb.driver.api
Used to specify the type of transaction.
driver.transaction(dbName, TransactionType.READ);
Name |
---|
|
|
|
valueOf
public static Transaction.Type valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Name | Description | Type |
---|---|---|
|
the name of the enum constant to be returned. |
|
public static Transaction.Type
values
public static Transaction.Type[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Transaction.Type c : Transaction.Type.values())
System.out.println(c);
public static Transaction.Type[]
for (Transaction.Type c : Transaction.Type.values())
System.out.println(c);
Answer
QueryAnswer
Package: com.typedb.driver.api.answer
General answer on a query returned by a server. Can be a simple Ok response or a collection of concepts.
asConceptDocuments
default ConceptDocumentIterator asConceptDocuments()
Casts the query answer to ConceptDocumentIterator
.
ConceptDocumentIterator
concept.asConceptDocuments();
asConceptRows
default ConceptRowIterator asConceptRows()
Casts the query answer to ConceptRowIterator
.
ConceptRowIterator
concept.asConceptRows();
asOk
default OkQueryAnswer asOk()
Casts the query answer to OkQueryAnswer
.
OkQueryAnswer
concept.asOk();
getQueryType
@CheckReturnValue
QueryType getQueryType()
Retrieves the executed query’s type of this QueryAnswer
.
QueryType
queryAnswer.getQueryType();
isConceptDocuments
@CheckReturnValue
default boolean isConceptDocuments()
Checks if the query answer is a ConceptDocumentIterator
.
boolean
concept.isConceptDocuments();
OkQueryAnswer
Package: com.typedb.driver.api.answer
Superinterfaces:
-
QueryAnswer
Represents a simple Ok message as a server answer. Doesn’t contain concepts.
asConceptDocuments
default ConceptDocumentIterator asConceptDocuments()
Casts the query answer to ConceptDocumentIterator
.
ConceptDocumentIterator
concept.asConceptDocuments();
asConceptRows
default ConceptRowIterator asConceptRows()
Casts the query answer to ConceptRowIterator
.
ConceptRowIterator
concept.asConceptRows();
asOk
@CheckReturnValue
default OkQueryAnswer asOk()
Casts the query answer to OkQueryAnswer
.
OkQueryAnswer
concept.asOk();
getQueryType
@CheckReturnValue
QueryType getQueryType()
Retrieves the executed query’s type of this QueryAnswer
.
QueryType
queryAnswer.getQueryType();
isConceptDocuments
@CheckReturnValue
default boolean isConceptDocuments()
Checks if the query answer is a ConceptDocumentIterator
.
boolean
concept.isConceptDocuments();
ConceptRowIterator
Package: com.typedb.driver.api.answer
Superinterfaces:
-
java.util.Iterator<ConceptRow>
-
QueryAnswer
Represents an iterator over ConceptRow
s returned as a server answer.
asConceptRows
@CheckReturnValue
default ConceptRowIterator asConceptRows()
Casts the query answer to ConceptRowIterator
.
ConceptRowIterator
concept.asConceptRows();
ConceptRow
Package: com.typedb.driver.api.answer
Contains a row of concepts with a header.
columnNames
@CheckReturnValue
java.util.stream.Stream<java.lang.String> columnNames()
Produces a stream over all column names (variables) in the header of this ConceptRow
. Shared between all the rows in a QueryAnswer.
java.util.stream.Stream<java.lang.String>
conceptRow.columnNames();
concepts
@CheckReturnValue
java.util.stream.Stream<? extends Concept> concepts()
Produces a stream over all concepts in this ConceptRow
, skipping empty results.
java.util.stream.Stream<? extends Concept>
conceptRow.concepts();
get
@CheckReturnValue
java.util.Optional<Concept> get(java.lang.String columnName)
throws TypeDBDriverException
Retrieves a concept for a given column name (variable). Returns an empty Optional
if the variable has an empty answer. Throws an exception if the variable is not present.
Name | Description | Type |
---|---|---|
|
the variable (column name from |
|
java.util.Optional<Concept>
conceptRow.get(columnName);
getIndex
@CheckReturnValue
java.util.Optional<Concept> getIndex(long columnIndex)
throws TypeDBDriverException
Retrieves a concept for a given index of the header (columnNames
). Returns an empty Optional
if the index points to an empty answer. Throws an exception if the index is not in the row’s range.
Name | Description | Type |
---|---|---|
|
the column index |
|
java.util.Optional<Concept>
conceptRow.getIndex(columnIndex);
ConceptDocumentIterator
Package: com.typedb.driver.api.answer
Superinterfaces:
-
java.util.Iterator<JSON>
-
QueryAnswer
Represents an iterator over concept documents (represented as JSON
s) returned as a server answer.
asConceptDocuments
@CheckReturnValue
default ConceptDocumentIterator asConceptDocuments()
Casts the query answer to ConceptDocumentIterator
.
ConceptDocumentIterator
concept.asConceptDocuments();
JSON
Package: com.typedb.driver.api.answer
QueryType
Package: com.typedb.driver.api
Used to specify the type of the executed query.
conceptRow.queryType();
Name |
---|
|
|
|
of
public static QueryType of(com.typedb.driver.jni.QueryType nativeType)
public static QueryType
valueOf
public static QueryType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Name | Description | Type |
---|---|---|
|
the name of the enum constant to be returned. |
|
public static QueryType
values
public static QueryType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (QueryType c : QueryType.values())
System.out.println(c);
public static QueryType[]
for (QueryType c : QueryType.values())
System.out.println(c);
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);
Concept
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();
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();
Data
Instance
Package: com.typedb.driver.api.concept.instance
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
@CheckReturnValue
default Instance asInstance()
Casts the concept to Instance
.
Instance
instance.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();
getType
@CheckReturnValue
Type getType()
Retrieves the type which this Instance
belongs to.
Type
instance.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 a Instance
.
boolean
instance.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();
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();
Value
Duration
Package: com.typedb.driver.common
equals
public boolean equals(java.lang.Object obj)
Checks if this Duration is equal to another object.
Name | Description | Type |
---|---|---|
|
Object to compare with |
|
public boolean
label.equals(obj);
getDatePart
public java.time.Period getDatePart()
Returns the date part of this duration.
public java.time.Period
duration.getDatePart();
getDays
public int getDays()
Returns the amount of days of this Duration
from the date part.
public int
duration.getMonths();
getMonths
public int getMonths()
Returns the amount of months of this Duration
from the date part.
public int
duration.getMonths();
getNano
public long getNano()
Returns the number of nanoseconds within the second in this Duration
from the time part.
public long
duration.getNano();
getSeconds
public long getSeconds()
Returns the amount of seconds of this Duration
from the time part.
public long
duration.getSeconds();
getTimePart
public java.time.Duration getTimePart()
Returns the time part of this duration.
public java.time.Duration
duration.getTimePart();
parse
public static Duration parse(java.lang.String durationString)
Parses a Duration
object from a string in ISO 8601 format. Throws java.time exceptions
Name | Description | Type |
---|---|---|
|
A string representation of the duration. Expected format: PnYnMnDTnHnMnS or PnW. |
|
public static Duration
Duration.parse("P1Y10M7DT15H44M5.00394892S");
Duration.parse("P55W");