org.itracker.model
Class IssueField

java.lang.Object
  extended by org.itracker.model.AbstractEntity
      extended by org.itracker.model.IssueField
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Entity>, Entity

public class IssueField
extends AbstractEntity

A CustomField with its value for an Issue.

An IssueField can only belong to 1 Issue (composition).

Author:
ready
See Also:
CustomField, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.itracker.model.AbstractEntity
AbstractEntity.CreateDateComparator, AbstractEntity.IdComparator, AbstractEntity.LastModifiedDateComparator
 
Field Summary
 
Fields inherited from class org.itracker.model.AbstractEntity
CREATE_DATE_COMPARATOR, ID_COMPARATOR, LAST_MODIFIED_DATE_COMPARATOR
 
Constructor Summary
IssueField()
          Default constructor (required by Hibernate).
IssueField(Issue issue, CustomField field)
           
 
Method Summary
 CustomField getCustomField()
           
 Date getDateValue()
           
 Integer getIntValue()
           
 Issue getIssue()
           
 String getStringValue()
           
 String getValue(Locale locale)
          Gets the custom field value as a String.
 String getValue(ResourceBundle bundle)
          Deprecated. this can not be in the entity, replace by Utility or service.
 String getValue(ResourceBundle bundle, Locale locale)
          Deprecated. use getValue(ResourceBundle bundle) instead, locale is taken from bundle
 void setCustomField(CustomField customField)
           
 void setDateValue(Date dateValue)
           
 void setIntValue(Integer intValue)
           
 void setIssue(Issue issue)
           
 void setStringValue(String stringValue)
           
 void setValue(String value, Locale locale, ResourceBundle bundle)
          Deprecated. locale is redundant set, in bundle and as separate parameter. use setValue(String, ResourceBundle) instead
 void setValue(String value, ResourceBundle bundle)
          Sets the custom field value.
 String toString()
           
 
Methods inherited from class org.itracker.model.AbstractEntity
clone, compareTo, equals, getCreateDate, getId, getLastModifiedDate, hashCode, isNew, setCreateDate, setId, setLastModifiedDate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IssueField

public IssueField()
Default constructor (required by Hibernate).

PENDING: should be private so that it can only be used by Hibernate, to ensure that the fields which form an instance's identity are always initialized/never null.


IssueField

public IssueField(Issue issue,
                  CustomField field)
Method Detail

getIssue

public Issue getIssue()

setIssue

public void setIssue(Issue issue)

getCustomField

public CustomField getCustomField()

setCustomField

public void setCustomField(CustomField customField)

getStringValue

public String getStringValue()

setStringValue

public void setStringValue(String stringValue)

getIntValue

public Integer getIntValue()

setIntValue

public void setIntValue(Integer intValue)

getDateValue

public Date getDateValue()

setDateValue

public void setDateValue(Date dateValue)

getValue

public String getValue(Locale locale)
Gets the custom field value as a String.

Parameters:
locale - the locale used for any string formatting
Returns:
the current value of this field

getValue

public String getValue(ResourceBundle bundle,
                       Locale locale)
Deprecated. use getValue(ResourceBundle bundle) instead, locale is taken from bundle

Gets the custom field value as a String.

Parameters:
bundle - a resource bundle to use for any string formatting
locale - a locale to use for any string formatting
Returns:
the current value of this field

getValue

public String getValue(ResourceBundle bundle)
Deprecated. this can not be in the entity, replace by Utility or service.

Gets the custom field value as a String.

Parameters:
bundle - a resource bundle to use for any string formatting
Returns:
the current value of this field

setValue

public void setValue(String value,
                     Locale locale,
                     ResourceBundle bundle)
              throws IssueException
Deprecated. locale is redundant set, in bundle and as separate parameter. use setValue(String, ResourceBundle) instead

Sets the custom field value.

Takes a string and then converts the value to the appropriate type based on the defined field type.

TODO : throw IllegalArgumentException instead of IssueException ?

Parameters:
value - the value to set this field to as a string
locale - the locale used for any string formatting
bundle - the ResourceBundle used for any string formatting
Throws:
IssueException - represents an error formatting or parsing the value

setValue

public void setValue(String value,
                     ResourceBundle bundle)
              throws IssueException
Sets the custom field value.

Takes a string and then converts the value to the appropriate type based on the defined field type.

TODO : throw IllegalArgumentException instead of IssueException ?

Parameters:
value - the value to set this field to as a string
bundle - the ResourceBundle used for any string formatting
Throws:
IssueException - represents an error formatting or parsing the value

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2012 itracker. All Rights Reserved.