Package uk.gov.gchq.gaffer.data.element
Class LazyProperties
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<String,Object>
-
- uk.gov.gchq.gaffer.data.element.Properties
-
- uk.gov.gchq.gaffer.data.element.LazyProperties
-
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,Object>
public class LazyProperties extends Properties
LazyPropertieswrapsPropertiesand lazily loads property values when requested using a providedElementValueLoader.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description LazyProperties(Properties properties, ElementValueLoader valueLoader)Constructs a by wrapping the providedPropertiesand using theElementValueLoaderto lazily load the property values when requested.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()LazyPropertiesclone()booleancontainsKey(Object key)booleancontainsValue(Object value)Set<Map.Entry<String,Object>>entrySet()booleanequals(Object obj)Objectget(Object name)Objectget(String name)PropertiesgetProperties()inthashCode()booleanisEmpty()voidkeepOnly(Collection<String> propertiesToKeep)Removes all properties with names that are not in the provided set.Set<String>keySet()Objectput(String name, Object property)voidputAll(Map<? extends String,?> newProperties)Objectremove(Object name)voidremove(Collection<String> propertiesToRemove)intsize()Collection<Object>values()-
Methods inherited from class uk.gov.gchq.gaffer.data.element.Properties
toString
-
Methods inherited from class java.util.HashMap
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Constructor Detail
-
LazyProperties
public LazyProperties(Properties properties, ElementValueLoader valueLoader)
Constructs a by wrapping the providedPropertiesand using theElementValueLoaderto lazily load the property values when requested.- Parameters:
properties- the properties to wrap.valueLoader- the element value loader to use to lazily load the property values
-
-
Method Detail
-
getProperties
public Properties getProperties()
-
clone
public LazyProperties clone()
- Overrides:
clonein classProperties
-
clear
public void clear()
-
keepOnly
public void keepOnly(Collection<String> propertiesToKeep)
Description copied from class:PropertiesRemoves all properties with names that are not in the provided set.- Overrides:
keepOnlyin classProperties- Parameters:
propertiesToKeep- a set of properties to keep
-
remove
public void remove(Collection<String> propertiesToRemove)
- Overrides:
removein classProperties
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<String,Object>- Overrides:
containsKeyin classHashMap<String,Object>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<String,Object>- Overrides:
containsValuein classHashMap<String,Object>
-
values
public Collection<Object> values()
-
equals
public boolean equals(Object obj)
-
-