TypeDB 3.0 is live! Get started for free.

Java driver API reference

Connection

TypeDB

Package: com.typedb.driver

Fields
Name Type Description

DEFAULT_ADDRESS

static java.lang.String

TypeDB

public TypeDB()
Returns

public

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.

Input parameters
Name Description Type

address

The address of the TypeDB server

java.lang.String

credentials

The credential to connect with

Credentials

driverOptions

The connection settings to connect with

DriverOptions

Returns

public static Driver

Code examples
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.

Input parameters
Name Description Type

addresses

The address(es) of the TypeDB server(s)

java.util.Set<java.lang.String>

credentials

The credential to connect with

Credentials

driverOptions

The connection settings to connect with

DriverOptions

Returns

public static Driver

Code examples
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.

Input parameters
Name Description Type

addressTranslation

Translation map from addresses to be used by the driver for connection to addresses received from the TypeDB server(s)

java.util.Map<java.lang.String,​java.lang.String>

credentials

The credential to connect with

Credentials

driverOptions

The connection settings to connect with

DriverOptions

Returns

public static Driver

Code examples
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.

Input parameters
Name Description Type

address

The address of the TypeDB server

java.lang.String

credentials

The credentials to connect with

Credentials

driverOptions

The connection settings to connect with

DriverOptions

Returns

public static Driver

Code examples
TypeDB.coreDriver(address);

Driver

Package: com.typedb.driver.api

Superinterfaces:

  • java.lang.AutoCloseable

Fields
Name Type Description

LANGUAGE

static java.lang.String

close

void close()

Closes the driver. Before instantiating a new driver, the driver that’s currently open should first be closed.

Returns

void

Code examples
driver.close()

databases

@CheckReturnValue
DatabaseManager databases()

The DatabaseManager for this connection, providing access to database management methods.

Returns

DatabaseManager

isOpen

@CheckReturnValue
boolean isOpen()

Checks whether this connection is presently open.

Returns

boolean

Code examples
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.

Input parameters
Name Description Type

database

The name of the database with which the transaction connects

java.lang.String

type

The type of transaction to be created (READ, WRITE, or SCHEMA)

Transaction.Type

Returns

Transaction

Code examples
driver.transaction(database, sessionType);

users

@CheckReturnValue
UserManager users()

The UserManager instance for this connection, providing access to user management methods.

Returns

UserManager

Code examples
driver.users();

Credentials

Package: com.typedb.driver.api

User credentials for connecting to TypeDB Server.

Examples
Credential credentials = new Credential(username, password);

Credentials

public Credentials​(java.lang.String username,
                   java.lang.String password)
Input parameters
Name Description Type

username

The name of the user to connect as

java.lang.String

password

The password for the user

java.lang.String

Returns

public

DriverOptions

Package: com.typedb.driver.api

User connection settings (TLS encryption, etc.) for connecting to TypeDB Server.

Examples
DriverOptions driverOptions = new DriverOptions(true, Path.of("path/to/ca-certificate.pem"));

DriverOptions

public DriverOptions​(boolean isTlsEnabled,
                     java.lang.String tlsRootCAPath)
Input parameters
Name Description Type

isTlsEnabled

Specify whether the connection to TypeDB Server must be done over TLS.

boolean

tlsRootCAPath

Path to the CA certificate to use for authenticating server certificates.

java.lang.String

Returns

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

Returns

java.util.List<Database>

Code examples
driver.databases().all()

contains

@CheckReturnValue
boolean contains​(java.lang.String name)
          throws TypeDBDriverException

Checks if a database with the given name exists

Input parameters
Name Description Type

name

The database name to be checked

java.lang.String

Returns

boolean

Code examples
driver.databases().contains(name)

create

void create​(java.lang.String name)
     throws TypeDBDriverException

Create a database with the given name

Input parameters
Name Description Type

name

The name of the database to be created

java.lang.String

Returns

void

Code examples
driver.databases().create(name)

get

@CheckReturnValue
Database get​(java.lang.String name)
      throws TypeDBDriverException

Retrieve the database with the given name.

Input parameters
Name Description Type

name

The name of the database to retrieve

java.lang.String

Returns

Database

Code examples
driver.databases().get(name)

Database

Package: com.typedb.driver.api.database

delete

void delete()
     throws TypeDBDriverException

Deletes this database.

Returns

void

Code examples
database.delete()

name

@CheckReturnValue
java.lang.String name()

The database name as a string.

Returns

java.lang.String

schema

@CheckReturnValue
java.lang.String schema()
                 throws TypeDBDriverException

A full schema text as a valid TypeQL define query string.

Returns

java.lang.String

Code examples
database.schema()

typeSchema

@CheckReturnValue
java.lang.String typeSchema()
                     throws TypeDBDriverException

The types in the schema as a valid TypeQL define query string.

Returns

java.lang.String

Code examples
database.typeSchema()

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.

Returns

java.util.Set<User>

Code examples
driver.users().all();

contains

@CheckReturnValue
boolean contains​(java.lang.String username)
          throws TypeDBDriverException

Checks if a user with the given name exists.

Input parameters
Name Description Type

username

The user name to be checked

java.lang.String

Returns

boolean

Code examples
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.

Input parameters
Name Description Type

username

The name of the user to be created

java.lang.String

password

The password of the user to be created

java.lang.String

Returns

void

Code examples
driver.users().create(username, password);

get

@CheckReturnValue
User get​(java.lang.String username)
  throws TypeDBDriverException

Retrieves a user with the given name.

Input parameters
Name Description Type

username

The name of the user to retrieve

java.lang.String

Returns

User

Code examples
driver.users().get(username);

getCurrentUser

@CheckReturnValue
User getCurrentUser()
             throws TypeDBDriverException

Retrieves the name of the user who opened the current connection.

Returns

User

Code examples
driver.users().getCurrentUsername();

User

Package: com.typedb.driver.api.user

TypeDB user information

delete

void delete()

Deletes a user with the given name.

Returns

void

Code examples
driver.users().delete(username);

name

@CheckReturnValue
java.lang.String name()

Returns the name of this user.

Returns

java.lang.String

updatePassword

void updatePassword​(java.lang.String password)

Updates the password for this user.

Input parameters
Name Description Type

passwordOld

The current password of this user

passwordNew

The new password

Returns

void

Transaction

Transaction

Package: com.typedb.driver.api

Superinterfaces:

  • java.lang.AutoCloseable

close

void close()
    throws TypeDBDriverException

Closes the transaction.

Returns

void

Code examples
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.

Returns

void

Code examples
transaction.commit()

getType

@CheckReturnValue
Transaction.Type getType()

The transaction’s type (READ, WRITE, or SCHEMA)

Returns

Transaction.Type

Code examples
transaction.getType();

isOpen

@CheckReturnValue
boolean isOpen()

Checks whether this transaction is open.

Returns

boolean

Code examples
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.

Input parameters
Name Description Type

function

The callback function.

java.util.function.Consumer<java.lang.Throwable>

Returns

void

Code examples
transaction.onClose(function);

query

@CheckReturnValue
Promise<? extends QueryAnswer> query​(java.lang.String query)
                              throws TypeDBDriverException

Execute a TypeQL query in this transaction.

Input parameters
Name Description Type

query

The query to execute.

java.lang.String

Returns

Promise<? extends QueryAnswer>

Code examples
// TODO: Add more usage examples, how to unpack answers!
 transaction.query("define entity person;");

rollback

void rollback()
       throws TypeDBDriverException

Rolls back the uncommitted changes made via this transaction.

Returns

void

Code examples
transaction.rollback()

Transaction.Type

Package: com.typedb.driver.api

Used to specify the type of transaction.

Examples
driver.transaction(dbName, TransactionType.READ);
Enum constants
Name

READ

SCHEMA

WRITE

id

public int id()
Returns

public int

isRead

public boolean isRead()
Returns

public boolean

isSchema

public boolean isSchema()
Returns

public boolean

isWrite

public boolean isWrite()
Returns

public boolean

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.)

Input parameters
Name Description Type

name

the name of the enum constant to be returned.

java.lang.String

Returns

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);
Returns

public static Transaction.Type[]

Code examples
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.

Returns

ConceptDocumentIterator

Code examples
concept.asConceptDocuments();

asConceptRows

default ConceptRowIterator asConceptRows()

Casts the query answer to ConceptRowIterator.

Returns

ConceptRowIterator

Code examples
concept.asConceptRows();

asOk

default OkQueryAnswer asOk()

Casts the query answer to OkQueryAnswer.

Returns

OkQueryAnswer

Code examples
concept.asOk();

getQueryType

@CheckReturnValue
QueryType getQueryType()

Retrieves the executed query’s type of this QueryAnswer.

Returns

QueryType

Code examples
queryAnswer.getQueryType();

isConceptDocuments

@CheckReturnValue
default boolean isConceptDocuments()

Checks if the query answer is a ConceptDocumentIterator.

Returns

boolean

Code examples
concept.isConceptDocuments();

isConceptRows

@CheckReturnValue
default boolean isConceptRows()

Checks if the query answer is a ConceptRowIterator.

Returns

boolean

Code examples
concept.isConceptRows();

isOk

@CheckReturnValue
default boolean isOk()

Checks if the query answer is an Ok.

Returns

boolean

Code examples
concept.isOk();

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.

Returns

ConceptDocumentIterator

Code examples
concept.asConceptDocuments();

asConceptRows

default ConceptRowIterator asConceptRows()

Casts the query answer to ConceptRowIterator.

Returns

ConceptRowIterator

Code examples
concept.asConceptRows();

asOk

@CheckReturnValue
default OkQueryAnswer asOk()

Casts the query answer to OkQueryAnswer.

Returns

OkQueryAnswer

Code examples
concept.asOk();

getQueryType

@CheckReturnValue
QueryType getQueryType()

Retrieves the executed query’s type of this QueryAnswer.

Returns

QueryType

Code examples
queryAnswer.getQueryType();

isConceptDocuments

@CheckReturnValue
default boolean isConceptDocuments()

Checks if the query answer is a ConceptDocumentIterator.

Returns

boolean

Code examples
concept.isConceptDocuments();

isConceptRows

@CheckReturnValue
default boolean isConceptRows()

Checks if the query answer is a ConceptRowIterator.

Returns

boolean

Code examples
concept.isConceptRows();

isOk

default boolean isOk()

Checks if the query answer is an Ok.

Returns

boolean

Code examples
concept.isOk();

ConceptRowIterator

Package: com.typedb.driver.api.answer

Superinterfaces:

  • java.util.Iterator<ConceptRow>

  • QueryAnswer

Represents an iterator over ConceptRows returned as a server answer.

asConceptRows

@CheckReturnValue
default ConceptRowIterator asConceptRows()

Casts the query answer to ConceptRowIterator.

Returns

ConceptRowIterator

Code examples
concept.asConceptRows();

isConceptRows

default boolean isConceptRows()

Checks if the query answer is a ConceptRowIterator.

Returns

boolean

Code examples
concept.isConceptRows();

stream

@CheckReturnValue
java.util.stream.Stream<ConceptRow> stream()

Creates a stream over ConceptRows based on this iterator.

Returns

java.util.stream.Stream<ConceptRow>

Code examples
answer.asConceptRows().stream();

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.

Returns

java.util.stream.Stream<java.lang.String>

Code examples
conceptRow.columnNames();

concepts

@CheckReturnValue
java.util.stream.Stream<? extends Concept> concepts()

Produces a stream over all concepts in this ConceptRow, skipping empty results.

Returns

java.util.stream.Stream<? extends Concept>

Code examples
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.

Input parameters
Name Description Type

columnName

the variable (column name from column_names)

java.lang.String

Returns

java.util.Optional<Concept>

Code examples
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.

Input parameters
Name Description Type

columnIndex

the column index

long

Returns

java.util.Optional<Concept>

Code examples
conceptRow.getIndex(columnIndex);

getQueryType

@CheckReturnValue
QueryType getQueryType()

Retrieves the executed query’s type of this ConceptRow. Shared between all the rows in a QueryAnswer.

Returns

QueryType

Code examples
conceptRow.getQueryType();

ConceptDocumentIterator

Package: com.typedb.driver.api.answer

Superinterfaces:

  • java.util.Iterator<JSON>

  • QueryAnswer

Represents an iterator over concept documents (represented as JSONs) returned as a server answer.

asConceptDocuments

@CheckReturnValue
default ConceptDocumentIterator asConceptDocuments()

Casts the query answer to ConceptDocumentIterator.

Returns

ConceptDocumentIterator

Code examples
concept.asConceptDocuments();

isConceptDocuments

default boolean isConceptDocuments()

Checks if the query answer is a ConceptDocumentIterator.

Returns

boolean

Code examples
concept.isConceptDocuments();

stream

@CheckReturnValue
java.util.stream.Stream<JSON> stream()
Returns

java.util.stream.Stream<JSON>

JSON

Package: com.typedb.driver.api.answer

JSON

public JSON()
Returns

public

asArray

public java.util.List<JSON> asArray()
Returns

public java.util.List<JSON>

asBoolean

public boolean asBoolean()
Returns

public boolean

asNumber

public double asNumber()
Returns

public double

asObject

public java.util.Map<java.lang.String,​JSON> asObject()
Returns

public java.util.Map<java.lang.String,​JSON>

asString

public java.lang.String asString()
Returns

public java.lang.String

isArray

public boolean isArray()
Returns

public boolean

isBoolean

public boolean isBoolean()
Returns

public boolean

isNumber

public boolean isNumber()
Returns

public boolean

isObject

public boolean isObject()
Returns

public boolean

isString

public boolean isString()
Returns

public boolean

parse

public static JSON parse​(java.lang.String string)
Returns

public static JSON

QueryType

Package: com.typedb.driver.api

Used to specify the type of the executed query.

Examples
conceptRow.queryType();
Enum constants
Name

READ

SCHEMA

WRITE

id

public int id()
Returns

public int

isRead

public boolean isRead()
Returns

public boolean

isSchema

public boolean isSchema()
Returns

public boolean

isWrite

public boolean isWrite()
Returns

public boolean

of

public static QueryType of​(com.typedb.driver.jni.QueryType nativeType)
Returns

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.)

Input parameters
Name Description Type

name

the name of the enum constant to be returned.

java.lang.String

Returns

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);
Returns

public static QueryType[]

Code examples
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 resolved.

Promise

public Promise​(java.util.function.Supplier<T> inner)

Promise constructor

Input parameters
Name Description Type

inner

The supplier to function to wrap into the promise

java.util.function.Supplier<T>

Returns

public

Code examples
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.

Input parameters
Name Description Type

promise

The supplier function to wrap into the promise

java.util.function.Supplier<T>

fn

The mapping function

java.util.function.Function<T,​U>

Returns

public static <T,​U> Promise<U>

Code examples
Promise.map(supplier, mapper);

resolve

public T resolve()

Retrieves the result of the Promise.

Returns

public T

Code examples
promise.resolve()

Concept

Concept

Package: com.typedb.driver.api.concept

Fields
Name Type Description

DECIMAL_SCALE

static int

asAttribute

default Attribute asAttribute()

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();

asEntityType

default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asInstance

default Instance asInstance()

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();

asRelation

default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();

asRelationType

default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asType

default Type asType()

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
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.

Returns

java.lang.String

Code examples
concept.getLabel();

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();

isInstance

@CheckReturnValue
default boolean isInstance()

Checks if the concept is an Instance.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isStruct();

isType

@CheckReturnValue
default boolean isType()

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();

isValue

@CheckReturnValue
default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
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.

Returns

java.util.Optional<java.lang.Boolean>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDate>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDateTime>

Code examples
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.

Returns

java.util.Optional<java.time.ZonedDateTime>

Code examples
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.

Returns

java.util.Optional<java.math.BigDecimal>

Code examples
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.

Returns

java.util.Optional<java.lang.Double>

Code examples
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.

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();

tryGetIID

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()

Retrieves the unique id of the Concept. Returns null if absent.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.Long>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>

Code examples
concept.tryGetStruct();

tryGetValue

@CheckReturnValue
java.util.Optional<Value> tryGetValue()

Retrieves the value which this Concept holds. Returns null if this Concept does not hold any value.

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()

Retrieves the String describing the value type of this Concept. Returns null if not absent.

Returns

java.util.Optional<java.lang.String>

Code examples
concept.tryGetValueType();

Schema

Type

Package: com.typedb.driver.api.concept.type

Superinterfaces:

  • Concept

asAttribute

default Attribute asAttribute()

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();

asEntityType

default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asInstance

default Instance asInstance()

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();

asRelation

default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();

asRelationType

default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asType

@CheckReturnValue
default Type asType()

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
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.

Returns

java.lang.String

Code examples
concept.getLabel();

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();

isInstance

@CheckReturnValue
default boolean isInstance()

Checks if the concept is an Instance.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isStruct();

isType

@CheckReturnValue
default boolean isType()

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();

isValue

@CheckReturnValue
default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
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.

Returns

java.util.Optional<java.lang.Boolean>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDate>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDateTime>

Code examples
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.

Returns

java.util.Optional<java.time.ZonedDateTime>

Code examples
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.

Returns

java.util.Optional<java.math.BigDecimal>

Code examples
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.

Returns

java.util.Optional<java.lang.Double>

Code examples
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.

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();

tryGetIID

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()

Retrieves the unique id of the Concept. Returns null if absent.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.Long>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>

Code examples
concept.tryGetStruct();

tryGetValue

@CheckReturnValue
java.util.Optional<Value> tryGetValue()

Retrieves the value which this Concept holds. Returns null if this Concept does not hold any value.

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()

Retrieves the String describing the value type of this Concept. Returns null if not absent.

Returns

java.util.Optional<java.lang.String>

Code examples
concept.tryGetValueType();

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.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();

asEntityType

@CheckReturnValue
default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asInstance

default Instance asInstance()

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();

asRelation

default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();

asRelationType

default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
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.

Returns

java.lang.String

Code examples
concept.getLabel();

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();

isInstance

@CheckReturnValue
default boolean isInstance()

Checks if the concept is an Instance.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isStruct();

isValue

@CheckReturnValue
default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
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.

Returns

java.util.Optional<java.lang.Boolean>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDate>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDateTime>

Code examples
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.

Returns

java.util.Optional<java.time.ZonedDateTime>

Code examples
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.

Returns

java.util.Optional<java.math.BigDecimal>

Code examples
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.

Returns

java.util.Optional<java.lang.Double>

Code examples
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.

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();

tryGetIID

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()

Retrieves the unique id of the Concept. Returns null if absent.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.Long>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>

Code examples
concept.tryGetStruct();

tryGetValue

@CheckReturnValue
java.util.Optional<Value> tryGetValue()

Retrieves the value which this Concept holds. Returns null if this Concept does not hold any value.

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()

Retrieves the String describing the value type of this Concept. Returns null if not absent.

Returns

java.util.Optional<java.lang.String>

Code examples
concept.tryGetValueType();

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.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();

asEntityType

default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asInstance

default Instance asInstance()

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();

asRelation

default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();

asRelationType

@CheckReturnValue
default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
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.

Returns

java.lang.String

Code examples
concept.getLabel();

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();

isInstance

@CheckReturnValue
default boolean isInstance()

Checks if the concept is an Instance.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isStruct();

isValue

@CheckReturnValue
default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
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.

Returns

java.util.Optional<java.lang.Boolean>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDate>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDateTime>

Code examples
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.

Returns

java.util.Optional<java.time.ZonedDateTime>

Code examples
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.

Returns

java.util.Optional<java.math.BigDecimal>

Code examples
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.

Returns

java.util.Optional<java.lang.Double>

Code examples
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.

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();

tryGetIID

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()

Retrieves the unique id of the Concept. Returns null if absent.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.Long>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>

Code examples
concept.tryGetStruct();

tryGetValue

@CheckReturnValue
java.util.Optional<Value> tryGetValue()

Retrieves the value which this Concept holds. Returns null if this Concept does not hold any value.

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()

Retrieves the String describing the value type of this Concept. Returns null if not absent.

Returns

java.util.Optional<java.lang.String>

Code examples
concept.tryGetValueType();

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.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();

asEntityType

default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asInstance

default Instance asInstance()

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();

asRelation

default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();

asRelationType

default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

@CheckReturnValue
default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
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.

Returns

java.lang.String

Code examples
concept.getLabel();

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();

isInstance

@CheckReturnValue
default boolean isInstance()

Checks if the concept is an Instance.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isStruct();

isValue

@CheckReturnValue
default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
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.

Returns

java.util.Optional<java.lang.Boolean>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDate>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDateTime>

Code examples
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.

Returns

java.util.Optional<java.time.ZonedDateTime>

Code examples
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.

Returns

java.util.Optional<java.math.BigDecimal>

Code examples
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.

Returns

java.util.Optional<java.lang.Double>

Code examples
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.

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();

tryGetIID

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()

Retrieves the unique id of the Concept. Returns null if absent.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.Long>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>

Code examples
concept.tryGetStruct();

tryGetValue

@CheckReturnValue
java.util.Optional<Value> tryGetValue()

Retrieves the value which this Concept holds. Returns null if this Concept does not hold any value.

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()

Retrieves the String describing the value type of this Concept. Returns null if not absent.

Returns

java.util.Optional<java.lang.String>

Code examples
concept.tryGetValueType();

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.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

@CheckReturnValue
default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();

asEntityType

default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asInstance

default Instance asInstance()

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();

asRelation

default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();

asRelationType

default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
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.

Returns

java.lang.String

Code examples
concept.getLabel();

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();

isInstance

@CheckReturnValue
default boolean isInstance()

Checks if the concept is an Instance.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isStruct();

isValue

@CheckReturnValue
default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
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.

Returns

java.util.Optional<java.lang.Boolean>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDate>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDateTime>

Code examples
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.

Returns

java.util.Optional<java.time.ZonedDateTime>

Code examples
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.

Returns

java.util.Optional<java.math.BigDecimal>

Code examples
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.

Returns

java.util.Optional<java.lang.Double>

Code examples
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.

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();

tryGetIID

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()

Retrieves the unique id of the Concept. Returns null if absent.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.Long>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>

Code examples
concept.tryGetStruct();

tryGetValue

@CheckReturnValue
java.util.Optional<Value> tryGetValue()

Retrieves the value which this Concept holds. Returns null if this Concept does not hold any value.

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()

Retrieves the String describing the value type of this Concept. Returns null if not absent.

Returns

java.util.Optional<java.lang.String>

Code examples
concept.tryGetValueType();

Data

Instance

Package: com.typedb.driver.api.concept.instance

Superinterfaces:

  • Concept

asAttribute

default Attribute asAttribute()

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();

asEntityType

default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asInstance

@CheckReturnValue
default Instance asInstance()

Casts the concept to Instance.

Returns

Instance

Code examples
instance.asInstance();

asRelation

default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();

asRelationType

default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asType

default Type asType()

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
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.

Returns

java.lang.String

Code examples
concept.getLabel();

getType

@CheckReturnValue
Type getType()

Retrieves the type which this Instance belongs to.

Returns

Type

Code examples
instance.getType();

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();

isInstance

@CheckReturnValue
default boolean isInstance()

Checks if the concept is a Instance.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isStruct();

isType

@CheckReturnValue
default boolean isType()

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();

isValue

@CheckReturnValue
default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
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.

Returns

java.util.Optional<java.lang.Boolean>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDate>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDateTime>

Code examples
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.

Returns

java.util.Optional<java.time.ZonedDateTime>

Code examples
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.

Returns

java.util.Optional<java.math.BigDecimal>

Code examples
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.

Returns

java.util.Optional<java.lang.Double>

Code examples
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.

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();

tryGetIID

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()

Retrieves the unique id of the Concept. Returns null if absent.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.Long>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>

Code examples
concept.tryGetStruct();

tryGetValue

@CheckReturnValue
java.util.Optional<Value> tryGetValue()

Retrieves the value which this Concept holds. Returns null if this Concept does not hold any value.

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()

Retrieves the String describing the value type of this Concept. Returns null if not absent.

Returns

java.util.Optional<java.lang.String>

Code examples
concept.tryGetValueType();

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.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

@CheckReturnValue
default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
entity.asEntity();

asEntityType

default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asRelation

default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();

asRelationType

default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asType

default Type asType()

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();

getIID

@CheckReturnValue
java.lang.String getIID()

Retrieves the unique id of the Entity.

Returns

java.lang.String

Code examples
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.

Returns

java.lang.String

Code examples
concept.getLabel();

getType

@CheckReturnValue
EntityType getType()

Retrieves the type which this Entity belongs to.

Returns

EntityType

Code examples
entity.getType();

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
entity.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isStruct();

isType

@CheckReturnValue
default boolean isType()

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();

isValue

@CheckReturnValue
default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
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.

Returns

java.util.Optional<java.lang.Boolean>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDate>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDateTime>

Code examples
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.

Returns

java.util.Optional<java.time.ZonedDateTime>

Code examples
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.

Returns

java.util.Optional<java.math.BigDecimal>

Code examples
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.

Returns

java.util.Optional<java.lang.Double>

Code examples
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.

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();

tryGetIID

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()

Retrieves the unique id of the Concept. Returns null if absent.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.Long>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>

Code examples
concept.tryGetStruct();

tryGetValue

@CheckReturnValue
java.util.Optional<Value> tryGetValue()

Retrieves the value which this Concept holds. Returns null if this Concept does not hold any value.

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()

Retrieves the String describing the value type of this Concept. Returns null if not absent.

Returns

java.util.Optional<java.lang.String>

Code examples
concept.tryGetValueType();

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.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();

asEntityType

default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asRelation

@CheckReturnValue
default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
relation.asRelation();

asRelationType

default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asType

default Type asType()

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();

getIID

@CheckReturnValue
java.lang.String getIID()

Retrieves the unique id of the Relation.

Returns

java.lang.String

Code examples
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.

Returns

java.lang.String

Code examples
concept.getLabel();

getType

@CheckReturnValue
RelationType getType()

Retrieves the type which this Relation belongs to.

Returns

RelationType

Code examples
relation.getType();

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
relation.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isStruct();

isType

@CheckReturnValue
default boolean isType()

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();

isValue

@CheckReturnValue
default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
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.

Returns

java.util.Optional<java.lang.Boolean>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDate>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDateTime>

Code examples
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.

Returns

java.util.Optional<java.time.ZonedDateTime>

Code examples
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.

Returns

java.util.Optional<java.math.BigDecimal>

Code examples
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.

Returns

java.util.Optional<java.lang.Double>

Code examples
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.

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();

tryGetIID

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()

Retrieves the unique id of the Concept. Returns null if absent.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.Long>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>

Code examples
concept.tryGetStruct();

tryGetValue

@CheckReturnValue
java.util.Optional<Value> tryGetValue()

Retrieves the value which this Concept holds. Returns null if this Concept does not hold any value.

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()

Retrieves the String describing the value type of this Concept. Returns null if not absent.

Returns

java.util.Optional<java.lang.String>

Code examples
concept.tryGetValueType();

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.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();

asEntityType

default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asRelation

default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();

asRelationType

default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asType

default Type asType()

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
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.

Returns

boolean

Code examples
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.

Returns

java.time.LocalDate

Code examples
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.

Returns

java.time.LocalDateTime

Code examples
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.

Returns

java.time.ZonedDateTime

Code examples
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.

Returns

java.math.BigDecimal

Code examples
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.

Returns

double

Code examples
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.

Returns

Duration

Code examples
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.

Returns

long

Code examples
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.

Returns

java.lang.String

Code examples
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.

Returns

java.lang.String

Code examples
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.

Returns

java.util.Map<java.lang.String,​java.util.Optional<Value>>

Code examples
attribute.getStruct();

getType

@CheckReturnValue
AttributeType getType()

Retrieves the type which this Attribute belongs to.

Returns

AttributeType

Code examples
attribute.getType();

getValue

@CheckReturnValue
Value getValue()

Retrieves the value which the Attribute instance holds.

Returns

Value

Code examples
attribute.getValue();

getValueType

@CheckReturnValue
java.lang.String getValueType()

Retrieves the description of the value type of the value which the Attribute instance holds.

Returns

java.lang.String

Code examples
attribute.getValueType();

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isStruct();

isType

@CheckReturnValue
default boolean isType()

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();

isValue

@CheckReturnValue
default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
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.

Returns

java.util.Optional<java.lang.Boolean>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDate>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDateTime>

Code examples
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.

Returns

java.util.Optional<java.time.ZonedDateTime>

Code examples
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.

Returns

java.util.Optional<java.math.BigDecimal>

Code examples
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.

Returns

java.util.Optional<java.lang.Double>

Code examples
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.

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();

tryGetIID

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()

Retrieves the unique id of the Concept. Returns null if absent.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.Long>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>

Code examples
concept.tryGetStruct();

tryGetValue

@CheckReturnValue
java.util.Optional<Value> tryGetValue()

Retrieves the value which this Concept holds. Returns null if this Concept does not hold any value.

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()

Retrieves the String describing the value type of this Concept. Returns null if not absent.

Returns

java.util.Optional<java.lang.String>

Code examples
concept.tryGetValueType();

Value

Package: com.typedb.driver.api.concept.value

Superinterfaces:

  • Concept

asAttribute

default Attribute asAttribute()

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();

asEntityType

default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asInstance

default Instance asInstance()

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();

asRelation

default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();

asRelationType

default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asType

default Type asType()

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
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.

Returns

java.lang.Object

Code examples
value.get();

getBoolean

boolean getBoolean()

Returns a boolean value of this value concept. If the value has another type, raises an exception.

Returns

boolean

Code examples
value.getBoolean();

getDate

java.time.LocalDate getDate()

Returns a date value of this value concept. If the value has another type, raises an exception.

Returns

java.time.LocalDate

Code examples
value.getDate();

getDatetime

java.time.LocalDateTime getDatetime()

Returns a datetime value of this value concept. If the value has another type, raises an exception.

Returns

java.time.LocalDateTime

Code examples
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.

Returns

java.time.ZonedDateTime

Code examples
value.getDatetimeTZ();

getDecimal

java.math.BigDecimal getDecimal()

Returns a decimal value of this value concept. If the value has another type, raises an exception.

Returns

java.math.BigDecimal

Code examples
value.getDecimal();

getDouble

double getDouble()

Returns a double value of this value concept. If the value has another type, raises an exception.

Returns

double

Code examples
value.getDouble();

getDuration

Duration getDuration()

Returns a duration value of this value concept. If the value has another type, raises an exception.

Returns

Duration

Code examples
value.getDuration();

getInteger

long getInteger()

Returns a integer value of this value concept. If the value has another type, raises an exception.

Returns

long

Code examples
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.

Returns

java.lang.String

Code examples
concept.getLabel();

getString

java.lang.String getString()

Returns a string value of this value concept. If the value has another type, raises an exception.

Returns

java.lang.String

Code examples
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.

Returns

java.util.Map<java.lang.String,​java.util.Optional<Value>>

Code examples
value.getStruct();

getType

java.lang.String getType()

Retrieves the String describing the value type of this Value concept.

Returns

java.lang.String

Code examples
value.getType()

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();

isInstance

@CheckReturnValue
default boolean isInstance()

Checks if the concept is an Instance.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
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.

Returns

boolean

Code examples
concept.isStruct();

isType

@CheckReturnValue
default boolean isType()

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();

isValue

default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
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.

Returns

java.util.Optional<java.lang.Boolean>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDate>

Code examples
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.

Returns

java.util.Optional<java.time.LocalDateTime>

Code examples
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.

Returns

java.util.Optional<java.time.ZonedDateTime>

Code examples
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.

Returns

java.util.Optional<java.math.BigDecimal>

Code examples
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.

Returns

java.util.Optional<java.lang.Double>

Code examples
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.

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();

tryGetIID

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()

Retrieves the unique id of the Concept. Returns null if absent.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.Long>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.lang.String>

Code examples
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.

Returns

java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>

Code examples
concept.tryGetStruct();

tryGetValue

@CheckReturnValue
java.util.Optional<Value> tryGetValue()

Retrieves the value which this Concept holds. Returns null if this Concept does not hold any value.

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()

Retrieves the String describing the value type of this Concept. Returns null if not absent.

Returns

java.util.Optional<java.lang.String>

Code examples
concept.tryGetValueType();

Value

Duration

Package: com.typedb.driver.common

equals

public boolean equals​(java.lang.Object obj)

Checks if this Duration is equal to another object.

Input parameters
Name Description Type

obj

Object to compare with

java.lang.Object

Returns

public boolean

Code examples
label.equals(obj);

getDatePart

public java.time.Period getDatePart()

Returns the date part of this duration.

Returns

public java.time.Period

Code examples
duration.getDatePart();

getDays

public int getDays()

Returns the amount of days of this Duration from the date part.

Returns

public int

Code examples
duration.getMonths();

getMonths

public int getMonths()

Returns the amount of months of this Duration from the date part.

Returns

public int

Code examples
duration.getMonths();

getNano

public long getNano()

Returns the number of nanoseconds within the second in this Duration from the time part.

Returns

public long

Code examples
duration.getNano();

getSeconds

public long getSeconds()

Returns the amount of seconds of this Duration from the time part.

Returns

public long

Code examples
duration.getSeconds();

getTimePart

public java.time.Duration getTimePart()

Returns the time part of this duration.

Returns

public java.time.Duration

Code examples
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

Input parameters
Name Description Type

durationString

A string representation of the duration. Expected format: PnYnMnDTnHnMnS or PnW.

java.lang.String

Returns

public static Duration

Code examples
Duration.parse("P1Y10M7DT15H44M5.00394892S");
     Duration.parse("P55W");

toString

public java.lang.String toString()

Returns the string representation of the duration.

Returns

public java.lang.String

Code examples
duration.toString();

Errors

TypeDBDriverException

Package: com.typedb.driver.common.exception

Exceptions raised by the driver.

getErrorMessage

@Nullable
public com.typedb.driver.common.exception.ErrorMessage getErrorMessage()
Returns

public com.typedb.driver.common.exception.ErrorMessage

getName

public java.lang.String getName()
Returns

public java.lang.String