public class CompositeValueSupport extends AbstractMetaValue implements CompositeValue
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 and Description |
|---|
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
|
| Modifier and Type | Method and Description |
|---|---|
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
|
clonepublic CompositeValueSupport(CompositeMetaType metaType, String[] itemNames, MetaValue[] itemValues)
metaType - the composite meta type of the dataitemNames - the names of the valuesitemValues - the valuesIllegalArgumentException - for a null metaTypepublic CompositeValueSupport(CompositeMetaType metaType)
metaType - the composite meta type of the dataIllegalArgumentException - for a null metaTypepublic CompositeValueSupport(CompositeMetaType compositeMetaType, Map<String,MetaValue> items)
compositeMetaType - the composite type of the dataitems - map of strings to valuesIllegalArgumentException - for a null metaTypepublic CompositeMetaType getMetaType()
ImmutableCompositeMetaType or a MutableCompositeMetaType.getMetaType in interface CompositeValuegetMetaType in interface MetaValueImmutableCompositeMetaType or a MutableCompositeMetaTypepublic MetaValue get(String key)
CompositeValueget in interface CompositeValuekey - the key to the itempublic void set(String key, MetaValue value)
key - the keyvalue - the valuepublic MetaValue[] getAll(String[] keys)
CompositeValuegetAll in interface CompositeValuekeys - an array of key valuespublic boolean containsKey(String key)
CompositeValuecontainsKey in interface CompositeValuekey - the key to testpublic boolean containsValue(MetaValue value)
CompositeValuecontainsValue in interface CompositeValuevalue - the value to testpublic Collection<MetaValue> values()
CompositeValueAn iterator over the returned collection returns result in ascending lexicographic order
values in interface CompositeValuepublic 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 CompositeValueequals in class Objectobj - the object to testpublic int hashCode()
CompositeValueThe sum of the hashCodes for the elements mentioned in the equals method
hashCode in interface CompositeValuehashCode in class Objectpublic String toString()
CompositeValueIt is made up of implementation class and the values mentioned in the equals method
toString in interface CompositeValuetoString in class ObjectCopyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.