public class Property extends Object
Modifier and Type | Field and Description |
---|---|
private PropertyDataType |
dataType
The type when searching or performing aggregations.
|
private boolean |
display
If false, the property is not displayed to the user.
|
private PropertyIndexation |
indexation
Pre-parsed values to use for the search queries.
|
private String |
key
The key, in UTF-8
|
private static com.atlassian.extras.common.log.Logger.Log |
log |
private String |
searchUrl
The search url (without the context path) if one wants to search by this property.
|
private PropertyType |
type
Type of the property, a property can be INLINE (created in a page)
or EXTERNAL, created in the RY pages
Note: Legacy properties (before v3.0.0) are INLINE
|
private String |
value
Value, as HTML.
|
Constructor and Description |
---|
Property() |
Property(PropertyType type,
String key,
String value) |
Property(PropertyType type,
String key,
String value,
PropertyIndexation indexation)
Constructor for people who use the ExternalPropertiesAPI
|
Property(PropertyType type,
String keyXml,
String value,
String indexationJson,
PropertyDataType dataType)
Constructor for a Property.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
PropertyDataType |
getDataType() |
PropertyIndexation |
getIndexation() |
String |
getKey()
The (unescpaed) key.
|
String |
getSearchUrl() |
PropertyType |
getType() |
String |
getValue()
Returns the HTML value.
|
String |
getValueAsText()
Returns the value of a property, but only after converting emojis to text
|
int |
hashCode() |
boolean |
isDisplay() |
void |
setDataType(PropertyDataType dataType) |
void |
setDisplay(boolean display) |
void |
setKey(String key)
The key.
|
void |
setSearchUrl(RequirementKey requirement)
A "simple property" has a key:
- single word
- Only letters and numbers
- <80 characters
- A value between 1 and 100 characters
and a non-blank value.
|
void |
setType(PropertyType type) |
void |
setValue(String value) |
String |
toString() |
private static final com.atlassian.extras.common.log.Logger.Log log
private PropertyType type
private String key
private String value
private String searchUrl
private boolean display
private PropertyDataType dataType
private PropertyIndexation indexation
public Property()
public Property(PropertyType type, String key, String value)
public Property(PropertyType type, String keyXml, String value, String indexationJson, PropertyDataType dataType)
type
- use Type.AUTO. We haven't implemented custom properties.keyXml
- the key. It is expected to be xml-encoded because this constructor generally takes data coming from
DBProperty; and the constructor will decode it to set the internal 'key' property in UTF-8.value
- the value, HTML-encoded. It is cleaned from any script/vulnerability before being stored in the DB.indexationJson
- a json string representing a PropertyIndexation object, or null if unset.dataType
- a PropertyDataType
for value validation
Note: this constructor does not compute userMentions from indexationJson. In practical, userMentions are filled when serializing this class with Json.
public Property(PropertyType type, String key, String value, PropertyIndexation indexation)
type
- must be PropertyType.EXTERNALkey
- the name of the propertyvalue
- the HTML for this propertyindexation
- the indexation for this property. Please use PropertyIndexation.indexAsText() in general.public PropertyType getType()
public void setType(PropertyType type)
public String getKey()
public void setKey(String key)
public String getValue()
if you need to use it for text
public String getValueAsText()
public void setValue(String value)
public String getSearchUrl()
public PropertyDataType getDataType()
public void setDataType(PropertyDataType dataType)
public void setSearchUrl(RequirementKey requirement)
public boolean isDisplay()
public void setDisplay(boolean display)
public PropertyIndexation getIndexation()
Copyright © 2021 Play SQL. All rights reserved.