Package com.couchbase.client.java
Class MutationState
- java.lang.Object
-
- com.couchbase.client.java.MutationState
-
- All Implemented Interfaces:
Iterable<MutationToken>
public class MutationState extends Object implements Iterable<MutationToken>
Aggregation of one or moreMutationTokeninto oneMutationState.- Since:
- 2.3.0
- Author:
- Michael Nitschinger
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MutationStateadd(Document... documents)Add one or moreDocumentsto thisMutationState.MutationStateadd(MutationState mutationState)Adds all the internal state from the givenMutationStateonto the called one.MutationStateadd(DocumentFragment... documentFragments)Add one or moreDocumentFragmentsto thisMutationState.booleanequals(Object o)JsonObjectexport()Exports theMutationStateinto a universal format, which can be used either to serialize it into a N1QL query or to send it over the network to a different application/SDK.JsonObjectexportForFts()Exports theMutationStateinto a format recognized by the FTS search engine.static MutationStatefrom(Document... documents)Create aMutationStatefrom one or moreDocuments.static MutationStatefrom(JsonObject source)Create aMutationStatefrom the serialized state.static MutationStatefrom(DocumentFragment... documentFragments)Create aMutationStatefrom one or moreDocumentFragments.static MutationStatefrom(String source)Create aMutationStatefrom the serialized state.inthashCode()Iterator<MutationToken>iterator()StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
from
public static MutationState from(Document... documents)
Create aMutationStatefrom one or moreDocuments.- Parameters:
documents- the documents where the tokens are extracted from.- Returns:
- the initialized
MutationState.
-
from
public static MutationState from(DocumentFragment... documentFragments)
Create aMutationStatefrom one or moreDocumentFragments.- Parameters:
documentFragments- the document fragments where the tokens are extracted from.- Returns:
- the initialized
MutationState.
-
add
public MutationState add(Document... documents)
Add one or moreDocumentsto thisMutationState.- Parameters:
documents- the documents where the tokens are extracted from.- Returns:
- the modified
MutationState.
-
add
public MutationState add(DocumentFragment... documentFragments)
Add one or moreDocumentFragmentsto thisMutationState.- Parameters:
documentFragments- the fragments where the tokens are extracted from.- Returns:
- the modified
MutationState.
-
add
public MutationState add(MutationState mutationState)
Adds all the internal state from the givenMutationStateonto the called one.- Parameters:
mutationState- the state from which the tokens are applied from.- Returns:
- the modified
MutationState.
-
iterator
public Iterator<MutationToken> iterator()
- Specified by:
iteratorin interfaceIterable<MutationToken>
-
export
public JsonObject export()
Exports theMutationStateinto a universal format, which can be used either to serialize it into a N1QL query or to send it over the network to a different application/SDK.- Returns:
- the exported
JsonObject.
-
exportForFts
public JsonObject exportForFts()
Exports theMutationStateinto a format recognized by the FTS search engine.- Returns:
- the exported
JsonObjectfor one FTS index.
-
from
public static MutationState from(String source)
Create aMutationStatefrom the serialized state.- Parameters:
source- the source state, serialized.- Returns:
- the created
MutationState.
-
from
public static MutationState from(JsonObject source)
Create aMutationStatefrom the serialized state.- Parameters:
source- the source state, serialized.- Returns:
- the created
MutationState.
-
-