public class DefaultPortableReader extends ValueReader implements PortableReader
Modifier and Type | Field and Description |
---|---|
protected ClassDefinition |
cd |
protected com.hazelcast.internal.serialization.impl.PortableSerializer |
serializer |
Modifier and Type | Method and Description |
---|---|
int |
getFieldClassId(String fieldName) |
Set<String> |
getFieldNames() |
FieldType |
getFieldType(String fieldName) |
ObjectDataInput |
getRawDataInput()
|
int |
getVersion() |
boolean |
hasField(String fieldName) |
Object |
read(String path) |
void |
read(String path,
ValueCallback callback)
Read the value of the attribute specified by the path and returns the result via the callback.
|
void |
read(String path,
ValueCollector collector)
Read the value of the attribute specified by the path and returns the result directly to the collector.
|
boolean |
readBoolean(String path) |
boolean[] |
readBooleanArray(String path) |
byte |
readByte(String path) |
byte[] |
readByteArray(String path) |
char |
readChar(String path) |
char[] |
readCharArray(String path) |
double |
readDouble(String path) |
double[] |
readDoubleArray(String path) |
float |
readFloat(String path) |
float[] |
readFloatArray(String path) |
int |
readInt(String path) |
int[] |
readIntArray(String path) |
long |
readLong(String path) |
long[] |
readLongArray(String path) |
Portable |
readPortable(String path) |
Portable[] |
readPortableArray(String fieldName) |
short |
readShort(String path) |
short[] |
readShortArray(String path) |
String |
readUTF(String path) |
String[] |
readUTFArray(String path) |
protected final ClassDefinition cd
protected final com.hazelcast.internal.serialization.impl.PortableSerializer serializer
public int getVersion()
getVersion
in interface PortableReader
public boolean hasField(String fieldName)
hasField
in interface PortableReader
fieldName
- name of the field (does not support nested paths)public Set<String> getFieldNames()
getFieldNames
in interface PortableReader
public FieldType getFieldType(String fieldName)
getFieldType
in interface PortableReader
fieldName
- name of the fieldpublic int getFieldClassId(String fieldName)
getFieldClassId
in interface PortableReader
fieldName
- name of the fieldpublic ObjectDataInput getRawDataInput() throws IOException
PortableReader
PortableWriter.getRawDataOutput()
.
Note that portable fields can not read after getRawDataInput() is called. In case this happens,
IOException will be thrown.getRawDataInput
in interface PortableReader
IOException
public byte readByte(String path) throws IOException
readByte
in interface PortableReader
path
- name of the fieldIOException
public short readShort(String path) throws IOException
readShort
in interface PortableReader
path
- name of the fieldIOException
public int readInt(String path) throws IOException
readInt
in interface PortableReader
path
- name of the fieldIOException
public long readLong(String path) throws IOException
readLong
in interface PortableReader
path
- name of the fieldIOException
public float readFloat(String path) throws IOException
readFloat
in interface PortableReader
path
- name of the fieldIOException
public double readDouble(String path) throws IOException
readDouble
in interface PortableReader
path
- name of the fieldIOException
public boolean readBoolean(String path) throws IOException
readBoolean
in interface PortableReader
path
- name of the fieldIOException
public char readChar(String path) throws IOException
readChar
in interface PortableReader
path
- name of the fieldIOException
public String readUTF(String path) throws IOException
readUTF
in interface PortableReader
path
- name of the fieldIOException
public Portable readPortable(String path) throws IOException
readPortable
in interface PortableReader
path
- name of the fieldIOException
public byte[] readByteArray(String path) throws IOException
readByteArray
in interface PortableReader
path
- name of the fieldIOException
public boolean[] readBooleanArray(String path) throws IOException
readBooleanArray
in interface PortableReader
path
- name of the fieldIOException
public char[] readCharArray(String path) throws IOException
readCharArray
in interface PortableReader
path
- name of the fieldIOException
public int[] readIntArray(String path) throws IOException
readIntArray
in interface PortableReader
path
- name of the fieldIOException
public long[] readLongArray(String path) throws IOException
readLongArray
in interface PortableReader
path
- name of the fieldIOException
public double[] readDoubleArray(String path) throws IOException
readDoubleArray
in interface PortableReader
path
- name of the fieldIOException
public float[] readFloatArray(String path) throws IOException
readFloatArray
in interface PortableReader
path
- name of the fieldIOException
public short[] readShortArray(String path) throws IOException
readShortArray
in interface PortableReader
path
- name of the fieldIOException
public String[] readUTFArray(String path) throws IOException
readUTFArray
in interface PortableReader
path
- name of the fieldIOException
public Portable[] readPortableArray(String fieldName) throws IOException
readPortableArray
in interface PortableReader
fieldName
- name of the fieldIOException
public void read(String path, ValueCallback callback)
ValueReader
read
in class ValueReader
path
- attribute to read the value fromcallback
- callback to call with the value. May be called more than once in case of wildcards.public void read(String path, ValueCollector collector)
ValueReader
read
in class ValueReader
path
- attribute to read the value fromcollector
- collector to collect the result with. May collect more than one result in case of wildcards.public Object read(String path) throws IOException
IOException
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.