Class AbstractQueryParameterValidatorImpl
- java.lang.Object
-
- de.adorsys.psd2.xs2a.web.validator.query.AbstractQueryParameterValidatorImpl
-
- All Implemented Interfaces:
QueryParameterValidator
- Direct Known Subclasses:
BookingStatusQueryParameterParamsValidatorImpl,DateFromQueryParameterParamsValidatorImpl
public abstract class AbstractQueryParameterValidatorImpl extends Object implements QueryParameterValidator
Common validator implementation for verifying query parameters in the request
-
-
Field Summary
Fields Modifier and Type Field Description protected ErrorBuildingServiceerrorBuildingService
-
Constructor Summary
Constructors Constructor Description AbstractQueryParameterValidatorImpl()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract StringgetQueryParameterName()Returns the name of the query parameterprotected StringgetQueryParameterValue(Map<String,List<String>> queryParameterMap)Returns the first value of the query parameter via name fromgetQueryParameterName()protected ValidationResultvalidateMandatoryParameterPresence(Map<String,List<String>> queryParameterMap)Validates the presence of mandatory query parameter by checking whether: the parameter is present in the request the parameter's value is contained only once in the request the parameter's value is not blank-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.adorsys.psd2.xs2a.web.validator.query.QueryParameterValidator
validate
-
-
-
-
Field Detail
-
errorBuildingService
protected final ErrorBuildingService errorBuildingService
-
-
Method Detail
-
validateMandatoryParameterPresence
protected ValidationResult validateMandatoryParameterPresence(Map<String,List<String>> queryParameterMap)
Validates the presence of mandatory query parameter by checking whether:- the parameter is present in the request
- the parameter's value is contained only once in the request
- the parameter's value is not blank
- Parameters:
queryParameterMap- query parameter map, with parameter names acting as keys- Returns:
- valid result if the parameter is present only once and doesn't have blank value, validation error otherwise
-
getQueryParameterName
protected abstract String getQueryParameterName()
Returns the name of the query parameter- Returns:
- query parameter name
-
getQueryParameterValue
protected String getQueryParameterValue(Map<String,List<String>> queryParameterMap)
Returns the first value of the query parameter via name fromgetQueryParameterName()- Parameters:
queryParameterMap- query parameters from the request- Returns:
- value of the first query parameter if it was found,
nullotherwise
-
-