Package com.datastax.astra.client.model
Class Command
java.lang.Object
com.datastax.astra.client.model.Command
- All Implemented Interfaces:
Serializable
Represent a command to be executed against the Data API.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCustom serializer for Command class. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuilder pattern, update documents.static CommandCreate an empty command from its name.withDocument(Object document) Builder pattern, update document.<T> CommandwithDocuments(List<T> documents) Builder pattern, update documents.withFilter(Filter filter) Builder pattern, update filter.withOptions(Object options) Builder pattern, update options.withProjection(Map<String, Object> projection) Builder pattern, update projection.withReplacement(Object replacement) Builder pattern, update replacement document.Builder pattern, update sort.withUpdate(Update update) Builder pattern, Update.
-
Field Details
-
name
Command Name. -
payload
Command payload.
-
-
Constructor Details
-
Command
public Command()Default constructor. -
Command
Constructor with a name.- Parameters:
name- unique command name
-
Command
Specialization of the command.- Parameters:
name- command namepayload- command payload
-
-
Method Details
-
create
Create an empty command from its name.- Parameters:
name- unique command name- Returns:
- instance of the command
-
withFilter
Builder pattern, update filter.- Parameters:
filter- filter for the command- Returns:
- self-reference
-
withReplacement
Builder pattern, update replacement document.- Parameters:
replacement- replacement for the command- Returns:
- self-reference
-
withProjection
Builder pattern, update projection.- Parameters:
projection- projection for the command- Returns:
- self-reference
-
withSort
Builder pattern, update sort.- Parameters:
sort- sort for the command- Returns:
- self-reference
-
withOptions
Builder pattern, update options.- Parameters:
options- options for the command- Returns:
- self-reference
-
withDocument
Builder pattern, update document.- Parameters:
document- document for the command- Returns:
- self-reference
-
withDocuments
Builder pattern, update documents.- Type Parameters:
T- working clas for documents- Parameters:
documents- documents for the command- Returns:
- self-reference
-
append
Builder pattern, update documents.- Parameters:
key- name of the attributeobj- value of the attribute- Returns:
- self-reference
-
withUpdate
Builder pattern, Update.- Parameters:
update- update of the command- Returns:
- self-reference
-