public class Property extends Object
Modifier and Type | Field and Description |
---|---|
private PropertyDataType |
dataType |
private boolean |
display |
private PropertyIndexation |
indexation
Pre-parsed values to use for the search queries.
|
private String |
key
The key, in UTF-8
|
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 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 PropertyType type
private String key
private String value
private String searchUrl
private boolean display
private PropertyDataType dataType
@Internal 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 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.