|
JBoss Managed Parent POM 2.1.1.SP2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.metatype.api.values.AbstractMetaValue
org.jboss.metatype.api.values.CompositeValueSupport
public class CompositeValueSupport
A CompositeValue
representing a Map<String,MetaValue>
, where the set of allowed keys and
their corresponding values' MetaTypes are specified by the associated ImmutableCompositeMetaType
or
MutableCompositeMetaType
.
To represent a Map<String,MetaValue>
where values must all have the same MetaType, use
MapCompositeValueSupport
instead.
Constructor Summary | |
---|---|
CompositeValueSupport(CompositeMetaType metaType)
Construct Composite Value |
|
CompositeValueSupport(CompositeMetaType compositeMetaType,
Map<String,MetaValue> items)
Construct Composite Value |
|
CompositeValueSupport(CompositeMetaType metaType,
String[] itemNames,
MetaValue[] itemValues)
Construct Composite Value |
Method Summary | |
---|---|
boolean |
containsKey(String key)
Tests whether a key is part of this composite value |
boolean |
containsValue(MetaValue value)
Tests whether a item exists with the passed value |
boolean |
equals(Object obj)
Tests whether two composite value objects are equal |
MetaValue |
get(String key)
Retrieve the value for the item with the passed key |
MetaValue[] |
getAll(String[] keys)
Retrieve the array of values for the item with the passed keys |
CompositeMetaType |
getMetaType()
Get the value's type - either a ImmutableCompositeMetaType or a MutableCompositeMetaType . |
int |
hashCode()
Generates a hashcode for the implementation. |
void |
set(String key,
MetaValue value)
Set an item value |
String |
toString()
A string representation of the open mbean operation info. |
Collection<MetaValue> |
values()
The values of this composite value |
Methods inherited from class org.jboss.metatype.api.values.AbstractMetaValue |
---|
clone |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jboss.metatype.api.values.MetaValue |
---|
clone |
Constructor Detail |
---|
public CompositeValueSupport(CompositeMetaType metaType, String[] itemNames, MetaValue[] itemValues)
metaType
- the composite meta type of the dataitemNames
- the names of the valuesitemValues
- the values
IllegalArgumentException
- for a null metaTypepublic CompositeValueSupport(CompositeMetaType metaType)
metaType
- the composite meta type of the data
IllegalArgumentException
- for a null metaTypepublic CompositeValueSupport(CompositeMetaType compositeMetaType, Map<String,MetaValue> items)
compositeMetaType
- the composite type of the dataitems
- map of strings to values
IllegalArgumentException
- for a null metaTypeMethod Detail |
---|
public CompositeMetaType getMetaType()
ImmutableCompositeMetaType
or a MutableCompositeMetaType
.
getMetaType
in interface CompositeValue
getMetaType
in interface MetaValue
ImmutableCompositeMetaType
or a MutableCompositeMetaType
public MetaValue get(String key)
CompositeValue
get
in interface CompositeValue
key
- the key to the item
public void set(String key, MetaValue value)
key
- the keyvalue
- the valuepublic MetaValue[] getAll(String[] keys)
CompositeValue
getAll
in interface CompositeValue
keys
- an array of key values
public boolean containsKey(String key)
CompositeValue
containsKey
in interface CompositeValue
key
- the key to test
public boolean containsValue(MetaValue value)
CompositeValue
containsValue
in interface CompositeValue
value
- the value to test
public Collection<MetaValue> values()
CompositeValue
An iterator over the returned collection returns result in ascending lexicographic order
values
in interface CompositeValue
public boolean equals(Object obj)
CompositeValue
The object is non-null
The object implements this interface
The composite meta types are equal
The values are equal
equals
in interface CompositeValue
equals
in class Object
obj
- the object to test
public int hashCode()
CompositeValue
The sum of the hashCodes for the elements mentioned in the equals method
hashCode
in interface CompositeValue
hashCode
in class Object
public String toString()
CompositeValue
It is made up of implementation class and the values mentioned in the equals method
toString
in interface CompositeValue
toString
in class Object
|
JBoss Managed Parent POM 2.1.1.SP2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |