Class UserPropertiesHelper

java.lang.Object
com.skava.helper.UserPropertiesHelper

public final class UserPropertiesHelper extends Object
This helper class contains utility methods for the User Property resource.
Author:
Infosys Equinox
  • Method Details

    • convertUserPropertiesEntityToMap

      public static Map<String,String> convertUserPropertiesEntityToMap(List<PropertiesEntity> userProperties)
      This method is used to convert user properties entity to map.
      Parameters:
      userProperties - Indicates the user properties for converting list to map.
      Returns:
      the map of user properties.
    • convertMapToUserPropertiesEntity

      public static List<PropertiesEntity> convertMapToUserPropertiesEntity(Map<String,String> customProperties, UsersEntity users)
      This method is used to convert map to user properties entity.
      Parameters:
      customProperties - Holds the map object which contains custom properties.
      users - Holds UsersEntity object for converting the list of properties from map object.
      Returns:
      the list of PropertiesEntity object.
    • deleteCustomProperty

      public static UsersResponse deleteCustomProperty(DeleteCustomPropertyService deletePropertyService, long userId, String propertyName, String locale, long collectionId)
      This method is used to delete the given custom property.
      Parameters:
      deletePropertyService - Instance of DeleteCustomPropertyService property object which is used for deleting the given custom property.
      userId - Holds user's id which is used for deleting particular custom property for a particular user.
      propertyName - Holds property name of String type which is used for deleting custom property.
      locale - API Response and error messages will be responded in the locale mentioned in this parameter.
      collectionId - Indicates the collection id of an user.
      Returns:
      the UsersResponse object.
    • filterHiddenProperties

      public static Map<String,String> filterHiddenProperties(Map<String,String> properties)
      This method is used to filters hidden Property from the list of properties.
      Parameters:
      properties - Holds Map which contains the list of properties.
      Returns:
      the Map which contains list of hidden properties.
    • saveProperty

      public static PropertiesEntity saveProperty(PropertiesRepository userpropertiesRepository, UsersEntity usersEntity, String name, String value)
      This method is used to saves user property in database.
      Parameters:
      userpropertiesRepository - Holds PropertiesRepository class for saving property in database.
      usersEntity - Holds UsersEntity is used to save property in database.
      name - Indicates the name of the property which is used to save property in database.
      value - Indicates the value of the property which is used to save property in database.
      Returns:
      The properties entity object
    • getLoginAttemptCount

      public static String getLoginAttemptCount(int count)
      This method is used to get the login attempt count for an user.
      Parameters:
      count - Indicates the login attempt count of an user.
      Returns:
      the login attempt count.
    • convertMapToUserAddressPropertiesEntity

      public static List<AddressPropertiesEntity> convertMapToUserAddressPropertiesEntity(Map<String,String> customProperties, AddressesEntity addressesEntity)
      The method convertMapToUserAddressPropertiesEntity
      Parameters:
      customProperties - properties Holds the map object which contains custom properties of address.
      addressesEntity - entity model of the address
      Returns:
      the list of AddressPropertiesEntity