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 individual
LookupCommand
or MutationCommand
.
It contains the command's path and operation for reference.
The value only makes sense for some commands (like Lookup.GET
or Mutation.COUNTER
).
If it does make sense, it is represented as an UTF-8 encoded ByteBuf
.
It is the responsibility of the caller to consume and ReferenceCounted.release()
this ByteBuf.- Since:
- 1.2
- Author:
- Simon Baslé
-
Method Summary
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 Details
-
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
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
- Returns:
- the path asked for in the original
LookupCommand
orMutationCommand
, for reference.
-
operation
- Returns:
- the
Lookup
/Mutation
operation of the originalLookupCommand
/MutationCommand
, for reference.
-
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.
-
equals
-
hashCode
public int hashCode() -
toString
-