com.holonplatform.core.property

## Interface PropertySet<P extends Property>

- Type Parameters:
    `P` - Concrete type of the properties contained in the set
  All Superinterfaces:
    Iterable<P>
  All Known Subinterfaces:
    BeanPropertySet<T>, PropertyBox

      public interface PropertySet<P extends Property>
      extends Iterable<P>

  This interface represent an `Iterable` and immutable set of `Property`s.
  Since:
    5.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `PropertySet.Builder<P extends Property>` Builder to create `PropertySet` instances.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CONTEXT_KEY` Default `Context` resource reference

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default List<P>` | `asList()` Convert this PropertySet into a `List` of properties.
    `static <P extends Property> PropertySet.Builder<P>` | `builder()` Builder to create and populate a `PropertySet`.
    `boolean` | `contains(Property property)` Return `true` if this set contains the given `property`.
    `default <V> V` | `execute(Callable<V> operation)` Execute given `Callable` `operation` on behalf of this PropertySet, i.e. binding this PropertySet as `Context` resource to current Thread, and removing the binding after operation execution.
    `static <P extends Property> PropertySet<P>` | `join(PropertySet<? extends P>... propertySets)` Join given `PropertySet`s and return a new PropertySet containing all the properties of given sets.
    `static <P extends Property> PropertySet<P>` | `of(Iterable<P> properties)` Create a new PropertySet containing all given `properties` `Iterable` elements.
    `static <P extends Property> PropertySet<P>` | `of(P... properties)` Create a new PropertySet containing given `properties`.
    `static <P extends Property> PropertySet<P>` | `of(PropertySet<? extends P> propertySet, P... properties)` Create a new `PropertySet` joining given `propertySet` with given additional `properties`.
    `int` | `size()` Returns the number of properties in this set.
    `Stream<P>` | `stream()` Returns a sequential `Stream` of the `Property`s of this set.

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, iterator, spliterator`

- - ### Field Detail

    - #### CONTEXT_KEY

          static final String CONTEXT_KEY

      Default `Context` resource reference

  - ### Method Detail

    - #### size

          int size()

      Returns the number of properties in this set. If this set contains more than `Integer.MAX_VALUE` elements, returns `Integer.MAX_VALUE`.
      Returns:
        the number of properties in this set

    - #### contains

          boolean contains(Property property)

      Return `true` if this set contains the given `property`. If the given `property` is `null`, always returns `false`.
      Parameters:
        `property` - Property whose presence in this set is to be tested
      Returns:
        `true` if this set contains the specified property

    - #### stream

          Stream<P> stream()

      Returns a sequential `Stream` of the `Property`s of this set.
      Returns:
        Properties stream

    - #### asList

          default List<P> asList()

      Convert this PropertySet into a `List` of properties.
      Returns:
        List of set properties

    - #### execute

          default <V> V execute(Callable<V> operation)

      Execute given `Callable` `operation` on behalf of this PropertySet, i.e. binding this PropertySet as `Context` resource to current Thread, and removing the binding after operation execution.
      Type Parameters:
        `V` - Operation result type
      Parameters:
        `operation` - Operation to execute
      Returns:
        Operation result

    - #### builder

          static <P extends Property> PropertySet.Builder<P> builder()

      Builder to create and populate a `PropertySet`.
      Type Parameters:
        `P` - Type of the property managed by the property set
      Returns:
        PropertySetBuilder

    - #### of

          @SafeVarargs
          static <P extends Property> PropertySet<P> of(P... properties)

      Create a new PropertySet containing given `properties`.
      Type Parameters:
        `P` - Type of the property managed by the property set
      Parameters:
        `properties` - Properties of the set
      Returns:
        PropertySet instance

    - #### of

          static <P extends Property> PropertySet<P> of(Iterable<P> properties)

      Create a new PropertySet containing all given `properties` `Iterable` elements.
      Type Parameters:
        `P` - Type of the property managed by the property set
      Parameters:
        `properties` - Properties of the set
      Returns:
        PropertySet instance

    - #### of

          @SafeVarargs
          static <P extends Property> PropertySet<P> of(PropertySet<? extends P> propertySet,
                                                                      P... properties)

      Create a new `PropertySet` joining given `propertySet` with given additional `properties`.
      Type Parameters:
        `P` - Property type
      Parameters:
        `propertySet` - Source property set (not null)
        `properties` - Additional properties
      Returns:
        A new `PropertySet` instance containing the properties of given `propertySet` and any additional provided property

    - #### join

          @SafeVarargs
          static <P extends Property> PropertySet<P> join(PropertySet<? extends P>... propertySets)

      Join given `PropertySet`s and return a new PropertySet containing all the properties of given sets.
      Type Parameters:
        `P` - Actual property type
      Parameters:
        `propertySets` - PropertySet to join (not null and not empty)
      Returns:
        New PropertySet containing all the properties of given sets

Copyright © 2017 The Holon Platform. All rights reserved.