Class CommonUtil

java.lang.Object
com.skava.subscription.model.CommonUtil

public final class CommonUtil extends Object
The Class CommonUtil
Since:
March 2022
Version:
8.11
Author:
Infosys Equinox
  • Method Details

    • setException

      public static void setException(String responseCode, String responseMsg, List<CommonResponseModel> errorModel)
      This method is used to set exception
      Parameters:
      responseCode - responseCode
      responseMsg - responseMsg
      errorModel - errorModel
    • isValidFieldStr

      public static boolean isValidFieldStr(Object strObj, int minLength, boolean isNullable)
      This method will check whether the field is valid string or not
      Parameters:
      strObj - strObj
      minLength - minLength
      isNullable - isNullable
      Returns:
      true or false
    • isValidFieldStr

      public static boolean isValidFieldStr(Object strObj, int minLength, int maxLength, boolean isNullable)
      Parameters:
      strObj - strObj
      minLength - minLength
      maxLength - maxLength
      isNullable - isNullable
      Returns:
      true or false
    • isValidLongTypeID

      public static boolean isValidLongTypeID(Object obj, boolean isNullable)
      Parameters:
      obj - object
      isNullable - isNullable
      Returns:
      true or false
    • isValidNumericID

      public static boolean isValidNumericID(Object obj, boolean isNullable)
      This method will check valid numeric id or not
      Parameters:
      obj - object
      isNullable - isNullable
      Returns:
      true or false
    • isValidDecimalTypeID

      public static boolean isValidDecimalTypeID(Object obj, boolean isNullable)
      Parameters:
      obj - object
      isNullable - isNullable
      Returns:
      true or false
    • isNumeric

      public static boolean isNumeric(String strNum)
      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

      public static SkuProperty getSkuPropertyObj(String keyStr, Object valueStr, String locale)
      Parameters:
      keyStr - keyStr
      valueStr - valueStr
      locale - 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 - exchange
      performedActionName - performedActionName
      partitionKey - partitionKey
      publishConnectionStr - publishConnectionStr
    • isGuest

      public static boolean isGuest(Users users)
      Checks if the given user is guest or not
      Parameters:
      users - describes users details
      Returns:
      to return boolean values
    • isValidMapObject

      public static boolean isValidMapObject(Map<String,String> mapObject)
      This method will check the valid map object or not
      Parameters:
      mapObject - mapObject
      Returns:
      true or false
    • isNonNullAndEmptyStr

      public static Boolean isNonNullAndEmptyStr(String str)
      Parameters:
      str - string
      Returns:
      true or false
    • getBooleanValueAsStr

      public static String getBooleanValueAsStr(Object obj)
      Parameters:
      obj - object
      Returns:
      string
    • getAttributeName

      public static String getAttributeName(String attributeName)
      Parameters:
      attributeName - attributeName
      Returns:
      attributeName
    • getTimeInMilliSeconds

      public static long getTimeInMilliSeconds(String formattedDate, String dateFormatterPattern)
      Parameters:
      formattedDate - formattedDate
      dateFormatterPattern - dateFormatterPattern
      Returns:
      time
    • getTimeInMilliSeconds

      public static long getTimeInMilliSeconds(String formattedDate, String dateFormatterPattern, String timeZone)
      Parameters:
      formattedDate - formattedDate
      dateFormatterPattern - dateFormatterPattern
      timeZone - timeZone
      Returns:
      time in milliseconds