Package io.github.nejckorasa.result
Class CmpPair<B,W>
- java.lang.Object
-
- io.github.nejckorasa.result.CmpPair<B,W>
-
public class CmpPair<B,W> extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <B,W>
CmpPair<B,W>added(Serializable key, W working)
B
getBase()
Diff
getDiff()
Serializable
getKey()
Object
getLatest()
W
getWorking()
static <B,W>
CmpPair<B,W>removed(Serializable key, B base)
String
toString()
static <B,W>
CmpPair<B,W>unchanged(Serializable key, B base)
static <B,W>
CmpPair<B,W>updated(Serializable key, B base, W working)
-
-
-
Method Detail
-
removed
public static <B,W> CmpPair<B,W> removed(Serializable key, B base)
-
updated
public static <B,W> CmpPair<B,W> updated(Serializable key, B base, W working)
-
unchanged
public static <B,W> CmpPair<B,W> unchanged(Serializable key, B base)
-
added
public static <B,W> CmpPair<B,W> added(Serializable key, W working)
-
getKey
public Serializable getKey()
- Returns:
- key that matched base and working objects
-
getBase
public B getBase()
- Returns:
- base object or
null
if object does not exist in base collection
-
getWorking
public W getWorking()
- Returns:
- base object or
null
if object does not exist in working collection
-
getLatest
public Object getLatest()
- Returns:
- latest nonnull object - working is considered latest
-
getDiff
public Diff getDiff()
- Returns:
- difference type between matched base and working objects
-
-