Package com.core.util.library
Class SCollectionUtil
- java.lang.Object
-
- com.core.util.library.SCollectionUtil
-
public class SCollectionUtil extends java.lang.Object
- Author:
- Sokkheang.huo
-
-
Constructor Summary
Constructors Constructor Description SCollectionUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
changeCheck(Solo target, Solo source)
compare the target MData with the source MDatastatic void
merge(SList target, Solo source, boolean keyExistOverrideFlag)
Merge MData into MMultiData.static void
merge(Solo target, Solo source)
Update target MData with source MData.static void
merge(Solo target, Solo source, java.lang.String option)
Update the target MData with the source MData based on the specified option , and add the missing value to the target MData.
-
-
-
Field Detail
-
NOT_NULL
public static final java.lang.String NOT_NULL
- See Also:
- Constant Field Values
-
NOT_EMPTY
public static final java.lang.String NOT_EMPTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
merge
public static void merge(SList target, Solo source, boolean keyExistOverrideFlag) throws SoloException
Merge MData into MMultiData.
HOW TO : MRCollectionUtil.merge(target, source, false) ex) [target] key1=[111, 222] key2=[111, 222] [source] key3=[111] [result-target] key1=[111, 222] key2=[111, 222] key3=[111]- Parameters:
target
- MDatasource
- MDatakeyExistOverrideFlag
- blean - true : If the key of the source exists in the target, it deletes the key of the existing target and adds it. -false : If the source key exists in the target, it is added to the key of the existing target.- Throws:
SoloException
-
merge
public static void merge(Solo target, Solo source) throws SoloException
Update target MData with source MData. Add the missing value to the target MData.
HOW TO : MRCollectionUtil.merge(target, source); ex) [target] key1=["a", "aa"] key2=["b", "bb"] key3=["c", "cc"] key1=["a", "aaa"] [result-target] key1=["a", "aaa"] key2=["b", "bb"] key3=["c", "cc"]- Parameters:
target
- MDatasource
- MData- Throws:
SoloException
-
merge
public static void merge(Solo target, Solo source, java.lang.String option) throws SoloException
Update the target MData with the source MData based on the specified option , and add the missing value to the target MData.
option : "NOT NULL" : Do not copy when the value corresponding to a specific key of source is NULL "NOT EMPTY" : Do not copy when the value of a specific key in source is NULL or returns true for isEmpty HOW TO : MRCollectionUtil.merge(target, source, "NOT NULL"); ex) [target] key1=["a", "aa"] key2=["b", "bb"] key3=["c", new BigDecimal(100)] [source] key1=["a", "aa2"] key2=["b", "bb"] key3=["c", ""] [result-target] key1=["a", "aa2"] key2=["b", "bb"] key3=["c", ""]- Parameters:
target
-source
-option
-- Throws:
SoloException
-
changeCheck
public static boolean changeCheck(Solo target, Solo source) throws SoloException
compare the target MData with the source MData
HOW TO : MRCollectionUtil.changeCheck(target, source); ex1) [target] key1=["a", "aa"] key2=["b", "bb"] key3=["c", new BigDecimal(100)] [source] key1=["a", "aa2"] key2=["b", "bb"] key3=["c", ""] [result-target] true ex2) [target] key1=["a", "aa"] [source] key1=["a", "aa"] key2=["b", "bb"] key3=["c", ""] [result-target] false- Parameters:
target
-source
-- Returns:
- boolean
- Throws:
SoloException
-
-