Class Structure
java.lang.Object
com.polarion.platform.persistence.spi.Structure
- All Implemented Interfaces:
IChangeGenerator
,IChangeListener
,IHasCustomValues
,IHasValues
,IStructure
This implementation is not thread safe.
- Author:
- dobisekm
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
getCustomField
(String key) Shortcut forICustomFieldsService.getCustomField(key, getProtoName(), getContextId())
IEnumeration<?>
getEnumeration
(String forKey) Returns theIEnumeration
if this one was registered for specific key ornull
.getEnumerationOptionForField
(String key, String value) Returns wrapped enumeration option for given field.This is the low level access method designed for backend implementation.Returns the wrapped value.int
hashCode()
boolean
boolean
boolean
isReadOnly
(String key) void
void
setChangeOwner
(IChangeListener owner) Sets the new owner to send the dirty status to.void
setCustomField
(String key, Object value) Sets the value of the given custom field.void
setSecurityReferee
(ISecurityReferee securityReferee) void
toString()
-
Constructor Details
-
Structure
public Structure(@NotNull IPObject pobject, @NotNull IStructType prototype, boolean readOnly, @NotNull Map<String, Object> data) - Since:
- 3.1.2
-
-
Method Details
-
getPObject
- Since:
- 3.5
-
getRawData
This is the low level access method designed for backend implementation. It should not be called by clients. -
getPrototype
- Specified by:
getPrototype
in interfaceIStructure
-
getValue
Description copied from interface:IStructure
Returns the wrapped value.- Specified by:
getValue
in interfaceIHasValues
- Specified by:
getValue
in interfaceIStructure
-
setValue
- Specified by:
setValue
in interfaceIHasValues
- Specified by:
setValue
in interfaceIStructure
-
isReadOnly
public boolean isReadOnly()- Specified by:
isReadOnly
in interfaceIStructure
- Returns:
true
if the whole structure is read-only,false
otherwise.- See Also:
-
isReadOnly
- Specified by:
isReadOnly
in interfaceIStructure
- Returns:
true
if the whole structure is read-only or if the given key is defined and is read-only,false
otherwise.- See Also:
-
markChanged
public void markChanged()- Specified by:
markChanged
in interfaceIChangeListener
-
isModified
public boolean isModified()- Specified by:
isModified
in interfaceIStructure
- Returns:
True
is this object was modified since it's load,false
otherwise.
-
setChangeOwner
Description copied from interface:IChangeGenerator
Sets the new owner to send the dirty status to.- Specified by:
setChangeOwner
in interfaceIChangeGenerator
- Parameters:
owner
- The actual owner ornull
to remove owner.
-
getEnumeration
Description copied from interface:IStructure
Returns theIEnumeration
if this one was registered for specific key ornull
.This is a convenience method, which calls the appropriate method on the
IDataService
- Specified by:
getEnumeration
in interfaceIStructure
- Parameters:
forKey
- the key of some field of the structure- Returns:
- the enumeration factory or
null
-
getEnumerationOptionForField
@Nullable public IEnumOption getEnumerationOptionForField(@NotNull String key, @Nullable String value) Description copied from interface:IStructure
Returns wrapped enumeration option for given field.- Specified by:
getEnumerationOptionForField
in interfaceIStructure
- Parameters:
key
- field name (notnull
)value
- option id- Returns:
- wrapped option (
null
if and only ifoptionId
isnull
) - See Also:
-
getEnumerationTypeForField
- Specified by:
getEnumerationTypeForField
in interfaceIStructure
- Returns:
- the Optional of
IEnumType
for the given field if it is of enum or multi-enum type, otherwise returns Optional.empty().
-
equals
-
toString
-
hashCode
public int hashCode() -
setSecurityReferee
-
getContextId
- Since:
- 3.6.3
-
getCustomField
- Specified by:
getCustomField
in interfaceIHasCustomValues
- Parameters:
key
- The value of the given custom field ornull
if no such value exists.
-
setCustomField
Description copied from interface:IHasCustomValues
Sets the value of the given custom field. The value type must be checked against the custom field configuration. If the field configuration does not exist, only theString
value is accepted.- Specified by:
setCustomField
in interfaceIHasCustomValues
-
getCustomFieldsList
- Specified by:
getCustomFieldsList
in interfaceIHasCustomValues
- Returns:
- Collection of
String
names of custom fields, which are defined for this object or exist on this object.
-
getCustomFieldPrototype
Description copied from interface:IHasCustomValues
Shortcut forICustomFieldsService.getCustomField(key, getProtoName(), getContextId())
- Specified by:
getCustomFieldPrototype
in interfaceIHasCustomValues
- See Also:
-