public interface IPropertyBlock
| Modifier and Type | Interface and Description |
|---|---|
static interface |
IPropertyBlock.IMapBuilder<K,V>
helper to build a map in static way
|
| Modifier and Type | Method and Description |
|---|---|
void |
addModifyListener(IPropertyBlockModifyListener listener) |
Map<String,Object> |
clear()
remove all property entries
|
Supplier<List<PropertyBlockModifyItem>> |
computeProcedure(IPropertyBlockAtomicProcedure operationHandler)
Enables complex editing in locked mode with
IPropertyBlockAtomicProcedure. |
boolean |
containsKey(Object key)
returns true if this propertyblock contains entry with
key ( key==null ? k==null : key.equals(k)). |
void |
dispose() |
default <T> T |
getAdapter(Class<T> adapterClass)
get registered adapter
|
default <T> T |
getAdapter(Class<T> adapterClass,
Supplier<T> adapterFactoryIfNotExists)
get registered adapter
|
Map<String,Object> |
getProperties()
returns an immutable deep copy of property-container as
Map |
Object |
getProperty(String key)
getter for registered property with associated
key |
<T> T |
getProperty(String key,
Class<T> resultClass)
typed getter for registered property with associated
key |
Set<String> |
getPropertyKeySet()
returns an immutable
Set of all registered property keys |
<T> T |
getPropertyOrDefault(String key,
Class<T> resultClass,
T defaultValue)
typed getter for registered property with associated
key |
String |
getPropertyOrDefaultAsString(String key,
String defaultValue)
String-typed getter for registered property with associated
key. |
default <T> T |
getPropertyOrSupply(String key,
Class<T> resultClass,
Supplier<T> propertySupplierIfNotExists)
typed getter for registered property with associated
key |
boolean |
isEmpty()
Returns true if this propertyblock contains no entries
|
IPropertyLock |
lockProperty(String key)
locks a property to prevent writable access
|
default <T> void |
removeAdapter(Class<T> adapterClass)
remove registered adapter
|
void |
removeModifyListener(IPropertyBlockModifyListener listener) |
Object |
removeProperty(String key)
remove registered property with associated
key |
default <T> void |
setAdapter(Class<T> adapterClass,
T adapter)
register an adapter
|
Object |
setProperty(String key,
Object value)
register a property
value with associated key |
Map<String,Object> |
setPropertyEntrySet(Set<Map.Entry<String,Object>> propertyEntrySet,
boolean ignoreIfEquals)
register a set of properties
|
Object setProperty(String key, Object value) throws PropertyIsLockedException
value with associated keykey - key with which the specified property is to be associatedvalue - property to be associated with the specified keykey, or nullPropertyIsLockedExceptionMap<String,Object> setPropertyEntrySet(Set<Map.Entry<String,Object>> propertyEntrySet, boolean ignoreIfEquals) throws PropertyIsLockedException
propertyEntrySet - with new valuesignoreIfEquals - switch to skip updates, if old value equals new valuePropertyIsLockedExceptionObject getProperty(String key)
keykey - the key whose associated property is to be returned<T> T getProperty(String key, Class<T> resultClass)
keykey - the key whose associated property is to be returnedresultClass - the type of property<T> T getPropertyOrDefault(String key, Class<T> resultClass, T defaultValue)
keykey - the key whose associated property is to be returnedresultClass - the type of propertydefaultValue - return value if property with specified key not exist or is nulldefaultValue if property does not existsdefault <T> T getPropertyOrSupply(String key, Class<T> resultClass, Supplier<T> propertySupplierIfNotExists)
keykey - the key whose associated property is to be returnedresultClass - the type of propertypropertySupplierIfNotExists - factory to create property value if not exists , and store with specified keyString getPropertyOrDefaultAsString(String key, String defaultValue)
key. For Non-string value Object.toString() is used as formatter.key - the key whose associated property is to be returneddefaultValue - return value if property with specified key not exist or is null/emptydefaultValue if property does not existsObject removeProperty(String key) throws PropertyIsLockedException
keykey - key the key whose associated property is to be removedPropertyIsLockedExceptionMap<String,Object> getProperties()
MapMap with propertiesSet<String> getPropertyKeySet()
Set of all registered property keysboolean isEmpty()
boolean containsKey(Object key)
key ( key==null ? k==null : key.equals(k)).key - key whose presence in this propertyblock is to be testedMap<String,Object> clear() throws PropertyIsLockedException
PropertyIsLockedExceptiondefault <T> void setAdapter(Class<T> adapterClass, T adapter) throws PropertyIsLockedException
adapterClass - type of adapteradapter - implementation of adapterPropertyIsLockedExceptiondefault <T> T getAdapter(Class<T> adapterClass)
adapterClass - type of adapterdefault <T> T getAdapter(Class<T> adapterClass, Supplier<T> adapterFactoryIfNotExists)
adapterClass - type of adapteradapterFactoryIfNotExists - factory to create adapter if not exists , and store with specified keydefault <T> void removeAdapter(Class<T> adapterClass) throws PropertyIsLockedException
adapterClass - type of adapterPropertyIsLockedExceptionIPropertyLock lockProperty(String key)
key - the key whose associated property is to be lockedIPropertyBlock or null, if property is already lockedSupplier<List<PropertyBlockModifyItem>> computeProcedure(IPropertyBlockAtomicProcedure operationHandler)
IPropertyBlockAtomicProcedure.operationHandler - handle to edit propertyvoid addModifyListener(IPropertyBlockModifyListener listener)
void removeModifyListener(IPropertyBlockModifyListener listener)
void dispose()
Copyright © 2020. All rights reserved.