public abstract class AbstractSubSet<KP> extends Object implements PropertySet<KP>
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSubSet(PropertySet<KP> master,
KP prefix) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract KP |
buildPath(KP prefix,
KP key) |
void |
cancel(KP key)
Removes callable to be cooked from the cooking queue, converting it to
lazy, if it is not already cooked.
|
void |
cancelAll()
Cancels all unfinished background computations.
|
void |
clear()
Removes all entries from the property set
|
void |
cook(KP key,
Callable<?> callable)
Puts callable to the property set for asynchronous invocation to retrieve
value at some point in the future.
|
void |
cook(KP key,
Callable<?> callable,
long delay,
TimeUnit timeUnit)
Puts callable to the property set for asynchronous invocation to retrieve
value at some point in the future after specified delay.
|
void |
cooking(KP key,
Future<?> future)
Puts value which is not ready yet but "is being cooked by another thread"
to the property set to be used at some point of time in the future.
|
PropertySet<KP> |
createVersion()
Creates object version.
|
Object |
get(KP key)
Retrieves property without conversion.
|
<T> T |
get(KP key,
Class<T> type)
Retrieves property with conversion to target type.
|
<T> T |
get(KP key,
Class<T> type,
long timeout,
TimeUnit unit)
Retrieves property with conversion to target type.
|
<T> T |
get(KP key,
Class<T> type,
T defaultValue) |
<T> T |
get(KP key,
Class<T> type,
T defaultValue,
long timeout,
TimeUnit unit) |
Object |
get(KP key,
long timeout,
TimeUnit unit)
Retrieves property without conversion.
|
Object |
get(KP key,
Object defaultValue) |
Object |
get(KP key,
Object defaultValue,
long timeout,
TimeUnit unit) |
<T> T |
getAdapter(Class<T> targetType,
Context context)
Retrieves adapter of given type from adaptable.
|
Object |
invoke(KP key,
Object... args)
Invokes invocable at given key.
|
Set<KP> |
keySet() |
void |
lazy(KP key,
Callable<?> callable)
Puts callable to the property set.
|
void |
mount(KP prefix,
PropertySet<KP> source)
Mounts source property set at specified prefix.
|
void |
remove(KP key)
Removes property from the set.
|
void |
set(KP key,
Object value)
Sets property.
|
void |
setAll(PropertySet<KP> source)
Copies all entries from the source property set to self.
|
void |
setInvocable(KP key,
Invocable<PropertySet<KP>,?,KP,?> invocable)
Convenience method to set invocable.
|
Object |
shadowGet(KP key)
Retrieves shadow property without conversion.
|
<T> T |
shadowGet(KP key,
Class<T> type)
Retrieves property with conversion to target type.
|
<T> T |
shadowGet(KP key,
Class<T> type,
long timeout,
TimeUnit unit)
Retrieves property with conversion to target type.
|
<T> T |
shadowGet(KP key,
Class<T> type,
T defaultValue) |
<T> T |
shadowGet(KP key,
Class<T> type,
T defaultValue,
long timeout,
TimeUnit unit) |
Object |
shadowGet(KP key,
long timeout,
TimeUnit unit)
Retrieves shadow property without conversion.
|
Object |
shadowGet(KP key,
Object defaultValue) |
Object |
shadowGet(KP key,
Object defaultValue,
long timeout,
TimeUnit unit) |
Object |
shadowInvoke(KP key,
Object... args)
Invokes invocable in the shadow property set at given key.
|
PropertySet<KP> |
subset(KP prefix) |
void |
unmount(KP prefix) |
protected AbstractSubSet(PropertySet<KP> master, KP prefix)
public void clear()
PropertySetclear in interface PropertySet<KP>public Object get(KP key)
PropertySetget in interface PropertySet<KP>public Object get(KP key, Object defaultValue)
get in interface PropertySet<KP>key - Property key.defaultValue - Default value.public <T> T get(KP key, Class<T> type)
PropertySetget in interface PropertySet<KP>public <T> T get(KP key, Class<T> type, T defaultValue)
get in interface PropertySet<KP>key - Property key.type - target type.defaultValue - Default value.public Object get(KP key, long timeout, TimeUnit unit)
PropertySetget in interface PropertySet<KP>public Object get(KP key, Object defaultValue, long timeout, TimeUnit unit)
get in interface PropertySet<KP>key - Property key.defaultValue - Default value.public <T> T get(KP key, Class<T> type, long timeout, TimeUnit unit)
PropertySetget in interface PropertySet<KP>public <T> T get(KP key, Class<T> type, T defaultValue, long timeout, TimeUnit unit)
get in interface PropertySet<KP>key - Property key.type - target type.defaultValue - Default value.public void cook(KP key, Callable<?> callable)
PropertySetcook in interface PropertySet<KP>public void cook(KP key, Callable<?> callable, long delay, TimeUnit timeUnit)
PropertySetcook in interface PropertySet<KP>public void cooking(KP key, Future<?> future)
PropertySetcooking in interface PropertySet<KP>future - Value being cooked.public void cancel(KP key)
PropertySetcancel in interface PropertySet<KP>public void cancelAll()
PropertySetcancelAll in interface PropertySet<KP>public <T> T getAdapter(Class<T> targetType, Context context)
AdaptablegetAdapter in interface AdaptableT - Adapter type.targetType - Adapter type.context - Adapter context.public Set<KP> keySet()
keySet in interface PropertySet<KP>public PropertySet<KP> subset(KP prefix)
subset in interface PropertySet<KP>public void remove(KP key)
PropertySetremove in interface PropertySet<KP>public void mount(KP prefix, PropertySet<KP> source)
PropertySetmount in interface PropertySet<KP>public void unmount(KP prefix)
unmount in interface PropertySet<KP>public void setAll(PropertySet<KP> source)
PropertySetsetAll in interface PropertySet<KP>public void set(KP key, Object value)
PropertySetset in interface PropertySet<KP>public void setInvocable(KP key, Invocable<PropertySet<KP>,?,KP,?> invocable)
PropertySetsetInvocable in interface PropertySet<KP>public void lazy(KP key, Callable<?> callable)
PropertySetget() method for the given name is invoked.lazy in interface PropertySet<KP>public Object invoke(KP key, Object... args)
PropertySetinvoke in interface PropertySet<KP>public Object shadowInvoke(KP key, Object... args)
PropertySetshadowInvoke in interface PropertySet<KP>public Object shadowGet(KP key)
PropertySetshadowGet in interface PropertySet<KP>public Object shadowGet(KP key, Object defaultValue)
shadowGet in interface PropertySet<KP>key - Property key.defaultValue - Default value.public <T> T shadowGet(KP key, Class<T> type)
PropertySetshadowGet in interface PropertySet<KP>public <T> T shadowGet(KP key, Class<T> type, T defaultValue)
shadowGet in interface PropertySet<KP>key - Property key.type - target type.defaultValue - Default value.public Object shadowGet(KP key, long timeout, TimeUnit unit)
PropertySetshadowGet in interface PropertySet<KP>public Object shadowGet(KP key, Object defaultValue, long timeout, TimeUnit unit)
shadowGet in interface PropertySet<KP>key - Property key.defaultValue - Default value.public <T> T shadowGet(KP key, Class<T> type, long timeout, TimeUnit unit)
PropertySetshadowGet in interface PropertySet<KP>public <T> T shadowGet(KP key, Class<T> type, T defaultValue, long timeout, TimeUnit unit)
shadowGet in interface PropertySet<KP>key - Property key.type - target type.defaultValue - Default value.public PropertySet<KP> createVersion()
VersionablecreateVersion in interface Versionable<PropertySet<KP>>