Class CalculatedCFType<T,S>
java.lang.Object
com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType<T,S>
com.atlassian.jira.issue.customfields.impl.CalculatedCFType<T,S>
- Type Parameters:
T
- Transport Object as defined inCustomFieldType
S
- Single Object contained within the Transport Object as defined inCustomFieldType
- All Implemented Interfaces:
CustomFieldType<T,
S>
A CustomFieldType which is calculated rather than set. Transport Object is defined by subclass.
Note that this used to implement SortableCustomField
, but it is now up
to subclasses to opt-in to sortable if they really want it. This is mostly not recommended because of the poor
performance of using that interface - see NaturallyOrderedCustomFieldSearcher
and SortableCustomFieldSearcher
for the preferred approach to sortable
Custom Fields.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType
AbstractCustomFieldType.VisitorBase<X>
-
Field Summary
Fields inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType
DEFAULT_VALUE_TYPE, RESOURCE_PREVIEW
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
compare
(T o1, T o2, FieldConfig fieldConfig) void
createValue
(CustomField field, Issue issue, T value) Save the value for this Custom Field in a particular issue to the database.getChangelogValue
(CustomField field, T value) Returns a values to be stored in the change log, example is the id of the changed item.Returns a List ofFieldConfigItemType
objects.getDefaultValue
(FieldConfig fieldConfig) Retrieves the Object representing the default CustomField value for the Custom Field.getStringValueFromCustomFieldParams
(CustomFieldParams parameters) Return the String value object from the CustomFieldParams.getValueFromCustomFieldParams
(CustomFieldParams parameters) Retrieves the Transport Object representing the CustomField value instance from the CustomFieldParams of Strings.remove
(CustomField field) Performs additional tasks when an entire CustomField of this type is being removedCustomField.remove()
.void
setDefaultValue
(FieldConfig fieldConfig, T value) Sets the default value for a Custom Fieldvoid
updateValue
(CustomField field, Issue issue, T value) Update the value for this Custom Field in a particular issue currently stored in the database.void
validateFromParams
(CustomFieldParams relevantParams, ErrorCollection errorCollectionToAddTo, FieldConfig config) Ensures that theCustomFieldParams
of Strings is a valid representation of the Custom Field values.Methods inherited from class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType
assertObjectImplementsType, availableForBulkEdit, getChangelogString, getDescription, getDescriptor, getI18nBean, getKey, getName, getRelatedIndexers, getVelocityParameters, getVelocityParameters, init, isRenderable, valuesEqual
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType
areAllRequiredParametersPresent, getCloneOptionConfiguration, getCloneValue, getNonNullCustomFieldProvider, getSingularObjectFromString, getStringFromSingularObject, getValueFromIssue, isUserInputRequiredForMove
-
Constructor Details
-
CalculatedCFType
public CalculatedCFType()
-
-
Method Details
-
remove
Description copied from interface:CustomFieldType
Performs additional tasks when an entire CustomField of this type is being removedCustomField.remove()
. This includes removal of values & options. -
validateFromParams
public void validateFromParams(CustomFieldParams relevantParams, ErrorCollection errorCollectionToAddTo, FieldConfig config) Description copied from interface:CustomFieldType
Ensures that theCustomFieldParams
of Strings is a valid representation of the Custom Field values. Any errors should be added to theErrorCollection
under the appropriate key as required.- Parameters:
relevantParams
- parameter object of StringserrorCollectionToAddTo
- errorCollection to which any errors should be added (never null)config
- FieldConfig
-
createValue
Description copied from interface:CustomFieldType
Save the value for this Custom Field in a particular issue to the database.- Parameters:
field
-CustomField
for which the value is being storedissue
- TheIssue
to be stored against.value
- Transport Object representing the value instance of the CustomField. Can not benull
.
-
updateValue
Description copied from interface:CustomFieldType
Update the value for this Custom Field in a particular issue currently stored in the database.- Parameters:
field
-CustomField
for which the value is being storedissue
- TheIssue
to be stored against.value
- Transport Object representing the value instance of the CustomField.
-
getDefaultValue
Description copied from interface:CustomFieldType
Retrieves the Object representing the default CustomField value for the Custom Field.- Parameters:
fieldConfig
- CustomField for default value- Returns:
- Transport Object of the Default Value
-
setDefaultValue
Description copied from interface:CustomFieldType
Sets the default value for a Custom Field- Parameters:
fieldConfig
- CustomField for which the default is being storedvalue
- Transport Object representing the value instance of the CustomField
-
getChangelogValue
Description copied from interface:CustomFieldType
Returns a values to be stored in the change log, example is the id of the changed item.- Parameters:
field
- CustomField that the value belongs tovalue
- Transport Object representing the value instance of the CustomField- Returns:
- Change log value.
-
getValueFromCustomFieldParams
public T getValueFromCustomFieldParams(CustomFieldParams parameters) throws FieldValidationException Description copied from interface:CustomFieldType
Retrieves the Transport Object representing the CustomField value instance from the CustomFieldParams of Strings.- Parameters:
parameters
- CustomFieldParams of String objects. Will contain one value for Singular field types.- Returns:
- Transport Object matching the Object parameter of
CustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, T)
,CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, T)
- Throws:
FieldValidationException
- if the String value fails to convert into Objects- See Also:
-
CustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, Object)
CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, Object)
CustomFieldType.getValueFromIssue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue)
-
getStringValueFromCustomFieldParams
Description copied from interface:CustomFieldType
Return the String value object from the CustomFieldParams. The object may be a single String (e.g. TextCFType, List of Strings (e.g. MultiSelectCFType) or CustomFieldParams of Strings (e.g. CascadingSelectCFType). Among other things these values are passed to Velocity for rendering edit screens.- Parameters:
parameters
- - CustomFieldParams containing String values- Returns:
- String value object from the CustomFieldParams
-
compare
-
getConfigurationItemTypes
Description copied from interface:CustomFieldType
Returns a List ofFieldConfigItemType
objects. Can not be immutable. This opens up possibilities for configurable custom fields.- Specified by:
getConfigurationItemTypes
in interfaceCustomFieldType<T,
S> - Overrides:
getConfigurationItemTypes
in classAbstractCustomFieldType<T,
S> - Returns:
- List of
FieldConfigItemType
-
accept
- Overrides:
accept
in classAbstractCustomFieldType<T,
S>
-