Class SynchronizableValue
- java.lang.Object
-
- org.ametys.plugins.repository.data.holder.values.SynchronizableValue
-
public class SynchronizableValue extends Object
Wrapper for a synchronizable value Contains the value itself and indicates if it is the external value
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SynchronizableValue.Mode
The value write mode.
-
Constructor Summary
Constructors Constructor Description SynchronizableValue(Object localValue)
Constructor.SynchronizableValue(Object value, ExternalizableDataProvider.ExternalizableDataStatus valueStatus)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<DataComment>
getComments()
Retrieves the comments associated with the valueExternalizableDataProvider.ExternalizableDataStatus
getExternalizableStatus()
Retrieves the externalizable status of the value Ifnull
, the status of the value won't be updatedObject
getExternalValue()
Retrieves the external valueObject
getLocalValue()
Retrieves the synchronizable local valueSynchronizableValue.Mode
getMode()
Retrieves the write mode for the valueObject
getValue(Optional<ExternalizableDataProvider.ExternalizableDataStatus> status)
Retrieves the value of the given statusvoid
setComments(List<DataComment> comments)
Set the comments associated to the valuevoid
setExternalizableStatus(ExternalizableDataProvider.ExternalizableDataStatus externalizableDataStatus)
Sets the externalizable status of the value If not set, the status of the value won't be updatedvoid
setExternalValue(Object externalValue)
Sets the external valuevoid
setLocalValue(Object localValue)
Sets the synchronizable local valuevoid
setMode(SynchronizableValue.Mode mode)
Set the write mode for the value
-
-
-
Constructor Detail
-
SynchronizableValue
public SynchronizableValue(Object localValue)
Constructor.- Parameters:
localValue
- the actual local value.
-
SynchronizableValue
public SynchronizableValue(Object value, ExternalizableDataProvider.ExternalizableDataStatus valueStatus)
Constructor- Parameters:
value
- the actual valuevalueStatus
- the status of the given value (not the status of the object itself)
-
-
Method Detail
-
getLocalValue
public Object getLocalValue()
Retrieves the synchronizable local value- Returns:
- the synchronizable local value
-
setLocalValue
public void setLocalValue(Object localValue)
Sets the synchronizable local value- Parameters:
localValue
- the synchronizable local value to set
-
getExternalValue
public Object getExternalValue()
Retrieves the external value- Returns:
- the external value
-
setExternalValue
public void setExternalValue(Object externalValue)
Sets the external value- Parameters:
externalValue
- the external value to set
-
getValue
public Object getValue(Optional<ExternalizableDataProvider.ExternalizableDataStatus> status)
Retrieves the value of the given status- Parameters:
status
- the status- Returns:
- the value of the given status
-
getExternalizableStatus
public ExternalizableDataProvider.ExternalizableDataStatus getExternalizableStatus()
Retrieves the externalizable status of the value Ifnull
, the status of the value won't be updated- Returns:
- the externalizable status of the value
-
setExternalizableStatus
public void setExternalizableStatus(ExternalizableDataProvider.ExternalizableDataStatus externalizableDataStatus)
Sets the externalizable status of the value If not set, the status of the value won't be updated- Parameters:
externalizableDataStatus
- the status to set
-
getComments
public List<DataComment> getComments()
Retrieves the comments associated with the value- Returns:
- the comments associated with the value
-
setComments
public void setComments(List<DataComment> comments)
Set the comments associated to the value- Parameters:
comments
- the comment
-
getMode
public SynchronizableValue.Mode getMode()
Retrieves the write mode for the value- Returns:
- the write mode for the value
-
setMode
public void setMode(SynchronizableValue.Mode mode)
Set the write mode for the value- Parameters:
mode
- the write mode
-
-