org.intermine.metadata
Class AttributeDescriptor

java.lang.Object
  extended by org.intermine.metadata.FieldDescriptor
      extended by org.intermine.metadata.AttributeDescriptor

public class AttributeDescriptor
extends FieldDescriptor

Describes an attribute of a class - i.e. a field that is neither an object reference or a collection.


Field Summary
protected  java.lang.String type
           
static java.util.Set<java.lang.String> VALID_TYPES
          This is a list of the valid type strings.
 
Fields inherited from class org.intermine.metadata.FieldDescriptor
cld, M_N_RELATION, N_ONE_RELATION, name, NOT_RELATION, ONE_N_RELATION, ONE_ONE_RELATION
 
Constructor Summary
AttributeDescriptor(java.lang.String name, java.lang.String type)
          Construct, name and type cannot be null.
 
Method Summary
 boolean equals(java.lang.Object obj)
          
 java.lang.String getType()
          Get the type of the attribute - either name of primitive or fully qualified class name.
 int hashCode()
          
 boolean isPrimitive()
          Returns true if the type of the attribute is a primitive type (rather than object).
 int relationType()
          Return an integer describing the type of relationship this field represents, where relationship types are 1:1, 1:N, N:1, M:N and "not a relationship".
 java.lang.String toString()
          
 
Methods inherited from class org.intermine.metadata.FieldDescriptor
getClassDescriptor, getName, isAttribute, isCollection, isReference, setClassDescriptor
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

type

protected final java.lang.String type

VALID_TYPES

public static final java.util.Set<java.lang.String> VALID_TYPES
This is a list of the valid type strings.

Constructor Detail

AttributeDescriptor

public AttributeDescriptor(java.lang.String name,
                           java.lang.String type)
Construct, name and type cannot be null.

Parameters:
name - name of field in the class
type - name of primitive or a fully qualified class name
Throws:
java.lang.IllegalArgumentException - if arguments are null
Method Detail

getType

public java.lang.String getType()
Get the type of the attribute - either name of primitive or fully qualified class name.

Returns:
type of attribute

relationType

public int relationType()
Return an integer describing the type of relationship this field represents, where relationship types are 1:1, 1:N, N:1, M:N and "not a relationship".

Specified by:
relationType in class FieldDescriptor
Returns:
int to describe the relationship type

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

isPrimitive

public boolean isPrimitive()
Returns true if the type of the attribute is a primitive type (rather than object).

Returns:
true or false