Package com.skava.oms.util
Class ServiceUtil
java.lang.Object
com.skava.oms.util.ServiceUtil
This class contains common utility functions which are using order process. It's contains only static functions.
- Author:
- Infosys Equinox
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
audit log the fields in the parameter.static String
This method is to get User Id or acting userId from Authenticationstatic String
getDigitGuid
(int maxGuidLen) static String
getMixGuid
(int maxGuidLen) static String
This method is to get User Id from Authenticationstatic String
This method groups the hashmapstatic boolean
isValueNotNull
(CollectionProperties collecProp) static void
setOrderStatusDisplayStatus
(Order order, Map<String, String> orderStatusMap, Map<String, String> orderDisplayStatusMap, String workItemStatus) This method updates orderStatus and orderDisplayStatus based onOrderStatusStrategy
static <K,
V> Map<K, BigDecimal> sumBy
(V[] data, Function<V, K> classifier, Function<V, BigDecimal> sumClassifier) The method sums the data in arraystatic String
static <T> Stream<T>
toStream
(T[] data) The method convertes the stream to array
-
Field Details
-
DEFAULT_BOUND
public static final int DEFAULT_BOUND- See Also:
-
CHAR_BOUND
public static final int CHAR_BOUND- See Also:
-
CHAR_DIGIT_BOUND
public static final int CHAR_DIGIT_BOUND- See Also:
-
DIVIDER
public static final int DIVIDER- See Also:
-
DIGIT_BOUND
public static final int DIGIT_BOUND- See Also:
-
-
Method Details
-
toJSON
-
getUUIDGuid
-
getMixGuid
- Parameters:
maxGuidLen
- maximum length of guid Get current milliseconds and add additional secure random numbers within alpha numerical range to find unique identifiers.- Returns:
- generated GUID Debug logger has been added to this method.
-
getDigitGuid
- Parameters:
maxGuidLen
- maximum length of guid Get current milliseconds and add additional secure random numbers within numerical range to find unique identifiers.- Returns:
- generated random digit GUID Debug logger has been added to this method.
-
groupBy
This method groups the hashmap- Type Parameters:
K
- - key for the listV
- - contains the list- Parameters:
data
- - contains the arrayclassifier
- - the function to be classified- Returns:
- the hashmap which contains the resultant map
-
sumBy
public static <K,V> Map<K,BigDecimal> sumBy(V[] data, Function<V, K> classifier, Function<V, BigDecimal> sumClassifier) The method sums the data in array- Type Parameters:
K
- - contains the listV
- - decimal value- Parameters:
data
- contains the data to be summed upclassifier
- - contains the classifier to sum bysumClassifier
- contains the function to classify- Returns:
- the map
-
toStream
The method convertes the stream to array- Type Parameters:
T
- - contains the list- Parameters:
data
- data to be changed to- Returns:
- the array
-
audit
audit log the fields in the parameter.- Parameters:
fields
- list of fields to be audited
-
getActingUserIdOrUserIDFromAuth
This method is to get User Id or acting userId from Authentication- Returns:
- Current User Id
-
getUserIdFromAuth
This method is to get User Id from Authentication- Returns:
- Current User Id
-
setOrderStatusDisplayStatus
public static void setOrderStatusDisplayStatus(Order order, Map<String, String> orderStatusMap, Map<String, String> orderDisplayStatusMap, String workItemStatus) This method updates orderStatus and orderDisplayStatus based onOrderStatusStrategy
- Parameters:
order
- - order in the floworderStatusMap
- - orderStatusConfiguration for the Order status array.orderDisplayStatusMap
- - order display status configuration for the orderstatusworkItemStatus
- - current status
-
isValueNotNull
- Parameters:
collecProp
-- Returns:
-