com.atlassian.jira
Class JiraDataTypeImpl

java.lang.Object
  extended by com.atlassian.jira.JiraDataTypeImpl
All Implemented Interfaces:
JiraDataType

public final class JiraDataTypeImpl
extends Object
implements JiraDataType

Each data type can specify a collection of actual java types, represented via their Class, that this type is.

Since:
v4.0

Constructor Summary
JiraDataTypeImpl(Class<?> type)
           
JiraDataTypeImpl(Collection<? extends Class<?>> types)
           
 
Method Summary
 Collection<String> asStrings()
          Provides a string representation of this JiraDataType's actual types.
 boolean equals(Object o)
           
 Collection<Class<?>> getTypes()
          The actual java type's, represented via their Class, that this type is.
 int hashCode()
           
 boolean matches(JiraDataType otherType)
          Determines if this type matches the passed in other JiraDataType.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JiraDataTypeImpl

public JiraDataTypeImpl(Class<?> type)

JiraDataTypeImpl

public JiraDataTypeImpl(Collection<? extends Class<?>> types)
Method Detail

asStrings

public Collection<String> asStrings()
Description copied from interface: JiraDataType
Provides a string representation of this JiraDataType's actual types. A JiraDataType can declare that it is made up of distinct types and this is why we return a collection of string representations.

Specified by:
asStrings in interface JiraDataType
Returns:
string representation of this JiraDataTypes's actual types.

matches

public boolean matches(JiraDataType otherType)
Description copied from interface: JiraDataType
Determines if this type matches the passed in other JiraDataType. This method runs through the data types and will return true if any of the types are equals to the other types. This method should be reflexive, if a.match(b) == true then b.match(a) == true There is a special case which is Object. This means all and any comparison against Object.class will return true for the match method.

Specified by:
matches in interface JiraDataType
Parameters:
otherType - the data type to compare to, not null.
Returns:
true if any of this types are assignable to the other types.

getTypes

public Collection<Class<?>> getTypes()
The actual java type's, represented via their Class, that this type is. This is not provided on the interface, if you need it you must cast the object to this implementation type.

Returns:
the Class's that this data type represents.

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2002-2010 Atlassian. All Rights Reserved.