org.jboss.metatype.api.types
Class ImmutableCompositeMetaType

java.lang.Object
  extended by org.jboss.metatype.api.types.AbstractMetaType
      extended by org.jboss.metatype.plugins.types.AbstractCompositeMetaType
          extended by org.jboss.metatype.api.types.ImmutableCompositeMetaType
All Implemented Interfaces:
Serializable, CompositeMetaType, MetaType

public class ImmutableCompositeMetaType
extends AbstractCompositeMetaType

ImmutableCompositeMetaType.

Version:
$Revision: 1.1 $
Author:
Adrian Brock
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.jboss.metatype.api.types.MetaType
ALLOWED_CLASSNAMES
 
Constructor Summary
ImmutableCompositeMetaType(String typeName, String description, String[] itemNames, String[] itemDescriptions, MetaType[] itemTypes)
          Construct a composite meta type.
 
Method Summary
 boolean equals(Object obj)
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class org.jboss.metatype.plugins.types.AbstractCompositeMetaType
addItem, containsItem, equalsImpl, getDescription, getType, hashCodeImpl, isComposite, isValue, itemSet, keySet, setKeys
 
Methods inherited from class org.jboss.metatype.api.types.AbstractMetaType
getClassName, getDescription, getTypeName, isArray, isCollection, isEnum, isGeneric, isPrimitive, isProperties, isSimple, isTable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.metatype.api.types.MetaType
getClassName, getDescription, getTypeName, isArray, isCollection, isEnum, isGeneric, isPrimitive, isProperties, isSimple, isTable
 

Constructor Detail

ImmutableCompositeMetaType

public ImmutableCompositeMetaType(String typeName,
                                  String description,
                                  String[] itemNames,
                                  String[] itemDescriptions,
                                  MetaType[] itemTypes)
Construct a composite meta type. The parameters are checked for validity.

The three arrays are internally copied. Future changes to these arrays do not alter the composite type.

getClassName() returns CompositeValue

Parameters:
typeName - the name of the composite type, cannot be null or empty
description - the human readable description of the composite type, cannot be null or empty
itemNames - the names of the items described by this type. Cannot be null, must contain at least one element, the elements cannot be null or empty. The order of the items is unimportant when determining equality.
itemDescriptions - the human readable descriptions of the items in the same order as the itemNames, cannot be null must have the same number of elements as the itemNames. The elements cannot be null or empty.
itemTypes - the MetaTypes of the items in the same order as the item names, cannot be null must have the same number of elements as the itemNames. The elements cannot be null.
Throws:
IllegalArgumentException - when a parameter does not match what is described above or when itemNames contains a duplicate name. The names are case sensitive, leading and trailing whitespace is ignored.
Method Detail

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class AbstractCompositeMetaType


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