Class DefaultUserMatchingService
- java.lang.Object
-
- de.hybris.platform.commerceservices.user.impl.DefaultUserMatchingService
-
- All Implemented Interfaces:
UserMatchingService
public class DefaultUserMatchingService extends java.lang.Object implements UserMatchingService
Provides methods for retrieving the user or customer and verifying its existence. The user is searched by matching one of his unique identifiers. This is accomplished using the list of matching strategies. By default, the user is searched by matching the UID.
-
-
Constructor Summary
Constructors Constructor Description DefaultUserMatchingService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<UserPropertyMatchingStrategy>getMatchingStrategies()<T extends UserModel>
TgetUserByProperty(java.lang.String propertyValue, java.lang.Class<T> clazz)Gets the user by the property and cast to UserModel subtypeprotected <T extends UserModel>
java.util.Optional<T>getUserOptionalByProperty(java.lang.String propertyValue, java.lang.Class<T> clazz)booleanisUserExisting(java.lang.String propertyValue)Verifies whether the user existvoidsetMatchingStrategies(java.util.List<UserPropertyMatchingStrategy> matchingStrategies)protected <T> TvalidateType(T value, java.lang.Class type)
-
-
-
Method Detail
-
getUserByProperty
public <T extends UserModel> T getUserByProperty(java.lang.String propertyValue, java.lang.Class<T> clazz)
Description copied from interface:UserMatchingServiceGets the user by the property and cast to UserModel subtype- Specified by:
getUserByPropertyin interfaceUserMatchingService- Type Parameters:
T- UserModel subtype- Parameters:
propertyValue- the unique value of property used to identify the user.clazz- - the class of UserModel subtype- Returns:
- the found user
-
isUserExisting
public boolean isUserExisting(java.lang.String propertyValue)
Description copied from interface:UserMatchingServiceVerifies whether the user exist- Specified by:
isUserExistingin interfaceUserMatchingService- Parameters:
propertyValue- the property value used to identify the user- Returns:
trueif user exists
-
getUserOptionalByProperty
protected <T extends UserModel> java.util.Optional<T> getUserOptionalByProperty(java.lang.String propertyValue, java.lang.Class<T> clazz)
-
validateType
protected <T> T validateType(T value, java.lang.Class type)
-
getMatchingStrategies
protected java.util.List<UserPropertyMatchingStrategy> getMatchingStrategies()
-
setMatchingStrategies
public void setMatchingStrategies(java.util.List<UserPropertyMatchingStrategy> matchingStrategies)
-
-