Package dev.enola.common.io.object
Class ObjectReaderChain
java.lang.Object
dev.enola.common.io.object.ObjectReaderChain
- All Implemented Interfaces:
ObjectReader
- Direct Known Subclasses:
ObjectReaderWriterChain
-
Constructor Summary
ConstructorsConstructorDescriptionObjectReaderChain(ObjectReader... readers) ObjectReaderChain(Iterable<ObjectReader> readers) -
Method Summary
Modifier and TypeMethodDescription<T> Optional<T> optional(ReadableResource resource, Class<T> type) Read an object of Class T from the resource, if present.<T> Iterable<T> readArray(ReadableResource resource, Class<T> type) Read e.g.<T> Iterable<T> readStream(ReadableResource resource, Class<T> type) Read e.g.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.enola.common.io.object.ObjectReader
read
-
Constructor Details
-
ObjectReaderChain
-
ObjectReaderChain
-
-
Method Details
-
optional
Description copied from interface:ObjectReaderRead an object of Class T from the resource, if present.- Specified by:
optionalin interfaceObjectReader- Throws:
IOException
-
readArray
Description copied from interface:ObjectReaderRead e.g. a JSON (or YAML) [ ... ] array.- Specified by:
readArrayin interfaceObjectReader- Throws:
IOException
-
readStream
Description copied from interface:ObjectReaderRead e.g. a YAML stream. (For formats such as plain JSON which do not directly support a streams syntax, this will always return a single element.)- Specified by:
readStreamin interfaceObjectReader- Throws:
IOException
-