T
- Transport Object as defined in CustomFieldType
S
- Single Object contained within the Transport Object as defined in CustomFieldType
@PublicSpi public abstract class CalculatedCFType<T,S> extends AbstractCustomFieldType<T,S>
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.
Modifier and Type | Class and Description |
---|---|
static interface |
CalculatedCFType.Visitor<X> |
AbstractCustomFieldType.VisitorBase<X>
DEFAULT_VALUE_TYPE, RESOURCE_PREVIEW
Constructor and Description |
---|
CalculatedCFType() |
Modifier and Type | Method and Description |
---|---|
Object |
accept(AbstractCustomFieldType.VisitorBase visitor) |
int |
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.
|
String |
getChangelogValue(CustomField field,
T value)
Returns a values to be stored in the change log, example is the id of the changed item.
|
List<FieldConfigItemType> |
getConfigurationItemTypes()
Returns a List of
FieldConfigItemType objects. |
T |
getDefaultValue(FieldConfig fieldConfig)
Retrieves the Object representing the default CustomField value for the Custom Field.
|
Object |
getStringValueFromCustomFieldParams(CustomFieldParams parameters)
Return the String value object from the CustomFieldParams.
|
T |
getValueFromCustomFieldParams(CustomFieldParams parameters)
Retrieves the Transport Object representing the CustomField value instance from the CustomFieldParams of Strings.
|
Set<Long> |
remove(CustomField field)
Performs additional tasks when an entire CustomField of this type is being removed
CustomField.remove() . |
void |
setDefaultValue(FieldConfig fieldConfig,
T value)
Sets the default value for a Custom Field
|
void |
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 the
CustomFieldParams of Strings is a valid representation of the Custom Field values. |
assertObjectImplementsType, availableForBulkEdit, getChangelogString, getDescription, getDescriptor, getI18nBean, getKey, getName, getRelatedIndexers, getVelocityParameters, getVelocityParameters, init, isRenderable, valuesEqual
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCloneOptionConfiguration, getCloneValue, getSingularObjectFromString, getStringFromSingularObject, getValueFromIssue, isUserInputRequiredForMove
public Set<Long> remove(CustomField field)
CustomFieldType
CustomField.remove()
.
This includes removal of values & options.field
- The custom field that is being removed, so any data stored for
any issues for that field can be deleted.Set
of issue ids that has been affectedpublic void validateFromParams(CustomFieldParams relevantParams, ErrorCollection errorCollectionToAddTo, FieldConfig config)
CustomFieldType
CustomFieldParams
of Strings is a valid representation of the Custom Field values.
Any errors should be added to the ErrorCollection
under the appropriate key as required.relevantParams
- parameter object of StringserrorCollectionToAddTo
- errorCollection to which any errors should be added (never null)config
- FieldConfigpublic void createValue(CustomField field, Issue issue, @Nonnull T value)
CustomFieldType
field
- CustomField
for which the value is being storedissue
- The Issue
to be stored against.value
- Transport Object representing the value instance of the CustomField.
Can not be null
.public void updateValue(CustomField field, Issue issue, T value)
CustomFieldType
field
- CustomField
for which the value is being storedissue
- The Issue
to be stored against.value
- Transport Object representing the value instance of the CustomField.public T getDefaultValue(FieldConfig fieldConfig)
CustomFieldType
fieldConfig
- CustomField for default valuepublic void setDefaultValue(FieldConfig fieldConfig, T value)
CustomFieldType
fieldConfig
- CustomField for which the default is being storedvalue
- Transport Object representing the value instance of the CustomFieldpublic String getChangelogValue(CustomField field, T value)
CustomFieldType
field
- CustomField that the value belongs tovalue
- Transport Object representing the value instance of the CustomFieldpublic T getValueFromCustomFieldParams(CustomFieldParams parameters) throws FieldValidationException
CustomFieldType
parameters
- CustomFieldParams of String objects. Will contain one value for Singular field types.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)
FieldValidationException
- if the String value fails to convert into ObjectsCustomFieldType.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)
public Object getStringValueFromCustomFieldParams(CustomFieldParams parameters)
CustomFieldType
parameters
- - CustomFieldParams containing String valuespublic int compare(@Nonnull T o1, @Nonnull T o2, FieldConfig fieldConfig)
@Nonnull public List<FieldConfigItemType> getConfigurationItemTypes()
CustomFieldType
FieldConfigItemType
objects. Can not be immutable.
This opens up possibilities for configurable custom fields.getConfigurationItemTypes
in interface CustomFieldType<T,S>
getConfigurationItemTypes
in class AbstractCustomFieldType<T,S>
FieldConfigItemType
public Object accept(AbstractCustomFieldType.VisitorBase visitor)
accept
in class AbstractCustomFieldType<T,S>
Copyright © 2002-2017 Atlassian. All Rights Reserved.