public interface PathPropertySetAdapter
Path expressions to inspect a PropertySet.
The Property definitions of the property set can be inspected and obtained:
Path, checking if a Property implements Path and if its path name corresponds to a
given Path name.Property name (see Property.getName()) to look for a matching property
definition.
A PathPropertySetAdapter.PathConverter and a PathPropertySetAdapter.PathMatcher definition can be provided to the builder API to control and
customize how a Property is converted to a Path and the path name matching strategy to use. See the
PathPropertySetAdapter.Builder API for details.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
PathPropertySetAdapter.Builder<B extends PathPropertySetAdapter.Builder<B,A>,A extends PathPropertySetAdapter>
PathPropertySetAdapter builder. |
static interface |
PathPropertySetAdapter.PathConverter
|
static interface |
PathPropertySetAdapter.PathMatcher
Function to implement a
Path matching strategy. |
static interface |
PathPropertySetAdapter.PathPropertySetAdapterBuilder
Default builder.
|
static interface |
PathPropertySetAdapter.PropertyPath<T>
|
| Modifier and Type | Method and Description |
|---|---|
static PathPropertySetAdapter.PathPropertySetAdapterBuilder |
builder(PropertySet<?> propertySet)
Create a new
PathPropertySetAdapter builder. |
boolean |
contains(Path<?> path)
Return
true if a property which corresponds to given path is available in the property set. |
boolean |
contains(String name)
Checks if a
Property with given name is present in the property set. |
static PathPropertySetAdapter |
create(PropertySet<?> propertySet)
Create a new
PathPropertySetAdapter. |
<T> Optional<Path<T>> |
getPath(Property<T> property)
Check if given
property is available in property set and if it can be represented as a Path. |
Set<Path<?>> |
getPathIdentifiers()
If the property set declares a set of identifiers, and each identifier property can be represented as a
Path, returns the set of identifiers represented as paths. |
<T> Optional<Property<T>> |
getProperty(Path<T> path)
Check if a
Property which corresponds to given path is present in the property set. |
Optional<Property<?>> |
getProperty(String name)
Get the
Property with given name, if available in the property set. |
<T> Optional<Property<T>> |
getProperty(String name,
Class<T> type)
Get the
Property with given name, if available in the property set. |
Stream<String> |
names()
Returns a stream of the
Property names available in the property set. |
Stream<Path<?>> |
paths()
|
Stream<PathPropertySetAdapter.PropertyPath<?>> |
propertyPaths()
Returns a stream of the property set
Property definitions which can be represented as a Path,
providing the corresponding Path representation, using the PathPropertySetAdapter.PropertyPath interface to provide the
Property-Path pairs. |
boolean contains(Path<?> path)
true if a property which corresponds to given path is available in the property set.path - The path to check (not null)true if the property set contains a Property which corresponds to the specified
path, false otherwise<T> Optional<Property<T>> getProperty(Path<T> path)
Property which corresponds to given path is present in the property set.T - Path typepath - The path to check (not null)Property which corresponds to given path is present in the property set,
returns the property. Otherwise an empty Optional is returned.<T> Optional<Path<T>> getPath(Property<T> property)
property is available in property set and if it can be represented as a Path.Set<Path<?>> getPathIdentifiers()
Path, returns the set of identifiers represented as paths.Stream<Path<?>> paths()
Paths, containing the Path representation of all the properties in the
property set which can be represented as a Path.Stream<PathPropertySetAdapter.PropertyPath<?>> propertyPaths()
Property definitions which can be represented as a Path,
providing the corresponding Path representation, using the PathPropertySetAdapter.PropertyPath interface to provide the
Property-Path pairs.PathPropertySetAdapter.PropertyPath elementsboolean contains(String name)
Property with given name is present in the property set.name - Property name (not null)true if a Property with given name is present, false
otherwise<T> Optional<Property<T>> getProperty(String name, Class<T> type)
Property with given name, if available in the property set.T - Property typename - Property name (not null)type - Expected property type (not null)Property with given name, if availableTypeMismatchException - If a property with given name is present but its type is not compatible with the
expected property typeOptional<Property<?>> getProperty(String name)
Property with given name, if available in the property set.name - Property name (not null)Property with given name, if availableStream<String> names()
Property names available in the property set.static PathPropertySetAdapter create(PropertySet<?> propertySet)
PathPropertySetAdapter.propertySet - The property set to use (not null)PathPropertySetAdapterstatic PathPropertySetAdapter.PathPropertySetAdapterBuilder builder(PropertySet<?> propertySet)
PathPropertySetAdapter builder.propertySet - The property set to use (not null)PathPropertySetAdapter builderCopyright © 2019 The Holon Platform. All rights reserved.