public abstract class ParameterValueData<T> extends BasicData
Modifier and Type | Field and Description |
---|---|
private String |
description |
private String |
label |
private boolean |
masked |
static int |
MAX_DESCRIPTION_LENGTH
The maximum length of the description of the parameter that can be
stored in the database.
|
static int |
MAX_LABEL_LENGTH
The maximum length of the label of the parameter that can be
stored in the database.
|
private List<T> |
oldValues |
Constructor and Description |
---|
ParameterValueData() |
ParameterValueData(T... values) |
Modifier and Type | Method and Description |
---|---|
String |
getDescription()
Get the description of the parameter.
|
String |
getLabel()
Get the label of the parameter.
|
List<T> |
getOldValues()
Get the old values that has been replaced by new values in this session.
|
abstract List<T> |
getValues()
Get values of this parameter.
|
abstract int |
getValueType()
Get the type of parameter values that are store in this parameter.
|
boolean |
isMasked()
A flag indicating if the value should be masked when
displayed in client applications (eg. since it may be a password)
NOTE!
|
boolean |
replaceValuesIfDifferent(List<?> values)
Replace the values in the database with the new
values in the specified list.
|
void |
setDescription(String description) |
void |
setLabel(String label) |
void |
setMasked(boolean masked) |
boolean |
setSingleValueIfDifferent(Object value)
Replace the current list with a single new value.
|
(package private) abstract void |
setValues(List<T> values)
Set values of this parameter.
|
protected void |
storeCurrentValuesAsOld(List<T> current)
Store the current values as old values, except
if there are no current values or if old values
have already been stored.
|
equals, getId, getVersion, hashCode, setId, setVersion, toString
public static final int MAX_LABEL_LENGTH
setLabel(String)
,
Constant Field Valuesprivate String label
public static final int MAX_DESCRIPTION_LENGTH
setDescription(String)
,
Constant Field Valuesprivate String description
private boolean masked
ParameterValueData()
@SafeVarargs ParameterValueData(T... values)
public String getLabel()
public void setLabel(String label)
public String getDescription()
public void setDescription(String description)
public boolean isMasked()
public void setMasked(boolean masked)
public abstract int getValueType()
Type.getValue()
values, or 0 if the parameter has no corresponding type.Type
enumeration
or 0public abstract List<T> getValues()
abstract void setValues(List<T> values)
NOTE! Used by Hibernate to initialize the object. Do not
call AnnotationData.setLastUpdate(java.util.Date)
!
values
- Collection of values.public boolean replaceValuesIfDifferent(List<?> values)
NOTE! When this method is called to set annotation values
for an AnnotationData
, don't forget to also update
the last update timestamp: AnnotationData.setLastUpdate(java.util.Date)
.
and to invalidate the annotation set snapshot: AnnotationSet.setSnapshotInvalid()
public boolean setSingleValueIfDifferent(Object value)
NOTE! When this method is called to set annotation values
for an AnnotationData
, don't forget to also update
the last update timestamp: AnnotationData.setLastUpdate(java.util.Date)
.
and to invalidate the annotation set snapshot: AnnotationSet.setSnapshotInvalid()
protected void storeCurrentValuesAsOld(List<T> current)