public class ParametersImpl extends Object implements Parameters
This collection follows both list and map connotations. It behaves like a list in that items that come out of it
are in the same order as when they were added to it. It behaves like a map in that duplicate elements are not allowed
and looking up elements have constant time performance that is analogous to java.util.HashMap.
This class is not thread-safe.
| Constructor and Description |
|---|
ParametersImpl()
Constructor for
ParametersImpl that initializes the object with no parameters. |
ParametersImpl(Parameters original)
Copy-constructor for
ParametersImpl. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Parameter parameter) |
boolean |
addAll(Collection<? extends Parameter> c)
Adds the elements found in the
c collection. |
void |
applyResourceBundleToParameterRenderingInformation(ResourceBundle resourceBundle)
This will apply the given
resourceBundle to the parameters in this collection. |
void |
clear() |
boolean |
contains(Object o)
This is here to satisfy the
Collection interface contract. |
boolean |
contains(Parameter parameter)
Checks to see if this parameter exists by specifying the
parameter - only the name is used when
checking. |
boolean |
contains(String parameterName)
Checks if this parameter exists by specifying the
parameter name. |
boolean |
containsAll(Collection<?> c)
Checks to see if all the elements found in the
c collection are in this collection. |
boolean |
equals(Object obj) |
Parameters |
getInternalParameters()
The returned object is not a copy - changes made to that collection affect this object's internal collection.
|
Parameter |
getParameter(String parameterName)
Given the name of a parameter, this will return its associated
Parameter. |
ParameterDefinition |
getParameterDefinition(String parameterName)
Given the name of a parameter, this will return the parameter's definition.
|
Object |
getParameterValue(String parameterName)
Given the name of a parameter, this will return the parameter's value.
|
Parameters |
getPublicParameters()
The returned object is not a copy - changes made to that collection affect this object's internal collection.
|
int |
hashCode() |
boolean |
isEmpty() |
Iterator<Parameter> |
iterator()
The iterator will contain objects of type
Parameter. |
boolean |
remove(Object o)
This is here to satisfy the
Collection interface contract. |
boolean |
remove(Parameter parameter)
Removes the parameter whose name is the same as the name in the given
parameter. |
boolean |
remove(String parameterName)
Removes the parameter stored in this collection whose name matches
parameterName. |
boolean |
removeAll(Collection<?> c)
Removes the elements found in the
c collection. |
boolean |
retainAll(Collection<?> c)
Retains only those elements found in the
c collection. |
void |
setParameterValue(String parameterName,
Object parameterValue)
Given the name of a parameter, this will set the parameter's value.
|
int |
size()
The returned object is not a copy - changes made to that collection affect this object's internal collection.
|
Object[] |
toArray()
The returned array may be cast to a
Parameter array. |
<T> T[] |
toArray(T[] a)
Returns an array of
Parameter objects. |
String |
toString() |
public ParametersImpl()
ParametersImpl that initializes the object with no parameters.public ParametersImpl(Parameters original)
ParametersImpl.original - the original to copypublic Parameter getParameter(String parameterName)
ParametersParameter. If it doesn't exist in this
collection, null is returned.getParameter in interface ParametersparameterName - the name of the parameter to getParameters.getParameter(String)public ParameterDefinition getParameterDefinition(String parameterName) throws InvalidParameterDefinitionException
Parametersnull; in this case, null is returned. If the parameter
does not exist in this collection, an exception is thrown.getParameterDefinition in interface ParametersparameterName - the name of the parameter whose definition is to be returnedInvalidParameterDefinitionException - if the parameter does not exist in this collectionParameters.getParameterDefinition(String)public Object getParameterValue(String parameterName) throws InvalidParameterDefinitionException
Parametersnull, a return value of null means the parameter exists but its value was
null. If the parameter does not exist in this collection, an exception is thrown.getParameterValue in interface ParametersparameterName - the name of the parameter whose value is to be returnedInvalidParameterDefinitionException - if the parameter does not exist in this collectionParameters.getParameterValue(String)public void setParameterValue(String parameterName, Object parameterValue) throws InvalidParameterDefinitionException
ParameterssetParameterValue in interface ParametersparameterName - the name of the parameter whose value is to be setparameterValue - the value of the parameter (may be null)InvalidParameterDefinitionException - if the parameter does not exist in this collectionParameters.setParameterValue(String, Object)public Parameters getPublicParameters()
getPublicParameters in interface ParametersParameters.getPublicParameters()public Parameters getInternalParameters()
getInternalParameters in interface ParametersParameters.getInternalParameters()public void applyResourceBundleToParameterRenderingInformation(ResourceBundle resourceBundle)
ParametersresourceBundle to the parameters in this collection. This allows you to
localize the parameters.applyResourceBundleToParameterRenderingInformation in interface ParametersresourceBundle - the resource bundle that is to be used when rendering the parametersParameters.applyResourceBundleToParameterRenderingInformation(ResourceBundle)public int size()
size in interface Collection<Parameter>Collection.size()public void clear()
clear in interface Collection<Parameter>Collection.clear()public boolean isEmpty()
isEmpty in interface Collection<Parameter>Collection.isEmpty()public boolean add(Parameter parameter) throws NullPointerException
add in interface Collection<Parameter>NullPointerExceptionParameters#add(Parameter)public boolean contains(Object o) throws ClassCastException, NullPointerException
Collection interface contract. Same as if calling contains(String)
where the argument is the parameter name or contains(Parameter).contains in interface Collection<Parameter>ClassCastExceptionNullPointerExceptionCollection.contains(Object)public boolean contains(String parameterName) throws NullPointerException
Parametersparameter name.contains in interface ParametersparameterName - the parameter nametrue if there is a parameter in this object identified by the parameterNameNullPointerException - if parameterName is null, as per Collection interface
contractParameters.contains(String)public boolean contains(Parameter parameter) throws NullPointerException
Parametersparameter - only the name is used when
checking. This means as long as the given parameter's name matches one in the collection, this returns
true, it doesn't matter if the parameter's value or definition completely match.contains in interface Parametersparameter - the parameter to checktrue if there is a parameter in this object identified by the parameterNameNullPointerException - if parameter is null, as per Collection interface contractParameters.contains(Parameter)public boolean remove(Object o) throws ClassCastException, NullPointerException
Collection interface contract. Same as if calling remove(String)
where the argument is the parameter name or remove(Parameter).remove in interface Collection<Parameter>ClassCastExceptionNullPointerExceptionCollection.remove(Object)public boolean remove(String parameterName) throws NullPointerException
parameterName.remove in interface ParametersparameterName - the name of the parameter to remove from this collectiontrue if the object was removed; false if there was no object in this collection
with the given parameter nameNullPointerException - if parameterName is null, as per Collection interface
contractpublic boolean remove(Parameter parameter) throws NullPointerException
parameter. The full definition
and value of the given parameter is ignored when determining a match - only the parameter name is
used in the comparision.remove in interface Parametersparameter - the parameter whose name is used to determine what to removetrue if the object was removedNullPointerException - if parameter is null, as per Collection interface contractpublic boolean addAll(Collection<? extends Parameter> c) throws ClassCastException, NullPointerException
c collection. If one or more elements in c is not a
Parameter, an exception will be thrown.addAll in interface Collection<Parameter>ClassCastExceptionNullPointerExceptionCollection.addAll(java.util.Collection)public boolean containsAll(Collection<?> c) throws ClassCastException, NullPointerException
c collection are in this collection. If one or more
elements in c is not a Parameter or String, an exception will be thrown.containsAll in interface Collection<Parameter>ClassCastExceptionNullPointerExceptionCollection.containsAll(Collection)public boolean removeAll(Collection<?> c) throws ClassCastException, NullPointerException
c collection. If one or more elements in c is not a
Parameter, an exception will be thrown.removeAll in interface Collection<Parameter>ClassCastExceptionNullPointerExceptionCollection.removeAll(Collection)public boolean retainAll(Collection<?> c) throws ClassCastException, NullPointerException
c collection. If one or more elements in c is
not a Parameter, an exception will be thrown. The implementation will remove all elements in this
collection and then add all the elements in c. Because of this, true is always returned
- even if the elements end up being the same in the end.retainAll in interface Collection<Parameter>ClassCastExceptionNullPointerExceptionCollection.retainAll(Collection)public Iterator<Parameter> iterator()
Parameter.iterator in interface Iterable<Parameter>iterator in interface Collection<Parameter>Collection.iterator()public Object[] toArray()
Parameter array.toArray in interface Collection<Parameter>Collection.toArray()public <T> T[] toArray(T[] a)
Parameter objects.toArray in interface Collection<Parameter>java.util.Collection#toArray(T[])public String toString()
toString in class ObjectObject.toString()public boolean equals(Object obj)
equals in interface Collection<Parameter>equals in class ObjectObject.equals(Object)public int hashCode()
hashCode in interface Collection<Parameter>hashCode in class ObjectObject.hashCode()Copyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.