Class MultiResult<OPERATION>
- java.lang.Object
-
- com.couchbase.client.core.message.kv.subdoc.multi.MultiResult<OPERATION>
-
@Committed @Public public class MultiResult<OPERATION> extends Object
The result corresponding to an individualLookupCommand
orMutationCommand
. It contains the command's path and operation for reference. The value only makes sense for some commands (likeLookup.GET
orMutation.COUNTER
). If it does make sense, it is represented as an UTF-8 encodedByteBuf
. It is the responsibility of the caller to consume andReferenceCounted.release()
this ByteBuf.- Since:
- 1.2
- Author:
- Simon Baslé
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MultiResult<Lookup>
create(short statusCode, ResponseStatus status, String path, Lookup operation, ByteBuf value)
static MultiResult<Mutation>
create(short statusCode, ResponseStatus status, String path, Mutation operation, ByteBuf value)
boolean
equals(Object o)
int
hashCode()
OPERATION
operation()
String
path()
ResponseStatus
status()
Returns the individual operation's status.short
statusCode()
String
toString()
ByteBuf
value()
-
-
-
Method Detail
-
create
public static MultiResult<Lookup> create(short statusCode, ResponseStatus status, String path, Lookup operation, ByteBuf value)
-
create
public static MultiResult<Mutation> create(short statusCode, ResponseStatus status, String path, Mutation operation, ByteBuf value)
-
statusCode
public short statusCode()
- Returns:
- the byte status of the individual operation.
-
status
public ResponseStatus status()
Returns the individual operation's status. Note that the containingMultiLookupResponse
status can only beResponseStatus.SUCCESS
if all individual LookupResults are a SUCCESS too. ALookup.EXIST
can either be a SUCCESS if the value exist or aResponseStatus.SUBDOC_PATH_NOT_FOUND
if not.
-
path
public String path()
- Returns:
- the path asked for in the original
LookupCommand
orMutationCommand
, for reference.
-
operation
public OPERATION operation()
- Returns:
- the
Lookup
/Mutation
operation of the originalLookupCommand
/MutationCommand
, for reference.
-
value
public ByteBuf value()
- Returns:
- the value as a
ByteBuf
(that you must consume andReferenceCounted.release()
). Can be empty in case of error or if the operation doesn't return a value.
-
-