public class StateHelper extends Object
State
objects.Modifier and Type | Method and Description |
---|---|
static List<Serializable> |
deepCopy(List<Serializable> list)
Makes a deep copy of a
List . |
static List<Serializable> |
deepCopy(List<Serializable> list,
boolean threadSafe)
Makes a deep copy of a
List , optionally thread-safe. |
static Serializable |
deepCopy(Object value)
Makes a deep copy of a value.
|
static Serializable |
deepCopy(Object value,
boolean threadSafe)
Makes a deep copy of a value, optionally thread-safe.
|
static State |
deepCopy(State state)
Makes a deep copy of a
State map. |
static State |
deepCopy(State state,
boolean threadSafe)
Makes a deep copy of a
State map, optionally thread-safe. |
static Serializable |
diff(List<Object> a,
List<Object> b) |
static Serializable |
diff(Object[] a,
Object[] b) |
static Serializable |
diff(Object a,
Object b)
Does a diff of two values.
|
static State.StateDiff |
diff(State a,
State b)
Makes a diff copy of two
State maps. |
static boolean |
equalsLoose(List<Serializable> a,
List<Serializable> b)
Compares two
List s. |
static boolean |
equalsLoose(Object[] a,
Object[] b)
Compares two arrays of scalars.
|
static boolean |
equalsLoose(Object a,
Object b)
Compares two values.
|
static boolean |
equalsLoose(State a,
State b)
Compares two
State s. |
static boolean |
equalsStrict(List<Serializable> a,
List<Serializable> b)
Compares two
List s. |
static boolean |
equalsStrict(Object[] a,
Object[] b)
Compares two arrays of scalars.
|
static boolean |
equalsStrict(Object a,
Object b)
Compares two values.
|
static boolean |
equalsStrict(State a,
State b)
Compares two
State s. |
static boolean |
isScalar(Object value)
Checks if we have a base type compatible with
State helper processing. |
static void |
resetDeltas(State state)
Changes the deltas stored into actual full values.
|
public static boolean isScalar(Object value)
State
helper processing.public static boolean equalsStrict(Object a, Object b)
public static boolean equalsStrict(State a, State b)
State
s.public static boolean equalsStrict(Object[] a, Object[] b)
public static boolean equalsStrict(List<Serializable> a, List<Serializable> b)
List
s.public static boolean equalsLoose(Object a, Object b)
public static boolean equalsLoose(State a, State b)
public static boolean equalsLoose(Object[] a, Object[] b)
null
values are equivalent to empty arrays.
public static boolean equalsLoose(List<Serializable> a, List<Serializable> b)
List
s.
null
values are equivalent to empty lists.
public static Serializable deepCopy(Object value)
public static Serializable deepCopy(Object value, boolean threadSafe)
threadSafe
- if true
, then thread-safe datastructures are usedpublic static State deepCopy(State state, boolean threadSafe)
State
map, optionally thread-safe.threadSafe
- if true
, then thread-safe datastructures are usedpublic static List<Serializable> deepCopy(List<Serializable> list)
List
.public static List<Serializable> deepCopy(List<Serializable> list, boolean threadSafe)
List
, optionally thread-safe.threadSafe
- if true
, then thread-safe datastructures are usedpublic static Serializable diff(Object a, Object b)
State.StateDiff
, a State.ListDiff
, #NOP
, or an actual value (including null
)public static Serializable diff(Object[] a, Object[] b)
public static State.StateDiff diff(State a, State b)
State
maps.
The returned diff state contains only the key/values that changed. null
values are equivalent to absent
values.
For values set to null or removed, the value is null.
For sub-documents, a recursive diff is returned.
State.StateDiff
which, when applied to a, gives b.public static void resetDeltas(State state)
Copyright © 2015 Nuxeo SA. All rights reserved.