Package com.skava.subscription.model
Class CommonUtil
java.lang.Object
com.skava.subscription.model.CommonUtil
The Class CommonUtil
- Since:
- March 2022
- Version:
- 8.11
- Author:
- Infosys Equinox
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getAttributeName
(String attributeName) static String
static com.fasterxml.jackson.databind.ObjectMapper
static SkuProperty
getSkuPropertyObj
(String keyStr, Object valueStr, String locale) static long
getTimeInMilliSeconds
(String formattedDate, String dateFormatterPattern) static long
getTimeInMilliSeconds
(String formattedDate, String dateFormatterPattern, String timeZone) static boolean
Checks if the given user is guest or notstatic Boolean
static boolean
This method will check the value is number or notstatic boolean
isValidDecimalTypeID
(Object obj, boolean isNullable) static boolean
isValidFieldStr
(Object strObj, int minLength, boolean isNullable) This method will check whether the field is valid string or notstatic boolean
isValidFieldStr
(Object strObj, int minLength, int maxLength, boolean isNullable) static boolean
isValidLongTypeID
(Object obj, boolean isNullable) static boolean
isValidMapObject
(Map<String, String> mapObject) This method will check the valid map object or notstatic boolean
isValidNumericID
(Object obj, boolean isNullable) This method will check valid numeric id or notstatic void
setException
(String responseCode, String responseMsg, List<CommonResponseModel> errorModel) This method is used to set exceptionstatic void
setKafkaResponseData
(org.apache.camel.Exchange exchange, String performedActionName, String partitionKey, String publishConnectionStr) This method will set the kafka response data
-
Method Details
-
setException
public static void setException(String responseCode, String responseMsg, List<CommonResponseModel> errorModel) This method is used to set exception- Parameters:
responseCode
- responseCoderesponseMsg
- responseMsgerrorModel
- errorModel
-
isValidFieldStr
This method will check whether the field is valid string or not- Parameters:
strObj
- strObjminLength
- minLengthisNullable
- isNullable- Returns:
- true or false
-
isValidFieldStr
public static boolean isValidFieldStr(Object strObj, int minLength, int maxLength, boolean isNullable) - Parameters:
strObj
- strObjminLength
- minLengthmaxLength
- maxLengthisNullable
- isNullable- Returns:
- true or false
-
isValidLongTypeID
- Parameters:
obj
- objectisNullable
- isNullable- Returns:
- true or false
-
isValidNumericID
This method will check valid numeric id or not- Parameters:
obj
- objectisNullable
- isNullable- Returns:
- true or false
-
isValidDecimalTypeID
- Parameters:
obj
- objectisNullable
- isNullable- Returns:
- true or false
-
isNumeric
This method will check the value is number or not- Parameters:
strNum
- strNum- Returns:
- true or false
-
getConfiguredObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper getConfiguredObjectMapper()- Returns:
- ObjectMapper
-
getSkuPropertyObj
- Parameters:
keyStr
- keyStrvalueStr
- valueStrlocale
- locale- Returns:
- sku property
-
setKafkaResponseData
public static void setKafkaResponseData(org.apache.camel.Exchange exchange, String performedActionName, String partitionKey, String publishConnectionStr) This method will set the kafka response data- Parameters:
exchange
- exchangeperformedActionName
- performedActionNamepartitionKey
- partitionKeypublishConnectionStr
- publishConnectionStr
-
isGuest
Checks if the given user is guest or not- Parameters:
users
- describes users details- Returns:
- to return boolean values
-
isValidMapObject
This method will check the valid map object or not- Parameters:
mapObject
- mapObject- Returns:
- true or false
-
isNonNullAndEmptyStr
- Parameters:
str
- string- Returns:
- true or false
-
getBooleanValueAsStr
- Parameters:
obj
- object- Returns:
- string
-
getAttributeName
- Parameters:
attributeName
- attributeName- Returns:
- attributeName
-
getTimeInMilliSeconds
- Parameters:
formattedDate
- formattedDatedateFormatterPattern
- dateFormatterPattern- Returns:
- time
-
getTimeInMilliSeconds
public static long getTimeInMilliSeconds(String formattedDate, String dateFormatterPattern, String timeZone) - Parameters:
formattedDate
- formattedDatedateFormatterPattern
- dateFormatterPatterntimeZone
- timeZone- Returns:
- time in milliseconds
-