interface EntityProperties
Type | Name and description |
---|---|
java.lang.String |
asActualType |
java.lang.String |
boolean |
java.lang.String |
integer |
java.lang.String |
json |
java.lang.String |
localDate |
java.lang.String |
localDateTime |
java.lang.String |
long |
java.lang.String |
string |
Type Params | Return Type | Name and description |
---|---|---|
|
abstract void |
delete(java.lang.String key) Deletes an entity property. |
<T> |
abstract T |
getAsActualType(java.lang.String key, java.lang.Class<T> valueType) Gets an entity property of a specific type of choice. |
|
abstract java.lang.Boolean |
getBoolean(java.lang.String key) Gets an entity property of type *Boolean*. |
|
abstract com.atlassian.jira.rest.clientv3.model.EntityProperty |
getEntityProperty(java.lang.String key) Gets an entity property as an EntityProperty object. |
|
abstract java.lang.Integer |
getInteger(java.lang.String key) Gets an entity property of type *Integer*. |
|
abstract java.lang.String |
getJson(java.lang.String key) Gets the value of an entity property as a json String. |
|
abstract java.util.List<java.lang.String> |
getKeys() |
|
abstract java.time.LocalDate |
getLocalDate(java.lang.String key) Gets an entity property of type *LocalDate*. |
|
abstract java.time.LocalDateTime |
getLocalDateTime(java.lang.String key) Gets an entity property of type *LocalDateTime*. |
|
abstract java.lang.Long |
getLong(java.lang.String key) Gets an entity property of type *Long*. |
|
abstract java.lang.String |
getString(java.lang.String key) Gets an entity property of type *String*. |
|
abstract boolean |
propertyExists(java.lang.String key) Returns true or false based on whether an entity property with such key exists. |
|
abstract void |
setAsActualType(java.lang.String key, java.lang.Object value) Sets an entity property to the json representation of any object. |
|
abstract void |
setBoolean(java.lang.String key, java.lang.Boolean bool) Sets an entity property of type *Boolean* (serialized as json). |
|
abstract void |
setInteger(java.lang.String key, java.lang.Integer integer) Sets an entity property of type *Integer* (serialized as json). |
|
abstract void |
setJson(java.lang.String key, java.lang.String json) Sets the value of an entity property as a json String. |
|
abstract void |
setLocalDate(java.lang.String key, java.time.LocalDate localDate) Sets an entity property of type *LocalDate* (serialized as a json). |
|
abstract void |
setLocalDateTime(java.lang.String key, java.time.LocalDateTime localDateTime) Sets an entity property of type *LocalDateTime* (serialized as a json). |
|
abstract void |
setLong(java.lang.String key, java.lang.Long along) Sets an entity property of type *Long* (serialized as json). |
|
abstract void |
setString(java.lang.String key, java.lang.String value) Sets an entity property of type *String* (serialized as json). |
Deletes an entity property.
Usage Example:
entityProperty.delete("myProperty")
key
- the key of the entity property to be deletedGets an entity property of a specific type of choice. The entity property should be deserializable into the specified class, otherwise this method will throw a deserialization exception.
Usage Example:
// for a property whose value was ["car", "bus", "bike"]
entityProperty.getAsActualType("myProperty", List<String>)
key
- the key of the entity propertyvalueType
- the Class to serialize the value of the entity property intoGets an entity property of type *Boolean*.
Usage Example:
entityProperty.getBoolean("myProperty")
key
- the key of the entity propertyGets an entity property as an EntityProperty object.
Usage Example:
entityProperty.getEntityProperty("myProperty")
key
- the key of the entity propertyGets an entity property of type *Integer*.
Usage Example:
entityProperty.getInteger("myProperty")
key
- the key of the entity propertyGets the value of an entity property as a json String.
Usage Example:
entityProperty.getJson("myProperty")
key
- the key of the entity propertyGets an entity property of type *LocalDate*.
Usage Example:
entityProperty.getLocalDate("myProperty")
key
- the key of the entity propertyGets an entity property of type *LocalDateTime*.
Usage Example:
entityProperty.getLocalDateTime("myProperty")
key
- the key of the entity propertyGets an entity property of type *Long*.
Usage Example:
entityProperty.getLong("myProperty")
key
- the key of the entity propertyGets an entity property of type *String*.
Usage Example:
entityProperty.getString("myProperty")
key
- the key of the entity propertyReturns true or false based on whether an entity property with such key exists.
Usage Example:
entityProperty.setString("myProperty", "Something to be stored as a property")
entityProperty.propertyExists("myProperty") // returns: true
key
- the key of the entity propertySets an entity property to the json representation of any object. If an entity property with such key already exists, it will be overwritten.
Usage Example:
def vehicles = ["car", "bus", "bike"]
entityProperty.setActualType("myProperty", vehicles)
key
- the key of the entity propertyvalue
- the value of the entity propertySets an entity property of type *Boolean* (serialized as json). If an entity property with such key already exists, it will be overwritten.
Usage Example:
entityProperty.setBoolean("myProperty", true)
key
- the key of the entity propertyvalue
- the value of the entity propertySets an entity property of type *Integer* (serialized as json). If an entity property with such key already exists, it will be overwritten.
Usage Example:
entityProperty.setInteger("myProperty", "5")
key
- the key of the entity propertyvalue
- the value of the entity propertySets the value of an entity property as a json String.
Usage Example:
import com.fasterxml.jackson.databind.ObjectMapper
def json = [
detailOne: "a detail",
detailTwo: "another detail"
]
def ObjectMapper objectMapper = new ObjectMapper()
def String jsonString = objectMapper.writeValueAsString(json)
entityProperty.setJson("myProperty", jsonString)
key
- the key of the entity propertyjson
- the value of the entity property as a valid json StringSets an entity property of type *LocalDate* (serialized as a json). If an entity property with such key already exists, it will be overwritten.
Usage Example:
import java.time.LocalDate
entityProperty.setLocalDate("myProperty", LocalDate.now())
key
- the key of the entity propertyvalue
- the value of the entity propertySets an entity property of type *LocalDateTime* (serialized as a json). If an entity property with such key already exists, it will be overwritten.
Usage Example:
import java.time.LocalDateTime
entityProperty.setLocalDate("myProperty", LocalDateTime.now())
key
- the key of the entity propertyvalue
- the value of the entity propertySets an entity property of type *Long* (serialized as json). If an entity property with such key already exists, it will be overwritten.
Usage Example:
entityProperty.setLong("myProperty", "3L")
key
- the key of the entity propertyvalue
- the value of the entity propertySets an entity property of type *String* (serialized as json). If an entity property with such key already exists, it will be overwritten.
Usage Example:
entityProperty.setString("myProperty", "Something to be stored as a property")
key
- the key of the entity propertyvalue
- the value of the entity property