Class GlcdConfigBuilder


  • public class GlcdConfigBuilder
    extends java.lang.Object
    Utility class for building GlcdConfig instances
    Author:
    Rafael Ibasco
    • Method Detail

      • create

        public static GlcdConfigBuilder create​(GlcdDisplay display,
                                               GlcdCommProtocol busInterface)
        Factory method for creating a new instance of this class together with it's required parameters.
        Parameters:
        display - The matching GlcdDisplay of your display device.
        busInterface - The bus interface to be used for communication for your display device.
        Returns:
        A new instance of GlcdConfigBuilder
      • option

        public <T> GlcdConfigBuilder option​(GlcdOption<T> option,
                                            T value)
        Adds a new configuration option for the display controller. Existing option entries are replaced.
        Type Parameters:
        T - Capture of the GlcdOption type.
        Parameters:
        option - The display configuration option.
        value - The value of the configuration option. If null is provided, the option would be deleted from the underlying map.
        Returns:
        This instance
        See Also:
        GlcdOption
      • options

        public GlcdConfigBuilder options​(java.util.Map<GlcdOption<?>,​java.lang.Object> options)
        Copies the provided map to this instance. Existing entries are retained but duplicate entries would be overwritten.
        Parameters:
        options - The options map to copy
        Returns:
        This instance
      • options

        public GlcdConfigBuilder options​(java.util.Map<GlcdOption<?>,​java.lang.Object> options,
                                         boolean clearEntries)
        Copies the provided map to this instance.
        Parameters:
        options - The options map to copy
        clearEntries - Clears the map and overwrites all existing entries
        Returns:
        This instance
      • option

        public <T> GlcdConfigBuilder option​(java.lang.String option,
                                            T value)
        Adds a new configuration option for the display controller. This is similar to option(GlcdOption, Object) but this accepts a String value as key, allowing you to provide other values.
        Type Parameters:
        T - The captured type of the configuration option value
        Parameters:
        option - The name/key of the configuration option.
        value - The value of the configuration option.
        Returns:
        This instance
        See Also:
        GlcdOption
      • pinMap

        public GlcdConfigBuilder pinMap​(GlcdPinMapConfig pinmap)
        Set a pin map configuration to be used by the display controller.
        Parameters:
        pinmap - The pin map configuration
        Returns:
        This instance
        See Also:
        GlcdPin
      • build

        public GlcdConfig build()
        Builds a GlcdConfig instance containing all the provided configuration options.
        Returns:
        The GlcdConfig to be used by U8g2