Class BitspeakConfig.Builder

  • Enclosing class:
    BitspeakConfig

    public static class BitspeakConfig.Builder
    extends Object
    Represents a builder of bitspeak configuration instances.
    • Constructor Detail

      • Builder

        public Builder()
        Construct a new builder of bitspeak configuration instances.

        The builder is initialized to the default values.

      • Builder

        public Builder​(BitspeakConfig template)
        Construct a new builder of bitspeak configuration instances, initialized as a copy of the given configuration-
        Parameters:
        template - the configuration to copy, or NULL to use default values.
    • Method Detail

      • withMaxWordSize

        public BitspeakConfig.Builder withMaxWordSize​(int maxWordSize)
        Set the maximum number of characters the encoder will output in each word.
        Parameters:
        maxWordSize - the new maximum number of characters, or -1 if infinite.
        Returns:
        This builder, for chaining.
      • withWordDelimiter

        public BitspeakConfig.Builder withWordDelimiter​(CharSequence wordDelimiter)
        Set the the delimiter inserted between each line by the encoder.
        Parameters:
        wordDelimiter - the new word delimiter.
        Returns:
        This builder, for chaining.
      • withMaxLineSize

        public BitspeakConfig.Builder withMaxLineSize​(int maxLineSize)
        Set the the maximum number of characters, including delimiters, the encoder will output in each encoded line.
        Parameters:
        maxLineSize - the new maximum length of encoded lines, or -1 if infinite.
        Returns:
        This builder, for chaining.
      • withLineDelimiter

        public BitspeakConfig.Builder withLineDelimiter​(CharSequence lineDelimiter)
        Set the the delimiter inserted between each line by the encoder.
        Parameters:
        lineDelimiter - the new word delimiter.
        Returns:
        This builder, for chaining.
      • withSkipCharPredicate

        public BitspeakConfig.Builder withSkipCharPredicate​(CharPredicate skipCharPredicate)
        Set the predicate that matches characters that will be silently skipped by the decoder.
        Parameters:
        skipCharPredicate - the new predicate matching characters that will be skipped. Cannot be NULL.
        Returns:
        This builder, for chaining.
      • build

        public BitspeakConfig build()
        Construct a new bitspeak configuration instance, using the values in this builder.
        Returns:
        The new configuration instance.