Class DirectFieldsBeanBuilder<T extends Bean>

  • Type Parameters:
    T - the bean type
    All Implemented Interfaces:
    BeanBuilder<T>

    public abstract class DirectFieldsBeanBuilder<T extends Bean>
    extends Object
    implements BeanBuilder<T>
    A builder implementation designed for use by the code generator.

    This implementation is intended to have fields generated in the subclass.

    • Constructor Detail

      • DirectFieldsBeanBuilder

        protected DirectFieldsBeanBuilder()
        Constructs the builder.
    • Method Detail

      • get

        public Object get​(String propertyName)
        Description copied from interface: BeanBuilder
        Gets the value of a single property previously added to the builder.
        Specified by:
        get in interface BeanBuilder<T extends Bean>
        Parameters:
        propertyName - the property name to query, not null
        Returns:
        the previously set value, null if none
      • get

        public <P> P get​(MetaProperty<P> metaProperty)
        Description copied from interface: BeanBuilder
        Gets the value of a single property previously added to the builder.
        Specified by:
        get in interface BeanBuilder<T extends Bean>
        Type Parameters:
        P - the type of the property.
        Parameters:
        metaProperty - the meta-property to query, not null
        Returns:
        the previously set value, null if none
      • set

        public BeanBuilder<T> set​(MetaProperty<?> metaProperty,
                                  Object value)
        Description copied from interface: BeanBuilder
        Sets the value of a single property into the builder.

        This will normally behave as per a Map, however it may not and as a general rule callers should only set each property once.

        Specified by:
        set in interface BeanBuilder<T extends Bean>
        Parameters:
        metaProperty - the meta-property to set, not null
        value - the property value, may be null
        Returns:
        this, for chaining, not null
      • toString

        public String toString()
        Returns a string that summarises the builder.
        Overrides:
        toString in class Object
        Returns:
        a summary string, not null