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
LazyProperties
wrapsProperties
and 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 providedProperties
and using theElementValueLoader
to lazily load the property values when requested.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
LazyProperties
clone()
boolean
containsKey(Object key)
boolean
containsValue(Object value)
Set<Map.Entry<String,Object>>
entrySet()
boolean
equals(Object obj)
Object
get(Object name)
Object
get(String name)
Properties
getProperties()
int
hashCode()
boolean
isEmpty()
void
keepOnly(Collection<String> propertiesToKeep)
Removes all properties with names that are not in the provided set.Set<String>
keySet()
Object
put(String name, Object property)
void
putAll(Map<? extends String,?> newProperties)
Object
remove(Object name)
void
remove(Collection<String> propertiesToRemove)
int
size()
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 providedProperties
and using theElementValueLoader
to 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:
clone
in classProperties
-
clear
public void clear()
-
keepOnly
public void keepOnly(Collection<String> propertiesToKeep)
Description copied from class:Properties
Removes all properties with names that are not in the provided set.- Overrides:
keepOnly
in classProperties
- Parameters:
propertiesToKeep
- a set of properties to keep
-
remove
public void remove(Collection<String> propertiesToRemove)
- Overrides:
remove
in classProperties
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<String,Object>
- Overrides:
containsKey
in classHashMap<String,Object>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap<String,Object>
- Overrides:
containsValue
in classHashMap<String,Object>
-
values
public Collection<Object> values()
-
equals
public boolean equals(Object obj)
-
-