Interface IOStreamConfigurationStore<T>

Type Parameters:
T - the configuration type

public interface IOStreamConfigurationStore<T>
Instances of this class read and write configurations from input streams and to output streams, respectively.

The details of how configurations are serialized and deserialized are defined by the implementations of this interface.

  • Method Summary

    Modifier and Type
    Method
    Description
    read(InputStream inputStream)
    Reads a configuration from the given input stream.
    void
    write(T configuration, OutputStream outputStream)
    Writes a configuration instance to the given output stream.
  • Method Details

    • write

      void write(T configuration, OutputStream outputStream)
      Writes a configuration instance to the given output stream.
      Parameters:
      configuration - the configuration
      outputStream - the output stream the configuration is written to
      Throws:
      ConfigurationException - if the configuration contains invalid values or cannot be serialized
      NullPointerException - if any argument is null
      RuntimeException - if writing the configuration throws an exception
    • read

      T read(InputStream inputStream)
      Reads a configuration from the given input stream.
      Parameters:
      inputStream - the input stream the configuration is read from
      Returns:
      a newly created configuration initialized with values read from inputStream
      Throws:
      ConfigurationException - if the configuration cannot be deserialized
      NullPointerException - if inputStream is null
      RuntimeException - if reading the input stream throws an exception