public class GetResponse extends ActionResponse implements java.lang.Iterable<GetField>, ToXContentObject
GetRequest,
Client.get(GetRequest)TransportResponse.EmptyToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsEMPTY_PARAMS| Constructor and Description |
|---|
GetResponse(GetResult getResult) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
static GetResponse |
fromXContent(XContentParser parser) |
GetField |
getField(java.lang.String name) |
java.util.Map<java.lang.String,GetField> |
getFields() |
java.lang.String |
getId()
The id of the document.
|
java.lang.String |
getIndex()
The index the document was fetched from.
|
java.util.Map<java.lang.String,java.lang.Object> |
getSource() |
byte[] |
getSourceAsBytes()
The source of the document if exists.
|
BytesReference |
getSourceAsBytesRef()
Returns bytes reference, also un compress the source if needed.
|
java.util.Map<java.lang.String,java.lang.Object> |
getSourceAsMap()
The source of the document (As a map).
|
java.lang.String |
getSourceAsString()
The source of the document (as a string).
|
BytesReference |
getSourceInternal()
Returns the internal source bytes, as they are returned without munging (for example,
might still be compressed).
|
java.lang.String |
getType()
The type of the document.
|
long |
getVersion()
The version of the doc.
|
int |
hashCode() |
boolean |
isExists()
Does the document exists.
|
boolean |
isSourceEmpty()
Is the source empty (not available) or not.
|
java.util.Iterator<GetField> |
iterator()
Deprecated.
Use
getSource() instead |
void |
readFrom(StreamInput in)
Set this object's fields from a StreamInput.
|
java.lang.String |
toString() |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.
|
remoteAddress, remoteAddressclone, finalize, getClass, notify, notifyAll, wait, wait, waitisFragmentpublic GetResponse(GetResult getResult)
public boolean isExists()
public java.lang.String getIndex()
public java.lang.String getType()
public java.lang.String getId()
public long getVersion()
public byte[] getSourceAsBytes()
public BytesReference getSourceInternal()
public BytesReference getSourceAsBytesRef()
public boolean isSourceEmpty()
public java.lang.String getSourceAsString()
public java.util.Map<java.lang.String,java.lang.Object> getSourceAsMap()
throws ElasticsearchParseException
ElasticsearchParseExceptionpublic java.util.Map<java.lang.String,java.lang.Object> getSource()
public java.util.Map<java.lang.String,GetField> getFields()
public GetField getField(java.lang.String name)
@Deprecated public java.util.Iterator<GetField> iterator()
getSource() insteaditerator in interface java.lang.Iterable<GetField>public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent in interface ToXContentjava.io.IOExceptionpublic static GetResponse fromXContent(XContentParser parser) throws java.io.IOException
java.io.IOExceptionpublic void readFrom(StreamInput in) throws java.io.IOException
StreamablereadFrom in interface StreamablereadFrom in class ActionResponsejava.io.IOExceptionpublic void writeTo(StreamOutput out) throws java.io.IOException
StreamablewriteTo in interface StreamablewriteTo in class ActionResponsejava.io.IOExceptionpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object