Package com.skava.helper
Class UserPropertiesHelper
java.lang.Object
com.skava.helper.UserPropertiesHelper
This helper class contains utility methods for the User Property resource.
- Author:
- Infosys Equinox
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<AddressPropertiesEntity>
convertMapToUserAddressPropertiesEntity
(Map<String, String> customProperties, AddressesEntity addressesEntity) The method convertMapToUserAddressPropertiesEntitystatic List<PropertiesEntity>
convertMapToUserPropertiesEntity
(Map<String, String> customProperties, UsersEntity users) This method is used to convert map to user properties entity.convertUserPropertiesEntityToMap
(List<PropertiesEntity> userProperties) This method is used to convert user properties entity to map.static UsersResponse
deleteCustomProperty
(DeleteCustomPropertyService deletePropertyService, long userId, String propertyName, String locale, long collectionId) This method is used to delete the given custom property.filterHiddenProperties
(Map<String, String> properties) This method is used to filters hidden Property from the list of properties.static String
getLoginAttemptCount
(int count) This method is used to get the login attempt count for an user.static PropertiesEntity
saveProperty
(PropertiesRepository userpropertiesRepository, UsersEntity usersEntity, String name, String value) This method is used to saves user property in database.
-
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
- HoldsUsersEntity
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 ofDeleteCustomPropertyService
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
This method is used to filters hidden Property from the list of 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
- HoldsPropertiesRepository
class for saving property in database.usersEntity
- HoldsUsersEntity
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
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
-