public class MapCompositeValueSupport extends AbstractMetaValue implements CompositeValue
CompositeValue
representing a Map<String,MetaValue>
, where the set of allowed keys is
specified by the associated MapCompositeMetaType
, and where all values must be of the same MetaType.
To represent a Map<String,MetaValue>
where values may have different MetaTypes, use
CompositeValueSupport
instead.Constructor and Description |
---|
MapCompositeValueSupport(Map<String,MetaValue> map,
MetaType valueType) |
MapCompositeValueSupport(MetaType valueType) |
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
|
protected Map<String,MetaValue> |
createMap()
Create map instance.
|
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
|
MapCompositeMetaType |
getMetaType()
Get the metatype for this value
|
int |
hashCode()
Generates a hashcode for the implementation.
|
void |
put(String key,
MetaValue value) |
MetaValue |
remove(String key) |
String |
toString()
A string representation of the open mbean operation info.
|
Collection<MetaValue> |
values()
The values of this composite value
|
clone
public MapCompositeValueSupport(MetaType valueType)
protected Map<String,MetaValue> createMap()
public boolean containsKey(String key)
CompositeValue
containsKey
in interface CompositeValue
key
- the key to testpublic boolean containsValue(MetaValue value)
CompositeValue
containsValue
in interface CompositeValue
value
- the value to testpublic MetaValue get(String key)
CompositeValue
get
in interface CompositeValue
key
- the key to the itempublic MetaValue[] getAll(String[] keys)
CompositeValue
getAll
in interface CompositeValue
keys
- an array of key valuespublic MapCompositeMetaType getMetaType()
MetaValue
getMetaType
in interface CompositeValue
getMetaType
in interface MetaValue
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 testpublic 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
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.