Class JiraDataTypeImpl

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

@Immutable @PublicApi 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 Details

    • JiraDataTypeImpl

      public JiraDataTypeImpl(Class<?> type)
    • JiraDataTypeImpl

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

    • 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