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 TypeMethodDescriptionbooleangetCustomField(String key) Shortcut forICustomFieldsService.getCustomField(key, getProtoName(), getContextId())IEnumeration<?>getEnumeration(String forKey) Returns theIEnumerationif 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.inthashCode()booleanbooleanbooleanisReadOnly(String key) voidvoidsetChangeOwner(IChangeListener owner) Sets the new owner to send the dirty status to.voidsetCustomField(String key, Object value) Sets the value of the given custom field.voidsetSecurityReferee(ISecurityReferee securityReferee) voidtoString()
-
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:
getPrototypein interfaceIStructure
-
getValue
Description copied from interface:IStructureReturns the wrapped value.- Specified by:
getValuein interfaceIHasValues- Specified by:
getValuein interfaceIStructure
-
setValue
- Specified by:
setValuein interfaceIHasValues- Specified by:
setValuein interfaceIStructure
-
isReadOnly
public boolean isReadOnly()- Specified by:
isReadOnlyin interfaceIStructure- Returns:
trueif the whole structure is read-only,falseotherwise.- See Also:
-
isReadOnly
- Specified by:
isReadOnlyin interfaceIStructure- Returns:
trueif the whole structure is read-only or if the given key is defined and is read-only,falseotherwise.- See Also:
-
markChanged
public void markChanged()- Specified by:
markChangedin interfaceIChangeListener
-
isModified
public boolean isModified()- Specified by:
isModifiedin interfaceIStructure- Returns:
Trueis this object was modified since it's load,falseotherwise.
-
setChangeOwner
Description copied from interface:IChangeGeneratorSets the new owner to send the dirty status to.- Specified by:
setChangeOwnerin interfaceIChangeGenerator- Parameters:
owner- The actual owner ornullto remove owner.
-
getEnumeration
Description copied from interface:IStructureReturns theIEnumerationif this one was registered for specific key ornull.This is a convenience method, which calls the appropriate method on the
IDataService- Specified by:
getEnumerationin 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:IStructureReturns wrapped enumeration option for given field.- Specified by:
getEnumerationOptionForFieldin interfaceIStructure- Parameters:
key- field name (notnull)value- option id- Returns:
- wrapped option (
nullif and only ifoptionIdisnull) - See Also:
-
getEnumerationTypeForField
- Specified by:
getEnumerationTypeForFieldin interfaceIStructure- Returns:
- the Optional of
IEnumTypefor 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:
getCustomFieldin interfaceIHasCustomValues- Parameters:
key- The value of the given custom field ornullif no such value exists.
-
setCustomField
Description copied from interface:IHasCustomValuesSets 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 theStringvalue is accepted.- Specified by:
setCustomFieldin interfaceIHasCustomValues
-
getCustomFieldsList
- Specified by:
getCustomFieldsListin interfaceIHasCustomValues- Returns:
- Collection of
Stringnames of custom fields, which are defined for this object or exist on this object.
-
getCustomFieldPrototype
Description copied from interface:IHasCustomValuesShortcut forICustomFieldsService.getCustomField(key, getProtoName(), getContextId())- Specified by:
getCustomFieldPrototypein interfaceIHasCustomValues- See Also:
-