Package io.activej.codec
Interface StructuredInput
- All Known Implementing Classes:
BinaryStructuredInput,JsonStructuredInput
public interface StructuredInput
This is an abstraction that allows you to read data in uniform way
from different sources with different implementations of this interface
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceStructuredInput.DecoderRunnablestatic classStructuredInput.Token -
Method Summary
Modifier and Type Method Description EnumSet<StructuredInput.Token>getNext()booleanhasNext()booleanreadBoolean()bytereadByte()byte[]readBytes()<T> TreadCustom(Type type)doublereadDouble()floatreadFloat()intreadInt()intreadInt32()StringreadKey()default voidreadKey(String expectedName)default <T> TreadKey(String expectedName, StructuredDecoder<T> decoder)<T> List<T>readList(StructuredDecoder<T> decoder)longreadLong()longreadLong64()<K, V> Map<K,V>readMap(StructuredDecoder<K> keyDecoder, StructuredDecoder<V> valueDecoder)voidreadNull()<T> TreadNullable(StructuredDecoder<T> decoder)<T> TreadObject(StructuredDecoder<T> decoder)default voidreadObject(StructuredInput.DecoderRunnable decoder)StringreadString()<T> TreadTuple(StructuredDecoder<T> decoder)default voidreadTuple(StructuredInput.DecoderRunnable decoder)
-
Method Details
-
readNull
- Throws:
MalformedDataException
-
readBoolean
- Throws:
MalformedDataException
-
readByte
- Throws:
MalformedDataException
-
readInt
- Throws:
MalformedDataException
-
readLong
- Throws:
MalformedDataException
-
readInt32
- Throws:
MalformedDataException
-
readLong64
- Throws:
MalformedDataException
-
readFloat
- Throws:
MalformedDataException
-
readDouble
- Throws:
MalformedDataException
-
readBytes
- Throws:
MalformedDataException
-
readString
- Throws:
MalformedDataException
-
readNullable
- Throws:
MalformedDataException
-
hasNext
- Throws:
MalformedDataException
-
readKey
- Throws:
MalformedDataException
-
readKey
- Throws:
MalformedDataException
-
readKey
default <T> T readKey(String expectedName, StructuredDecoder<T> decoder) throws MalformedDataException- Throws:
MalformedDataException
-
readList
- Throws:
MalformedDataException
-
readMap
<K, V> Map<K,V> readMap(StructuredDecoder<K> keyDecoder, StructuredDecoder<V> valueDecoder) throws MalformedDataException- Throws:
MalformedDataException
-
readTuple
- Throws:
MalformedDataException
-
readObject
- Throws:
MalformedDataException
-
readTuple
- Throws:
MalformedDataException
-
readObject
- Throws:
MalformedDataException
-
readCustom
- Throws:
MalformedDataException
-
getNext
- Throws:
MalformedDataException
-