Interface BeanBuilder<T extends Bean>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      T build()
      Builds the bean from the state of the builder.
      java.lang.Object get​(java.lang.String propertyName)
      Gets the value of a single property previously added to the builder.
      <P> P get​(MetaProperty<P> metaProperty)
      Gets the value of a single property previously added to the builder.
      BeanBuilder<T> set​(java.lang.String propertyName, java.lang.Object value)
      Sets the value of a single property into the builder.
      BeanBuilder<T> set​(MetaProperty<?> metaProperty, java.lang.Object value)
      Sets the value of a single property into the builder.
    • Method Detail

      • get

        java.lang.Object get​(java.lang.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:
        java.lang.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:
        java.lang.RuntimeException - thrown if the property is invalid
      • set

        BeanBuilder<T> set​(java.lang.String propertyName,
                           java.lang.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:
        java.lang.RuntimeException - optionally thrown if the property name is invalid
      • set

        BeanBuilder<T> set​(MetaProperty<?> metaProperty,
                           java.lang.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:
        java.lang.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