public class PropertyHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsPropertyTO(Iterable<StringPropertyTO> properties,
String group,
String key,
String value)
Test whether the provided collection contains the given property and has the provided value
|
static StringPropertyTO |
getPropertyTO(Iterable<StringPropertyTO> properties,
String group,
String key)
Retrieve the identified property from the provided collection or null if it is not contained
|
static <T extends StringProperty> |
nullifyMissingProperties(Iterable<T> source,
Collection<StringPropertyTO> target)
Add for each property of the source collection a property with same group and key and
null as value to the target collection if there is no property with that group
and key in the target collection. |
static Collection<StringPropertyTO> |
nullifyMissingPropertyTOs(Iterable<StringPropertyTO> source,
Collection<StringPropertyTO> target)
Add for each property of the source collection a property with same group and key and
null as value to the target collection if there is no property with that group
and key in the target collection. |
static StringPropertyTO |
removePropertyTO(Iterable<StringPropertyTO> properties,
String group,
String key)
Remove the identified property from the provided collection.
|
public static boolean containsPropertyTO(Iterable<StringPropertyTO> properties, String group, String key, String value)
properties - the properties to searchgroup - the group key of the propertykey - the key of the propertyvalue - the value the property should havepublic static StringPropertyTO getPropertyTO(Iterable<StringPropertyTO> properties, String group, String key)
properties - the properties to searchgroup - the group key of the propertykey - the key of the propertypublic static <T extends StringProperty> Collection<StringPropertyTO> nullifyMissingProperties(Iterable<T> source, Collection<StringPropertyTO> target)
null as value to the target collection if there is no property with that group
and key in the target collection.source - the properties that should be nullified if they are not in the target collection.
Can be null.target - the collection of properties to update. Can be null.public static Collection<StringPropertyTO> nullifyMissingPropertyTOs(Iterable<StringPropertyTO> source, Collection<StringPropertyTO> target)
null as value to the target collection if there is no property with that group
and key in the target collection.source - the properties that should be nullified if they are not in the target collection.
Can be null.target - the collection of properties to update. Can be null.public static StringPropertyTO removePropertyTO(Iterable<StringPropertyTO> properties, String group, String key)
properties - the properties to searchgroup - the group key of the propertykey - the key of the propertyCopyright © 2019 Communote team. All rights reserved.