@SuppressWarnings("unchecked") @Override public List<IQueryParameterOr<?>> encode(FhirContext theContext, T theString) throws InternalErrorException { String retVal = doEncode(theString); if (isBlank(retVal)) { return Collections.emptyList(); } List<?> retValList = Collections.singletonList(ParameterUtil.singleton(new StringParam(retVal), null)); return (List<IQueryParameterOr<?>>) retValList; }
@Override public T parse(FhirContext theContext, String theName, List<QualifiedParamList> theParams) throws InternalErrorException, InvalidRequestException { if (theParams.size() == 0 || theParams.get(0).size() == 0) { return null; } if (theParams.size() > 1 || theParams.get(0).size() > 1) { throw new InvalidRequestException("Multiple values detected for non-repeatable parameter '" + theName + "'. This server is not configured to allow multiple (AND) values for this param."); } T value = doParse(theParams.get(0).get(0)); return value; }
@Override public T parse(FhirContext theContext, String theName, List<QualifiedParamList> theParams) throws InternalErrorException, InvalidRequestException { if (theParams.size() == 0 || theParams.get(0).size() == 0) { return null; } if (theParams.size() > 1 || theParams.get(0).size() > 1) { throw new InvalidRequestException("Multiple values detected for non-repeatable parameter '" + theName + "'. This server is not configured to allow multiple (AND) values for this param."); } T value = doParse(theParams.get(0).get(0)); return value; }
@SuppressWarnings("unchecked") @Override public List<IQueryParameterOr<?>> encode(FhirContext theContext, T theString) throws InternalErrorException { String retVal = doEncode(theString); if (isBlank(retVal)) { return Collections.emptyList(); } List<?> retValList = Collections.singletonList(ParameterUtil.singleton(new StringParam(retVal), null)); return (List<IQueryParameterOr<?>>) retValList; }