Package xades4j.utils
Class PropertiesSet<T>
java.lang.Object
xades4j.utils.PropertiesSet<T>
A generic bag of properties used to store properties that apply to a specific
target (data object descriptions, signature properties collector, signed data
objects). The properties are organized by type (class).
- Author:
- Luís
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPropertiesSet
(int initialNPropTypes) Initializes the property bag with the given initial diferent property types. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a property to the bag.Gets the properties in the bag.boolean
isEmpty()
Indicates whether the bag has any properties.void
Puts a property in the bag.void
Removes a property from the bag.
-
Field Details
-
CANNOT_BE_NULL
- See Also:
-
-
Constructor Details
-
PropertiesSet
public PropertiesSet(int initialNPropTypes) Initializes the property bag with the given initial diferent property types.- Parameters:
initialNPropTypes
- the initial number of different property types.
-
-
Method Details
-
put
Puts a property in the bag. The put operation doesn't allow repeated property types. If a property of this type was previously added, an exception is thrown.- Parameters:
prop
- the property- Throws:
NullPointerException
- ifprop
isnull
PropertyTargetException
- if a property of this type was previously added
-
add
Adds a property to the bag. The add operation allows multiple properties of the same type but not repeated instances.- Parameters:
prop
- the property- Throws:
NullPointerException
- ifprop
isnull
PropertyTargetException
- if the given property (instance) is already present in the bag
-
remove
Removes a property from the bag.- Parameters:
prop
- the property to be removed- Throws:
NullPointerException
- if the property isnull
IllegalStateException
- if the property is not present
-
isEmpty
public boolean isEmpty()Indicates whether the bag has any properties.- Returns:
true
if the bag has no properties
-
getProperties
Gets the properties in the bag.- Returns:
- un unmodifiable collection of properties
-