JBoss Managed Parent POM 2.1.1.SP2

org.jboss.metatype.api.values
Interface CompositeValue

All Superinterfaces:
Cloneable, MetaValue, Serializable
All Known Implementing Classes:
CompositeValueSupport, MapCompositeValueSupport

public interface CompositeValue
extends MetaValue

A MetaValue representing a Map<String,MetaValue>, where the set of allowed keys and their corresponding values' MetaTypes are specified by the associated CompositeMetaType.

Version:
$Revision: 1.1 $
Author:
Adrian Brock
See Also:
MapCompositeValueSupport, CompositeValueSupport

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 metatype for this value
 int hashCode()
          Generates a hashcode for the implementation.
 String toString()
          A string representation of the open mbean operation info.
 Collection<MetaValue> values()
          The values of this composite value
 
Methods inherited from interface org.jboss.metatype.api.values.MetaValue
clone
 

Method Detail

getMetaType

CompositeMetaType getMetaType()
Description copied from interface: MetaValue
Get the metatype for this value

Specified by:
getMetaType in interface MetaValue
Returns:
the metatype

get

MetaValue get(String key)
Retrieve the value for the item with the passed key

Parameters:
key - the key to the item
Returns:
the value
Throws:
IllegalArgumentException - when the key is null or the empty string or when the key does not exist

getAll

MetaValue[] getAll(String[] keys)
Retrieve the array of values for the item with the passed keys

Parameters:
keys - an array of key values
Returns:
the array of values
Throws:
IllegalArgumentException - when a key is null or the empty string or the array is null or when a key does not exist

containsKey

boolean containsKey(String key)
Tests whether a key is part of this composite value

Parameters:
key - the key to test
Returns:
true when the key exists, false otherwise

containsValue

boolean containsValue(MetaValue value)
Tests whether a item exists with the passed value

Parameters:
value - the value to test
Returns:
true when the value exists, false otherwise

values

Collection<MetaValue> values()
The values of this composite value

An iterator over the returned collection returns result in ascending lexicographic order

Returns:
an unmodifiable Collection of the values of this CompositeMetaType.

equals

boolean equals(Object obj)
Tests whether two composite value objects are equal

The object is non-null
The object implements this interface
The composite meta types are equal
The values are equal

Overrides:
equals in class Object
Parameters:
obj - the object to test
Returns:
true when the above conditions are satisfied, false otherwise.

hashCode

int hashCode()
Generates a hashcode for the implementation.

The sum of the hashCodes for the elements mentioned in the equals method

Overrides:
hashCode in class Object
Returns:
the calculated hashcode

toString

String toString()
A string representation of the open mbean operation info.

It is made up of implementation class and the values mentioned in the equals method

Overrides:
toString in class Object
Returns:
the string

JBoss Managed Parent POM 2.1.1.SP2

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.