biz.hammurapi.properties
Interface PropertySet

Type Parameters:
V - Value type.
All Superinterfaces:
Context, MutableContext
All Known Subinterfaces:
PersistentPropertySet
All Known Implementing Classes:
MapPropertySet, PersistentPropertySetFilter, PropertySetFilter, PropertySubSet

public interface PropertySet
extends MutableContext

Set of properties

Author:
Pavel

Method Summary
 void clear()
          Removes all entries from the property set
 boolean compareProperties(PropertySet otherSet)
           
 boolean containsAll(PropertySet subSet)
           
 java.lang.Object get(java.lang.String name)
          Retrieves property.
 java.lang.Object get(java.lang.String name, java.lang.Object defaultValue)
           
 java.util.Set getPropertyNames()
           
 PropertySet getSubset(java.lang.String prefix)
           
 void mount(java.lang.String prefix, PropertySet source)
          Mounts source property set at specified prefix.
 boolean remove(java.lang.String name)
          Removes property from the set.
 void set(java.lang.String name, java.lang.Object value)
          Sets property.
 void setAll(PropertySet source)
          Copies all entries from the source property set to self.
 

Method Detail

getPropertyNames

java.util.Set getPropertyNames()
Returns:
Names of properties in the set

getSubset

PropertySet getSubset(java.lang.String prefix)
Parameters:
prefix -
Returns:
Property set which operates on properties starting with given prefix.

remove

boolean remove(java.lang.String name)
Removes property from the set.

Specified by:
remove in interface MutableContext
Parameters:
name -
Returns:
true if operation was successful. In some cases removal of name/value pair may not be supported (e.g. chained contexts).

clear

void clear()
Removes all entries from the property set


mount

void mount(java.lang.String prefix,
           PropertySet source)
Mounts source property set at specified prefix. E.g. if source property set has entry 'a' and prefix is 'b/' then that entry will be available as 'b/a'. Own property set entries shall shadow mounted entries.

Parameters:
prefix -
source -

setAll

void setAll(PropertySet source)
Copies all entries from the source property set to self.

Parameters:
source -

containsAll

boolean containsAll(PropertySet subSet)
Parameters:
subSet -
Returns:
true if all properties of subset are present in this set with same values

compareProperties

boolean compareProperties(PropertySet otherSet)
Parameters:
otherSet -
Returns:
true if all properties in this set are equal to properties in the other set.

get

java.lang.Object get(java.lang.String name)
Retrieves property.

Specified by:
get in interface Context

get

java.lang.Object get(java.lang.String name,
                     java.lang.Object defaultValue)
Parameters:
name - Property name.
defaultValue - Default value.
Returns:
Property value or default value if property doesn't exist in the property set.

set

void set(java.lang.String name,
         java.lang.Object value)
Sets property.

Specified by:
set in interface MutableContext
Parameters:
name -
value -


Copyright © 2003 Hammurapi Group. All Rights Reserved.