public class IdentifierValue extends Object implements UnsavedValueStrategy
Modifier and Type | Field and Description |
---|---|
static IdentifierValue |
ANY
Always assume the transient instance is newly instantiated
|
static IdentifierValue |
NONE
Never assume the transient instance is newly instantiated
|
static IdentifierValue |
NULL
Assume the transient instance is newly instantiated if the identifier
is null.
|
static IdentifierValue |
UNDEFINED
Assume nothing.
|
Modifier | Constructor and Description |
---|---|
protected |
IdentifierValue() |
|
IdentifierValue(Serializable value)
Assume the transient instance is newly instantiated if
its identifier is null or equal to value
|
Modifier and Type | Method and Description |
---|---|
Serializable |
getDefaultValue(Object currentValue)
Get a default value meant to indicate transience.
|
Boolean |
isUnsaved(Object id)
Does the given identifier belong to a new instance?
|
String |
toString() |
public static final IdentifierValue ANY
public static final IdentifierValue NONE
public static final IdentifierValue NULL
public static final IdentifierValue UNDEFINED
protected IdentifierValue()
public IdentifierValue(Serializable value)
public Boolean isUnsaved(Object id)
isUnsaved
in interface UnsavedValueStrategy
id
- The value to be testedtrue
indicates the value corresponds to unsaved data (aka, transient state); false
indicates the value does not corresponds to unsaved data (aka, detached state); null
indicates that
this strategy was not able to determine conclusively.public Serializable getDefaultValue(Object currentValue)
UnsavedValueStrategy
getDefaultValue
in interface UnsavedValueStrategy
currentValue
- The current state value.Copyright © 2001-2021 Red Hat, Inc. All Rights Reserved.