public interface BeanPropertyInspector
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.
BeanPropertySet
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> |
getPropertyNumeric(String propertyName)
Get the bean property with given
propertyName as a NumericProperty , if available. |
<N extends Number> |
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)
|
BooleanProperty |
propertyBoolean(String propertyName)
Get the bean property with given
propertyName as a BooleanProperty . |
<N extends Number> |
propertyNumeric(String propertyName)
Get the bean property with given
propertyName as a NumericProperty . |
<N extends Number> |
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.
|
Stream<PathProperty<?>> |
stream()
Get all available bean
PathProperty s as a Stream . |
Stream<PathProperty<?>> stream()
PathProperty
s as a Stream
.boolean contains(String propertyName)
propertyName
is available in this property set.propertyName
- The property name (not null)true
if a property with given propertyName
is available in this property set,
false
otherwise<T> Optional<PathProperty<T>> getProperty(String propertyName)
propertyName
, if available. For nested properties, the default
property name hierarchy notation using Path.PATH_HIERARCHY_SEPARATOR
as separator character is used.T
- Property typepropertyName
- The property name (not null)<T> Optional<PathProperty<T>> getProperty(String propertyName, Class<T> type)
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.T
- Property typepropertyName
- Property name (not null)type
- Expected property type (not null)TypeMismatchException
- If the given type is not consistent with actual property typeOptional<StringProperty> getPropertyString(String propertyName)
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.
propertyName
- The property name (not null)TypeMismatchException
- If the type of the bean property which corresponds to given property name is not
compatible with the required typeOptional<BooleanProperty> getPropertyBoolean(String propertyName)
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.
propertyName
- The property name (not null)TypeMismatchException
- If the type of the bean property which corresponds to given property name is not
compatible with the required type<N extends Number> Optional<NumericProperty<N>> getPropertyNumeric(String propertyName)
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.
N
- Numeric property typepropertyName
- The property name (not null)TypeMismatchException
- If the type of the bean property which corresponds to given property name is not
compatible with the required type<N extends Number> Optional<NumericProperty<N>> getPropertyNumeric(String propertyName, Class<N> type)
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.
N
- Numeric property typepropertyName
- The property name (not null)type
- Expected property type (not null)TypeMismatchException
- If the type of the bean property which corresponds to given property name is not
compatible with the required type<T> Optional<TemporalProperty<T>> getPropertyTemporal(String propertyName)
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.
T
- Temporal property typepropertyName
- The property name (not null)TypeMismatchException
- If the type of the bean property which corresponds to given property name is not
compatible with the required type<T> Optional<TemporalProperty<T>> getPropertyTemporal(String propertyName, Class<T> type)
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.
T
- Temporal property typepropertyName
- The property name (not null)type
- Expected property type (not null)TypeMismatchException
- If the type of the bean property which corresponds to given property name is not
compatible with the required type<T> PathProperty<T> property(String propertyName)
propertyName
.T
- Property typepropertyName
- The property name (not null)Property.PropertyNotFoundException
- If property with given name was not found in bean property set<T> PathProperty<T> property(String propertyName, Class<T> type)
T
- Property typepropertyName
- The property name (not null)type
- Expected property typeProperty.PropertyNotFoundException
- If property with given name was not found in bean property setTypeMismatchException
- If the expected type is not consistent with the actual property typeStringProperty propertyString(String propertyName)
propertyName
as a StringProperty
.
If the bean property which corresponds to given property name is not of String
type, a
TypeMismatchException
is thrown.
propertyName
- The property name (not null)Property.PropertyNotFoundException
- If property with given name was not found in bean property setTypeMismatchException
- If the type of the bean property which corresponds to given property name is not
compatible with the required typeBooleanProperty propertyBoolean(String propertyName)
propertyName
as a BooleanProperty
.
If the bean property which corresponds to given property name is not of Boolean
type, a
TypeMismatchException
is thrown.
propertyName
- The property name (not null)Property.PropertyNotFoundException
- If property with given name was not found in bean property setTypeMismatchException
- If the type of the bean property which corresponds to given property name is not
compatible with the required type<N extends Number> NumericProperty<N> propertyNumeric(String propertyName)
propertyName
as a NumericProperty
.
If the bean property which corresponds to given property name is not of Number
type, a
TypeMismatchException
is thrown.
N
- Numeric property typepropertyName
- The property name (not null)Property.PropertyNotFoundException
- If property with given name was not found in bean property setTypeMismatchException
- If the type of the bean property which corresponds to given property name is not
compatible with the required type<N extends Number> NumericProperty<N> propertyNumeric(String propertyName, Class<N> type)
propertyName
as a NumericProperty
.
If the bean property which corresponds to given property name is not of Number
type, a
TypeMismatchException
is thrown.
N
- Numeric property typepropertyName
- The property name (not null)type
- Expected property type (not null)Property.PropertyNotFoundException
- If property with given name was not found in bean property setTypeMismatchException
- If the type of the bean property which corresponds to given property name is not
compatible with the required type<T> TemporalProperty<T> propertyTemporal(String propertyName)
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.
T
- Temporal property typepropertyName
- The property name (not null)Property.PropertyNotFoundException
- If property with given name was not found in bean property setTypeMismatchException
- If the type of the bean property which corresponds to given property name is not
compatible with the required type<T> TemporalProperty<T> propertyTemporal(String propertyName, Class<T> type)
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.
T
- Temporal property typepropertyName
- The property name (not null)type
- Expected property type (not null)Property.PropertyNotFoundException
- If property with given name was not found in bean property setTypeMismatchException
- If the type of the bean property which corresponds to given property name is not
compatible with the required type@Deprecated default <T> PathProperty<T> requireProperty(String propertyName)
property(String)
propertyName
.T
- Property typepropertyName
- Property name (not null)Property.PropertyNotFoundException
- If property with given name was not found in bean property set@Deprecated default <T> PathProperty<T> requireProperty(String propertyName, Class<T> type)
property(String, Class)
propertyName
and given type
.T
- Property typepropertyName
- Property name (not null)type
- Property typeProperty.PropertyNotFoundException
- If property with given name was not found in bean property setTypeMismatchException
- If the given type is not consistent with actual property typeCopyright © 2019 The Holon Platform. All rights reserved.