Class ZlibCompressor.Builder<B extends ZlibCompressor.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Enclosing class:
ZlibCompressor

public static class ZlibCompressor.Builder<B extends ZlibCompressor.Builder<B>> extends GObject.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public ZlibCompressor build()
      Finish building the ZlibCompressor object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to ZlibCompressor.
      Overrides:
      build in class GObject.Builder<B extends ZlibCompressor.Builder<B>>
      Returns:
      a new instance of ZlibCompressor with the properties that were set in the Builder object.
    • setFileInfo

      public B setFileInfo(FileInfo fileInfo)

      A FileInfo containing file information to put into the gzip header.

      The file name and modification time from the file info will be used.

      This will only be used if non-NULL and Gio.ZlibCompressor:format is Gio.ZlibCompressorFormat.GZIP.

      Parameters:
      fileInfo - the value for the file-info property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.26
    • setFormat

      public B setFormat(ZlibCompressorFormat format)
      The format of the compressed data.
      Parameters:
      format - the value for the format property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.24
    • setLevel

      public B setLevel(int level)

      The level of compression from 0 (no compression) to 9 (most compression).

      -1 for the default level.

      Parameters:
      level - the value for the level property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.24
    • setOs

      public B setOs(int os)

      The OS code of the gzip header.

      This will be used if set to a non-negative value, and if Gio.ZlibCompressor:format is Gio.ZlibCompressorFormat.GZIP, the compressor will set the OS code of the gzip header to this value.

      If the value is unset, zlib will set the OS code depending on the platform. This may be undesirable when reproducible output is desired. In that case setting the OS code to 3 (for Unix) is recommended.

      Parameters:
      os - the value for the os property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.86