Package com.azure.data.cosmos
Class CosmosItem
- java.lang.Object
-
- com.azure.data.cosmos.CosmosItem
-
public class CosmosItem extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<CosmosItemResponse>
delete()
Deletes the item.Mono<CosmosItemResponse>
delete(CosmosItemRequestOptions options)
Deletes the item.String
id()
Get the id of theCosmosItem
Mono<CosmosItemResponse>
read()
Reads an item.Mono<CosmosItemResponse>
read(CosmosItemRequestOptions options)
Reads an item.Mono<CosmosItemResponse>
replace(Object item)
Replaces an item with the passed in item.Mono<CosmosItemResponse>
replace(Object item, CosmosItemRequestOptions options)
Replaces an item with the passed in item.
-
-
-
Method Detail
-
id
public String id()
Get the id of theCosmosItem
- Returns:
- the id of the
CosmosItem
-
read
public Mono<CosmosItemResponse> read()
Reads an item. After subscription the operation will be performed. TheMono
upon successful completion will contain a cosmos item response with the read item In case of failure theMono
will error.- Returns:
- an
Mono
containing the cosmos item response with the read item or an error
-
read
public Mono<CosmosItemResponse> read(CosmosItemRequestOptions options)
Reads an item. After subscription the operation will be performed. TheMono
upon successful completion will contain a cosmos item response with the read item In case of failure theMono
will error.- Parameters:
options
- the request comosItemRequestOptions- Returns:
- an
Mono
containing the cosmos item response with the read item or an error
-
replace
public Mono<CosmosItemResponse> replace(Object item)
Replaces an item with the passed in item. After subscription the operation will be performed. TheMono
upon successful completion will contain a single cosmos item response with the replaced item. In case of failure theMono
will error.- Parameters:
item
- the item to replace (containing the document id).- Returns:
- an
Mono
containing the cosmos item resource response with the replaced item or an error.
-
replace
public Mono<CosmosItemResponse> replace(Object item, CosmosItemRequestOptions options)
Replaces an item with the passed in item. After subscription the operation will be performed. TheMono
upon successful completion will contain a single cosmos item response with the replaced item. In case of failure theMono
will error.- Parameters:
item
- the item to replace (containing the document id).options
- the request comosItemRequestOptions- Returns:
- an
Mono
containing the cosmos item resource response with the replaced item or an error.
-
delete
public Mono<CosmosItemResponse> delete()
Deletes the item. After subscription the operation will be performed. TheMono
upon successful completion will contain a single cosmos item response with the replaced item. In case of failure theMono
will error.- Returns:
- an
Mono
containing the cosmos item resource response.
-
delete
public Mono<CosmosItemResponse> delete(CosmosItemRequestOptions options)
Deletes the item. After subscription the operation will be performed. TheMono
upon successful completion will contain a single cosmos item response with the replaced item. In case of failure theMono
will error.- Parameters:
options
- the request options- Returns:
- an
Mono
containing the cosmos item resource response.
-
-