public class PropertiesBasedFileMarshaller<T> extends Object implements FileMarshaller<T>
Constructor and Description |
---|
PropertiesBasedFileMarshaller(PropertiesConverter<T> propsConverter) |
Modifier and Type | Method and Description |
---|---|
void |
marshal(T newValue,
File output)
Marshals the given newValue into a file.
|
T |
unmarshal(File input)
Unmarshals the given file into an instance of T.
|
public PropertiesBasedFileMarshaller(@Nonnull PropertiesConverter<T> propsConverter)
public final void marshal(@Nonnull T newValue, @Nonnull File output) throws IOException
FileMarshaller
marshal
in interface FileMarshaller<T>
newValue
- the value to marshal into the fileoutput
- the destination fileIOException
- if the file does not exist,
is a directory rather than a regular file,
or for some other reason cannot be opened for
reading.public final T unmarshal(@Nonnull File input) throws IOException
FileMarshaller
unmarshal
in interface FileMarshaller<T>
input
- the file to unmarshalIOException
- if the file does not exist,
is a directory rather than a regular file,
or for some other reason cannot be opened for
reading.Copyright © 2020. All Rights Reserved.