Class YamlObjectReaderWriter
java.lang.Object
dev.enola.common.io.object.jackson.YamlObjectReaderWriter
- All Implemented Interfaces:
ObjectReader,ObjectReaderWriter,ObjectWriter
-
Constructor Summary
Constructors -
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.booleanwrite(Object instance, WritableResource resource) 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
readMethods inherited from interface dev.enola.common.io.object.ObjectWriter
write
-
Constructor Details
-
YamlObjectReaderWriter
public YamlObjectReaderWriter() -
YamlObjectReaderWriter
-
-
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
-
write
@CanIgnoreReturnValue public boolean write(Object instance, WritableResource resource) throws IOException - Specified by:
writein interfaceObjectWriter- Throws:
IOException
-