com.holonplatform.core.beans

## Interface BeanPropertyInspector

- All Known Subinterfaces:
    BeanPropertySet<T>

      public interface BeanPropertyInspector

  Interface to obtain bean property references as `PathProperty` from a bean property set.

  Bean properties are accessed by name. For nested properties, the default property name hierarchy notation using `Path.PATH_HIERARCHY_SEPARATOR` as separator character is used.

  Since:
    5.1.0
  See Also:
    `BeanPropertySet`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `contains(String propertyName)` Gets whether a property with given `propertyName` is available in this property set.
    `<T> Optional<PathProperty<T>>` | `getProperty(String propertyName)` Get the bean property with given `propertyName`, if available.
    `<T> Optional<PathProperty<T>>` | `getProperty(String propertyName, Class<T> type)` Get the bean property with given `propertyName` and given `type`, if available.
    `Optional<BooleanProperty>` | `getPropertyBoolean(String propertyName)` Get the bean property with given `propertyName` as a `BooleanProperty`, if available.
    `<N extends Number> Optional<NumericProperty<N>>` | `getPropertyNumeric(String propertyName)` Get the bean property with given `propertyName` as a `NumericProperty`, if available.
    `<N extends Number> Optional<NumericProperty<N>>` | `getPropertyNumeric(String propertyName, Class<N> type)` Get the bean property with given `propertyName` as a `NumericProperty`, if available.
    `Optional<StringProperty>` | `getPropertyString(String propertyName)` Get the bean property with given `propertyName` as a `StringProperty`, if available.
    `<T> Optional<TemporalProperty<T>>` | `getPropertyTemporal(String propertyName)` Get the bean property with given `propertyName` as a `TemporalProperty`, if available.
    `<T> Optional<TemporalProperty<T>>` | `getPropertyTemporal(String propertyName, Class<T> type)` Get the bean property with given `propertyName` as a `TemporalProperty`, if available.
    `<T> PathProperty<T>` | `property(String propertyName)` Get the bean property with given `propertyName`.
    `<T> PathProperty<T>` | `property(String propertyName, Class<T> type)` Get the bean property with given `propertyName` as a `PathProperty` of given `type`.
    `BooleanProperty` | `propertyBoolean(String propertyName)` Get the bean property with given `propertyName` as a `BooleanProperty`.
    `<N extends Number> NumericProperty<N>` | `propertyNumeric(String propertyName)` Get the bean property with given `propertyName` as a `NumericProperty`.
    `<N extends Number> NumericProperty<N>` | `propertyNumeric(String propertyName, Class<N> type)` Get the bean property with given `propertyName` as a `NumericProperty`.
    `StringProperty` | `propertyString(String propertyName)` Get the bean property with given `propertyName` as a `StringProperty`.
    `<T> TemporalProperty<T>` | `propertyTemporal(String propertyName)` Get the bean property with given `propertyName` as a `TemporalProperty`.
    `<T> TemporalProperty<T>` | `propertyTemporal(String propertyName, Class<T> type)` Get the bean property with given `propertyName` as a `TemporalProperty`.
    `default <T> PathProperty<T>` | `requireProperty(String propertyName)` Deprecated. Use `property(String)`
    `default <T> PathProperty<T>` | `requireProperty(String propertyName, Class<T> type)` Deprecated. Use `property(String, Class)`
    `Stream<PathProperty<?>>` | `stream()` Get all available bean `PathProperty`s as a `Stream`.

- - ### Method Detail

    - #### stream

          Stream<PathProperty<?>> stream()

      Get all available bean `PathProperty`s as a `Stream`.
      Returns:
        All available bean properties stream

    - #### contains

          boolean contains(String propertyName)

      Gets whether a property with given `propertyName` is available in this property set.
      Parameters:
        `propertyName` - The property name (not null)
      Returns:
        `true` if a property with given `propertyName` is available in this property set, `false` otherwise

    - #### getProperty

          <T> Optional<PathProperty<T>> getProperty(String propertyName)

      Get the bean property with given `propertyName`, if available. For nested properties, the default property name hierarchy notation using `Path.PATH_HIERARCHY_SEPARATOR` as separator character is used.
      Type Parameters:
        `T` - Property type
      Parameters:
        `propertyName` - The property name (not null)
      Returns:
        The bean property with given name, or an empty Optional if not found

    - #### getProperty

          <T> Optional<PathProperty<T>> getProperty(String propertyName,
                                                    Class<T> type)

      Get the bean property with given `propertyName` and given `type`, if available. For nested properties, the default property name hierarchy notation using `Path.PATH_HIERARCHY_SEPARATOR` as separator character is used.
      Type Parameters:
        `T` - Property type
      Parameters:
        `propertyName` - Property name (not null)
        `type` - Expected property type (not null)
      Returns:
        The bean property with given name, or an empty Optional if not found
      Throws:
        `TypeMismatchException` - If the given type is not consistent with actual property type

    - #### getPropertyString

          Optional<StringProperty> getPropertyString(String propertyName)

      Get the bean property with given `propertyName` as a `StringProperty`, if available.

      If the bean property which corresponds to given property name is not of `String` type, a `TypeMismatchException` is thrown.

      Parameters:
        `propertyName` - The property name (not null)
      Returns:
        The bean property with given name, if available
      Throws:
        `TypeMismatchException` - If the type of the bean property which corresponds to given property name is not compatible with the required type

    - #### getPropertyBoolean

          Optional<BooleanProperty> getPropertyBoolean(String propertyName)

      Get the bean property with given `propertyName` as a `BooleanProperty`, if available.

      If the bean property which corresponds to given property name is not of `Boolean` type, a `TypeMismatchException` is thrown.

      Parameters:
        `propertyName` - The property name (not null)
      Returns:
        The bean property with given name, if available
      Throws:
        `TypeMismatchException` - If the type of the bean property which corresponds to given property name is not compatible with the required type

    - #### getPropertyNumeric

          <N extends Number> Optional<NumericProperty<N>> getPropertyNumeric(String propertyName)

      Get the bean property with given `propertyName` as a `NumericProperty`, if available.

      If the bean property which corresponds to given property name is not of `Number` type, a `TypeMismatchException` is thrown.

      Type Parameters:
        `N` - Numeric property type
      Parameters:
        `propertyName` - The property name (not null)
      Returns:
        The bean property with given name, if available
      Throws:
        `TypeMismatchException` - If the type of the bean property which corresponds to given property name is not compatible with the required type

    - #### getPropertyNumeric

          <N extends Number> Optional<NumericProperty<N>> getPropertyNumeric(String propertyName,
                                                                             Class<N> type)

      Get the bean property with given `propertyName` as a `NumericProperty`, if available.

      If the bean property which corresponds to given property name is not of `Number` type, a `TypeMismatchException` is thrown.

      Type Parameters:
        `N` - Numeric property type
      Parameters:
        `propertyName` - The property name (not null)
        `type` - Expected property type (not null)
      Returns:
        The bean property with given name, if available
      Throws:
        `TypeMismatchException` - If the type of the bean property which corresponds to given property name is not compatible with the required type

    - #### getPropertyTemporal

          <T> Optional<TemporalProperty<T>> getPropertyTemporal(String propertyName)

      Get the bean property with given `propertyName` as a `TemporalProperty`, if available.

      If the bean property which corresponds to given property name is not of temporal type, a `TypeMismatchException` is thrown. Temporal type include `Date` types and `Temporal` types.

      Type Parameters:
        `T` - Temporal property type
      Parameters:
        `propertyName` - The property name (not null)
      Returns:
        The bean property with given name, if available
      Throws:
        `TypeMismatchException` - If the type of the bean property which corresponds to given property name is not compatible with the required type

    - #### getPropertyTemporal

          <T> Optional<TemporalProperty<T>> getPropertyTemporal(String propertyName,
                                                                Class<T> type)

      Get the bean property with given `propertyName` as a `TemporalProperty`, if available.

      If the bean property which corresponds to given property name is not of temporal type, a `TypeMismatchException` is thrown. Temporal type include `Date` types and `Temporal` types.

      Type Parameters:
        `T` - Temporal property type
      Parameters:
        `propertyName` - The property name (not null)
        `type` - Expected property type (not null)
      Returns:
        The bean property with given name, if available
      Throws:
        `TypeMismatchException` - If the type of the bean property which corresponds to given property name is not compatible with the required type

    - #### property

          <T> PathProperty<T> property(String propertyName)

      Get the bean property with given `propertyName`.
      Type Parameters:
        `T` - Property type
      Parameters:
        `propertyName` - The property name (not null)
      Returns:
        The bean property with given name, or an empty Optional if not found
      Throws:
        `Property.PropertyNotFoundException` - If property with given name was not found in bean property set

    - #### property

          <T> PathProperty<T> property(String propertyName,
                                       Class<T> type)

      Get the bean property with given `propertyName` as a `PathProperty` of given `type`.
      Type Parameters:
        `T` - Property type
      Parameters:
        `propertyName` - The property name (not null)
        `type` - Expected property type
      Returns:
        The bean property with given name, or an empty Optional if not found
      Throws:
        `Property.PropertyNotFoundException` - If property with given name was not found in bean property set
        `TypeMismatchException` - If the expected type is not consistent with the actual property type

    - #### propertyString

          StringProperty propertyString(String propertyName)

      Get the bean property with given `propertyName` as a `StringProperty`.

      If the bean property which corresponds to given property name is not of `String` type, a `TypeMismatchException` is thrown.

      Parameters:
        `propertyName` - The property name (not null)
      Returns:
        The bean property with given name
      Throws:
        `Property.PropertyNotFoundException` - If property with given name was not found in bean property set
        `TypeMismatchException` - If the type of the bean property which corresponds to given property name is not compatible with the required type

    - #### propertyBoolean

          BooleanProperty propertyBoolean(String propertyName)

      Get the bean property with given `propertyName` as a `BooleanProperty`.

      If the bean property which corresponds to given property name is not of `Boolean` type, a `TypeMismatchException` is thrown.

      Parameters:
        `propertyName` - The property name (not null)
      Returns:
        The bean property with given name
      Throws:
        `Property.PropertyNotFoundException` - If property with given name was not found in bean property set
        `TypeMismatchException` - If the type of the bean property which corresponds to given property name is not compatible with the required type

    - #### propertyNumeric

          <N extends Number> NumericProperty<N> propertyNumeric(String propertyName)

      Get the bean property with given `propertyName` as a `NumericProperty`.

      If the bean property which corresponds to given property name is not of `Number` type, a `TypeMismatchException` is thrown.

      Type Parameters:
        `N` - Numeric property type
      Parameters:
        `propertyName` - The property name (not null)
      Returns:
        The bean property with given name
      Throws:
        `Property.PropertyNotFoundException` - If property with given name was not found in bean property set
        `TypeMismatchException` - If the type of the bean property which corresponds to given property name is not compatible with the required type

    - #### propertyNumeric

          <N extends Number> NumericProperty<N> propertyNumeric(String propertyName,
                                                                Class<N> type)

      Get the bean property with given `propertyName` as a `NumericProperty`.

      If the bean property which corresponds to given property name is not of `Number` type, a `TypeMismatchException` is thrown.

      Type Parameters:
        `N` - Numeric property type
      Parameters:
        `propertyName` - The property name (not null)
        `type` - Expected property type (not null)
      Returns:
        The bean property with given name
      Throws:
        `Property.PropertyNotFoundException` - If property with given name was not found in bean property set
        `TypeMismatchException` - If the type of the bean property which corresponds to given property name is not compatible with the required type

    - #### propertyTemporal

          <T> TemporalProperty<T> propertyTemporal(String propertyName)

      Get the bean property with given `propertyName` as a `TemporalProperty`.

      If the bean property which corresponds to given property name is not of temporal type, a `TypeMismatchException` is thrown. Temporal type include `Date` types and `Temporal` types.

      Type Parameters:
        `T` - Temporal property type
      Parameters:
        `propertyName` - The property name (not null)
      Returns:
        The bean property with given name
      Throws:
        `Property.PropertyNotFoundException` - If property with given name was not found in bean property set
        `TypeMismatchException` - If the type of the bean property which corresponds to given property name is not compatible with the required type

    - #### propertyTemporal

          <T> TemporalProperty<T> propertyTemporal(String propertyName,
                                                   Class<T> type)

      Get the bean property with given `propertyName` as a `TemporalProperty`.

      If the bean property which corresponds to given property name is not of temporal type, a `TypeMismatchException` is thrown. Temporal type include `Date` types and `Temporal` types.

      Type Parameters:
        `T` - Temporal property type
      Parameters:
        `propertyName` - The property name (not null)
        `type` - Expected property type (not null)
      Returns:
        The bean property with given name
      Throws:
        `Property.PropertyNotFoundException` - If property with given name was not found in bean property set
        `TypeMismatchException` - If the type of the bean property which corresponds to given property name is not compatible with the required type

    - #### requireProperty

          @Deprecated
          default <T> PathProperty<T> requireProperty(String propertyName)

      Deprecated. Use `property(String)`
      Get the bean property with given `propertyName`.
      Type Parameters:
        `T` - Property type
      Parameters:
        `propertyName` - Property name (not null)
      Returns:
        The bean property with given name
      Throws:
        `Property.PropertyNotFoundException` - If property with given name was not found in bean property set

    - #### requireProperty

          @Deprecated
          default <T> PathProperty<T> requireProperty(String propertyName,
                                                                   Class<T> type)

      Deprecated. Use `property(String, Class)`
      Get the bean property with given `propertyName` and given `type`.
      Type Parameters:
        `T` - Property type
      Parameters:
        `propertyName` - Property name (not null)
        `type` - Property type
      Returns:
        The bean property with given name
      Throws:
        `Property.PropertyNotFoundException` - If property with given name was not found in bean property set
        `TypeMismatchException` - If the given type is not consistent with actual property type

Copyright © 2019 The Holon Platform. All rights reserved.