Class RuntimeProperties
java.lang.Object
de.cuioss.test.valueobjects.objects.RuntimeProperties
Aggregates all information necessary to dynamically create Objects. In
addition it makes some sanity checks. It provides some convenience methods
for accessing certain views on the properties.
- Author:
- Oliver Wolff
-
Constructor Summary
ConstructorsConstructorDescriptionRuntimeProperties
(List<? extends PropertyMetadata> properties) Constructor.RuntimeProperties
(SortedSet<PropertyMetadata> properties) -
Method Summary
Modifier and TypeMethodDescriptionasMapView
(boolean generateTestValue) extractNames
(Collection<PropertyMetadata> metadata) Extracts the names of a givenCollection
ofPropertyMetadata
getAdditionalAsPropertySupport
(boolean generateTestValue) getAdditionalAsPropertySupport
(boolean generateTestValue, Collection<String> filter) getAllAsPropertySupport
(boolean generateTestValue) getAllAsPropertySupport
(boolean generateTestValue, Collection<String> filter) Creates a list ofPropertySupport
for eachPropertyMetadata
out of#getAllProperties()
but filtered according to the given names.getDefaultAsPropertySupport
(boolean generateTestValue) getDefaultAsPropertySupport
(boolean generateTestValue, Collection<String> filter) Creates a list ofPropertySupport
for eachPropertyMetadata
out of#getDefaultProperties()
but filtered according to the given names.getRequiredAsPropertySupport
(boolean generateTestValue) getRequiredAsPropertySupport
(boolean generateTestValue, Collection<String> filter) Creates a list ofPropertySupport
for eachPropertyMetadata
out of#getRequiredProperties()
but filtered according to the given names.getWritableAsPropertySupport
(boolean generateTestValue) getWritableAsPropertySupport
(boolean generateTestValue, Collection<String> filter) static List<PropertySupport>
mapToPropertySupport
(Collection<PropertyMetadata> propertyMetadata, boolean generateTestValue) toString()
-
Constructor Details
-
RuntimeProperties
Constructor.- Parameters:
properties
- may be null
-
RuntimeProperties
- Parameters:
properties
-
-
-
Method Details
-
mapToPropertySupport
public static List<PropertySupport> mapToPropertySupport(Collection<PropertyMetadata> propertyMetadata, boolean generateTestValue) - Parameters:
propertyMetadata
- if null or empty an empty list will be returnedgenerateTestValue
- boolean indicating whether to callPropertySupport.generateTestValue()
on each created element- Returns:
- the newly created mutable
List
-
getAllAsPropertySupport
- Parameters:
generateTestValue
- boolean indicating whether to callPropertySupport.generateTestValue()
on each created element- Returns:
- the newly created mutable
List
-
getAllAsPropertySupport
public List<PropertySupport> getAllAsPropertySupport(boolean generateTestValue, Collection<String> filter) Creates a list ofPropertySupport
for eachPropertyMetadata
out of#getAllProperties()
but filtered according to the given names.- Parameters:
generateTestValue
- boolean indicating whether to callPropertySupport.generateTestValue()
on each created elementfilter
- containing the names to be filtered, must not be null- Returns:
- the newly created mutable
List
-
getRequiredAsPropertySupport
- Parameters:
generateTestValue
- boolean indicating whether to callPropertySupport.generateTestValue()
on each created element- Returns:
- the newly created mutable
List
-
getRequiredAsPropertySupport
public List<PropertySupport> getRequiredAsPropertySupport(boolean generateTestValue, Collection<String> filter) Creates a list ofPropertySupport
for eachPropertyMetadata
out of#getRequiredProperties()
but filtered according to the given names.- Parameters:
generateTestValue
- boolean indicating whether to callPropertySupport.generateTestValue()
on each created elementfilter
- containing the names to be filtered, must not be null- Returns:
- the newly created mutable
List
-
getDefaultAsPropertySupport
- Parameters:
generateTestValue
- boolean indicating whether to callPropertySupport.generateTestValue()
on each created element- Returns:
- the newly created mutable
List
-
getDefaultAsPropertySupport
public List<PropertySupport> getDefaultAsPropertySupport(boolean generateTestValue, Collection<String> filter) Creates a list ofPropertySupport
for eachPropertyMetadata
out of#getDefaultProperties()
but filtered according to the given names.- Parameters:
generateTestValue
- boolean indicating whether to callPropertySupport.generateTestValue()
on each created elementfilter
- containing the names to be filtered, must not be null- Returns:
- the newly created mutable
List
-
getAdditionalAsPropertySupport
- Parameters:
generateTestValue
- boolean indicating whether to callPropertySupport.generateTestValue()
on each created element- Returns:
- the newly created mutable
List
-
getAdditionalAsPropertySupport
public List<PropertySupport> getAdditionalAsPropertySupport(boolean generateTestValue, Collection<String> filter) - Parameters:
generateTestValue
- boolean indicating whether to callPropertySupport.generateTestValue()
on each created elementfilter
- containing the names to be filtered, must not be null- Returns:
- the newly created mutable
List
-
getWritableAsPropertySupport
- Parameters:
generateTestValue
- boolean indicating whether to callPropertySupport.generateTestValue()
on each created element- Returns:
- the newly created mutable
List
-
getWritableAsPropertySupport
public List<PropertySupport> getWritableAsPropertySupport(boolean generateTestValue, Collection<String> filter) - Parameters:
generateTestValue
- boolean indicating whether to callPropertySupport.generateTestValue()
on each created elementfilter
- containing the names to be filtered, must not be null- Returns:
- the newly created mutable
List
-
asMapView
- Parameters:
generateTestValue
- boolean indicating whether to callPropertySupport.generateTestValue()
on each created element- Returns:
- a map view on all
PropertyMetadata
asPropertySupport
with the property names as key
-
extractNames
Extracts the names of a givenCollection
ofPropertyMetadata
- Parameters:
metadata
- if it is null or empty an emptySet
will be returned- Returns:
- a set of the extracted names.
-
toString
-