Package org.aksw.commons.accessors
Interface PropertySource
- All Known Implementing Classes:
PropertySourcePrefix
public interface PropertySource
This class is similar to the spring PropertySource - except that it allows setting properties as well.
A simple interface to resolve properties by name, value type and value multiplicity (single or multi).
- Author:
- raven Apr 10, 2018
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> SingleValuedAccessor<Collection<T>>getCollectionProperty(String name, Class<T> itemType) Retrieve an accessor to a multi valued collection<T> SingleValuedAccessor<T>getProperty(String name, Class<T> valueType) default <T> CollectionAccessor<T>getPropertyAsSet(String name, Class<T> itemType) Retrieves a single valued property and wraps it as a set with at most 1 item.
-
Method Details
-
getSource
Object getSource() -
getProperty
-
getCollectionProperty
default <T> SingleValuedAccessor<Collection<T>> getCollectionProperty(String name, Class<T> itemType) Retrieve an accessor to a multi valued collection- Parameters:
name-itemType-- Returns:
-
getPropertyAsSet
Retrieves a single valued property and wraps it as a set with at most 1 item. Removing the item from the set is equivalent to setting the property to null.- Parameters:
name-itemType-- Returns:
-