Interface BeanBuilder<T extends Bean>

    • Method Detail

      • get

        Object get​(String propertyName)
        Gets the value of a single property previously added to the builder.
        Parameters:
        propertyName - the property name to query, not null
        Returns:
        the previously set value, null if none
        Throws:
        RuntimeException - thrown if the property name is invalid
      • get

        <P> P get​(MetaProperty<P> metaProperty)
        Gets the value of a single property previously added to the builder.
        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
        Throws:
        RuntimeException - thrown if the property is invalid
      • set

        BeanBuilder<T> set​(String propertyName,
                           Object value)
        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.

        Parameters:
        propertyName - the property name to set, not null
        value - the property value, may be null
        Returns:
        this, for chaining, not null
        Throws:
        RuntimeException - optionally thrown if the property name is invalid
      • set

        BeanBuilder<T> set​(MetaProperty<?> metaProperty,
                           Object value)
        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.

        Parameters:
        metaProperty - the meta-property to set, not null
        value - the property value, may be null
        Returns:
        this, for chaining, not null
        Throws:
        RuntimeException - optionally thrown if the property is invalid
      • build

        T build()
        Builds the bean from the state of the builder.

        Once this method has been called, the builder is in an invalid state. The effect of further method calls is undetermined.

        Returns:
        the created bean, not null