public class FieldId extends Object
Identifiers of system fields are always strings with their human-readable names (e.g. "priority"), while custom fields can be identified by a number (e.g. 10000) or a full textual representation (e.g. "customfield_10000"). This class helps avoid the confusion when handling all these formats.
Methods of creation:
FieldId.fromCustomFieldId(10000); // a custom field, full ID: "customfield_1000" FieldId.fromFullId("description"); // a system field FieldId.fromFullId("customfield_1001"); // a custom field with numerial ID 1001Use
toFullId()
to get a full textual form for all the types of fields:
FieldId.fromFullId("summary").toFullId() // => "summary" FieldId.fromCustomFieldId(10000).toFullId() // => "customfield_10000"
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static FieldId |
fromCustomFieldId(long id)
Creates a custom field ID from a numerical ID
|
static FieldId |
fromFullId(String id)
Creates a FieldId from a textual ID in its full format, e.g.
|
long |
getCustomFieldId()
Returns a numerical custom field ID.
|
Long |
getCustomFieldIdOrNull()
Returns a numerical custom field ID or null when it's a system field.
|
int |
hashCode() |
boolean |
isCustomField() |
boolean |
isSystemField() |
String |
toFullId()
Returns full textual ID for the field
|
String |
toString() |
public static FieldId fromCustomFieldId(long id)
IllegalArgumentException
- when ID < 0public static FieldId fromFullId(String id)
NullPointerException
- when given nullNumberFormatException
- when custom field ID is not a numberpublic String toFullId()
public boolean isCustomField()
public boolean isSystemField()
public long getCustomFieldId()
isCustomField()
IllegalStateException
- when the ID is of a system field@Nullable public Long getCustomFieldIdOrNull()
Copyright © 2002-2022 Atlassian. All Rights Reserved.