com.holonplatform.core.property

## Interface PropertyBox.Builder

- Enclosing interface:
    PropertyBox

      public static interface PropertyBox.Builder

  Builder to build `PropertyBox` instances.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `PropertyBox` | `build()` Build the `PropertyBox`
    `PropertyBox.Builder` | `copyValues(PropertyBox source)` Copy the given `propertyBox` property values only for properties of the source PropertyBox that have a matching with a property of the PropertyBox to build
    `PropertyBox.Builder` | `equalsHandler(EqualsHandler<PropertyBox> equalsHandler)` Set the predicate to use to check the `PropertyBox` object equality using the `Object.equals(Object)` method.
    `PropertyBox.Builder` | `hashCodeProvider(HashCodeProvider<PropertyBox> hashCodeProvider)` Set the function to use to provide the `PropertyBox` object hash code using the `Object.hashCode()` method.
    `PropertyBox.Builder` | `invalidAllowed(boolean invalidAllowed)` Set whether to accept invalid property values when using `PropertyBox.setValue(Property, Object)` to set a property value, i.e. to ignore any `Validator` registered for property.
    `<T> PropertyBox.Builder` | `set(Property<T> property, T value)` Set value of given `property`.
    `<T> PropertyBox.Builder` | `setIgnoreReadOnly(Property<T> property, T value)` Set value of given `property`, ignoring property read-only state.

- - ### Method Detail

    - #### invalidAllowed

          PropertyBox.Builder invalidAllowed(boolean invalidAllowed)

      Set whether to accept invalid property values when using `PropertyBox.setValue(Property, Object)` to set a property value, i.e. to ignore any `Validator` registered for property. If invalid values are not allowed and any property `Validator` do not validate the value, a `Validator.ValidationException` is thrown by `PropertyBox.setValue(Property, Object)`.
      Parameters:
        `invalidAllowed` - `true` to accept invalid property values (ignore validators), `false` otherwise
      Returns:
        this

    - #### equalsHandler

          PropertyBox.Builder equalsHandler(EqualsHandler<PropertyBox> equalsHandler)

      Set the predicate to use to check the `PropertyBox` object equality using the `Object.equals(Object)` method.

      By default, `PropertyBox` objects equality is checked using the property set identifier property values, if available.

      If a custom `equals` handler is provided, a `hashCode` provider should be provided too, using the `hashCodeProvider(HashCodeProvider)` builder mthod.

      Parameters:
        `equalsHandler` - The function to use to check `PropertyBox` object equality
      Returns:
        this
      See Also:
        `PropertySet.getIdentifiers()`

    - #### hashCodeProvider

          PropertyBox.Builder hashCodeProvider(HashCodeProvider<PropertyBox> hashCodeProvider)

      Set the function to use to provide the `PropertyBox` object hash code using the `Object.hashCode()` method.

      By default, `PropertyBox` objects hash code is calculated using the property set identifier property values, if available.

      Parameters:
        `hashCodeProvider` - The function to use to provide the `PropertyBox` object hash code
      Returns:
        this
      See Also:
        `PropertySet.getIdentifiers()`

    - #### set

          <T> PropertyBox.Builder set(Property<T> property,
                                      T value)

      Set value of given `property`. Value type must be consistent with declared `Property` type.
      Type Parameters:
        `T` - Property type
      Parameters:
        `property` - Property for which to set the value (not null)
        `value` - Value to set
      Returns:
        this

    - #### setIgnoreReadOnly

          <T> PropertyBox.Builder setIgnoreReadOnly(Property<T> property,
                                                    T value)

      Set value of given `property`, ignoring property read-only state.
      Type Parameters:
        `T` - Property type
      Parameters:
        `property` - Property for which to set the value (not null)
        `value` - Value to set
      Returns:
        this

    - #### copyValues

          PropertyBox.Builder copyValues(PropertyBox source)

      Copy the given `propertyBox` property values only for properties of the source PropertyBox that have a matching with a property of the PropertyBox to build
      Parameters:
        `source` - PropertyBox from which to copy the values
      Returns:
        this

    - #### build

          PropertyBox build()

      Build the `PropertyBox`
      Returns:
        PropertyBox instance

Copyright © 2019 The Holon Platform. All rights reserved.