Class DefaultComponentBuilder<T extends ComponentBuilder<T>,​CB extends ConfigurationBuilder<? extends Configuration>>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​java.lang.String> attributes  
      private CB builder  
      private java.util.List<Component> components  
      private java.lang.String name  
      private java.lang.String type  
      private java.lang.String value  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T addAttribute​(java.lang.String key, boolean value)
      Adds a boolean attribute.
      T addAttribute​(java.lang.String key, int value)
      Adds an integer attribute.
      T addAttribute​(java.lang.String key, java.lang.Enum<?> value)
      Adds an enumeration attribute.
      T addAttribute​(java.lang.String key, java.lang.Object value)
      Adds an Object attribute.
      T addAttribute​(java.lang.String key, java.lang.String value)
      Adds a String attribute.
      T addAttribute​(java.lang.String key, Level level)
      Adds a logging Level attribute.
      T addComponent​(ComponentBuilder<?> builder)
      Adds a sub component.
      Component build()
      Builds the object after all configuration has been set.
      CB getBuilder()
      Retrieves the ConfigurationBuilder.
      java.lang.String getName()
      Returns the name of the component, if any.
      protected T put​(java.lang.String key, java.lang.String value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • type

        private final java.lang.String type
      • attributes

        private final java.util.Map<java.lang.String,​java.lang.String> attributes
      • components

        private final java.util.List<Component> components
      • name

        private final java.lang.String name
      • value

        private final java.lang.String value
    • Constructor Detail

      • DefaultComponentBuilder

        public DefaultComponentBuilder​(CB builder,
                                       java.lang.String type)
      • DefaultComponentBuilder

        public DefaultComponentBuilder​(CB builder,
                                       java.lang.String name,
                                       java.lang.String type)
      • DefaultComponentBuilder

        public DefaultComponentBuilder​(CB builder,
                                       java.lang.String name,
                                       java.lang.String type,
                                       java.lang.String value)
    • Method Detail

      • addAttribute

        public T addAttribute​(java.lang.String key,
                              boolean value)
        Description copied from interface: ComponentBuilder
        Adds a boolean attribute.
        Specified by:
        addAttribute in interface ComponentBuilder<T extends ComponentBuilder<T>>
        Parameters:
        key - The attribute key.
        value - The boolean value.
        Returns:
        This ComponentBuilder.
      • addAttribute

        public T addAttribute​(java.lang.String key,
                              java.lang.Enum<?> value)
        Description copied from interface: ComponentBuilder
        Adds an enumeration attribute.
        Specified by:
        addAttribute in interface ComponentBuilder<T extends ComponentBuilder<T>>
        Parameters:
        key - The attribute key.
        value - The enumeration.
        Returns:
        This ComponentBuilder.
      • addAttribute

        public T addAttribute​(java.lang.String key,
                              int value)
        Description copied from interface: ComponentBuilder
        Adds an integer attribute.
        Specified by:
        addAttribute in interface ComponentBuilder<T extends ComponentBuilder<T>>
        Parameters:
        key - The attribute key.
        value - The integer value.
        Returns:
        This ComponentBuilder.
      • addAttribute

        public T addAttribute​(java.lang.String key,
                              Level level)
        Description copied from interface: ComponentBuilder
        Adds a logging Level attribute.
        Specified by:
        addAttribute in interface ComponentBuilder<T extends ComponentBuilder<T>>
        Parameters:
        key - The attribute key.
        level - The logging Level.
        Returns:
        This ComponentBuilder.
      • addAttribute

        public T addAttribute​(java.lang.String key,
                              java.lang.Object value)
        Description copied from interface: ComponentBuilder
        Adds an Object attribute.
        Specified by:
        addAttribute in interface ComponentBuilder<T extends ComponentBuilder<T>>
        Parameters:
        key - The attribute key.
        value - The object value.
        Returns:
        This ComponentBuilder.
      • addAttribute

        public T addAttribute​(java.lang.String key,
                              java.lang.String value)
        Description copied from interface: ComponentBuilder
        Adds a String attribute.
        Specified by:
        addAttribute in interface ComponentBuilder<T extends ComponentBuilder<T>>
        Parameters:
        key - The attribute key.
        value - The value of the attribute.
        Returns:
        This ComponentBuilder.
      • addComponent

        public T addComponent​(ComponentBuilder<?> builder)
        Description copied from interface: ComponentBuilder
        Adds a sub component.
        Specified by:
        addComponent in interface ComponentBuilder<T extends ComponentBuilder<T>>
        Parameters:
        builder - The Assembler for the subcomponent with all of its attributes and sub-components set.
        Returns:
        This ComponentBuilder (not the argument).
      • build

        public Component build()
        Description copied from interface: Builder
        Builds the object after all configuration has been set. This will use default values for any unspecified attributes for the object.
        Specified by:
        build in interface Builder<T extends ComponentBuilder<T>>
        Returns:
        the configured instance.
      • getName

        public java.lang.String getName()
        Description copied from interface: ComponentBuilder
        Returns the name of the component, if any.
        Specified by:
        getName in interface ComponentBuilder<T extends ComponentBuilder<T>>
        Returns:
        The components name or null if it doesn't have one.
      • put

        protected T put​(java.lang.String key,
                        java.lang.String value)