Class YamlWriter<T>
- java.lang.Object
-
- dev.aherscu.qa.testing.extra.yaml.YamlWriter<T>
-
- Type Parameters:
T
- the type to write
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class YamlWriter<T> extends Object
Wraps theYamlWriter
in order to implementCloseable
.- Author:
- aherscu
-
-
Field Summary
Fields Modifier and Type Field Description protected T
yamlStream
-
Constructor Summary
Constructors Constructor Description YamlWriter(File file)
Creates a YAML writer based on a supplied file; you should callCloseable.close()
in order to release it.YamlWriter(Writer writer)
-
-
-
Constructor Detail
-
YamlWriter
public YamlWriter(File file) throws IOException
Creates a YAML writer based on a supplied file; you should callCloseable.close()
in order to release it.- Parameters:
file
- the file- Throws:
IOException
- if failed to write to file
-
YamlWriter
public YamlWriter(Writer writer)
- Parameters:
writer
- the writer- See Also:
YamlWriter(Writer)
-
-
Method Detail
-
write
public void write(T object) throws com.esotericsoftware.yamlbeans.YamlException
- Parameters:
object
- the type to read- Throws:
com.esotericsoftware.yamlbeans.YamlException
- if anything fails- See Also:
YamlWriter.write(Object)
-
close
public final void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-