class HeaderParameterChecker implements ConditionChecker {

    @Override
    public boolean checkCondition(final WilmaHttpRequest request, final ParameterList parameterList) {
        List<Parameter> params = parameterList.getAllParameters();
        Iterator<Parameter> iterator = params.iterator();
        boolean result = !params.isEmpty();
        while (iterator.hasNext() && result) {
            Parameter parameter = iterator.next();
            String header = request.getHeader(parameter.getName());
            if (header != null) {
                result = result && header.contains(parameter.getValue());
            } else {
                result = false;
            }

        }
        return result;
    }

}