Package io.stargate.sdk.rest
Class TypeClient
java.lang.Object
io.stargate.sdk.rest.TypeClient
Working with UDT.
- Author:
- Cedrick LUNVEN (@clunven)
-
Field Summary
FieldsModifier and TypeFieldDescription/v2/keyspaces/{keyspace}/tables/{tableName}/v2/schemas/keyspaces/{keyspace}/tables/{tableName} -
Constructor Summary
ConstructorsConstructorDescriptionTypeClient(LoadBalancedHttpClient stargateHttpClient, KeyspaceClient keyspaceClient, String typeName) Full constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate(CreateType tcr) Create a type.voiddelete()Delete a typebooleanexist()Check if the table exist.find()Get metadata of the collection.Getter accessor for attribute 'tableName'.voidupdate(UpdateType update) updateOptions
-
Field Details
-
typeSchemaResource
/v2/schemas/keyspaces/{keyspace}/tables/{tableName} -
typeResource
/v2/keyspaces/{keyspace}/tables/{tableName}
-
-
Constructor Details
-
TypeClient
public TypeClient(LoadBalancedHttpClient stargateHttpClient, KeyspaceClient keyspaceClient, String typeName) Full constructor.- Parameters:
stargateHttpClient- stargateHttpClientkeyspaceClient- KeyspaceClienttypeName- String
-
-
Method Details
-
find
Get metadata of the collection. There is no dedicated resources we use the list and filter with what we need.- Returns:
- metadata of the collection if its exist or empty
-
exist
public boolean exist()Check if the table exist.- Returns:
- boolean
-
create
Create a type.- Parameters:
tcr- creation request- See Also:
-
update
updateOptions- Parameters:
update- to TableOptions- See Also:
-
delete
public void delete()Delete a type- See Also:
-
getTypeName
Getter accessor for attribute 'tableName'.- Returns:
- current value of 'tableName'
-