Package ca.uhn.fhir.rest.param
Class QuantityParam
- java.lang.Object
-
- ca.uhn.fhir.rest.param.BaseParamWithPrefix<QuantityParam>
-
- ca.uhn.fhir.rest.param.QuantityParam
-
- All Implemented Interfaces:
IQueryParameterType,Serializable
public class QuantityParam extends BaseParamWithPrefix<QuantityParam> implements IQueryParameterType
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description QuantityParam()ConstructorQuantityParam(long theQuantity)ConstructorQuantityParam(ParamPrefixEnum thePrefix, double theValue, String theSystem, String theUnits)ConstructorQuantityParam(ParamPrefixEnum thePrefix, long theValue, String theSystem, String theUnits)ConstructorQuantityParam(ParamPrefixEnum thePrefix, BigDecimal theValue, String theSystem, String theUnits)ConstructorQuantityParam(String theQuantity)ConstructorQuantityParam(String theQuantity, String theSystem, String theUnits)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BooleangetMissing()If set to non-null value, indicates that this parameter has been populated with a "[name]:missing=true" or "[name]:missing=false" vale instead of a normal valueStringgetQueryParameterQualifier()This method will return any qualifier that should be appended to the parameter name (e.g ":exact").StringgetSystem()Returns the system, or null if none was providedUriDtgetSystemAsUriDt()Deprecated.Use {getSystem()} insteadStringgetUnits()BigDecimalgetValue()Returns the quantity/value, or null if none was providedStringgetValueAsQueryToken(FhirContext theContext)Returns a representation of this parameter's value as it will be represented "over the wire".StringgetValueAsString()protected booleanisSupportsChain()Does this parameter type support chained parameters (only reference should returntruefor this)ca.uhn.fhir.rest.param.BaseParamsetMissing(Boolean theMissing)If set to non-null value, indicates that this parameter has been populated with a "[name]:missing=true" or "[name]:missing=false" vale instead of a normal valueQuantityParamsetSystem(String theSystem)QuantityParamsetSystem(IPrimitiveType<String> theSystem)QuantityParamsetUnits(String theUnits)QuantityParamsetValue(double theValue)QuantityParamsetValue(long theValue)QuantityParamsetValue(String theValue)QuantityParamsetValue(BigDecimal theValue)QuantityParamsetValue(IPrimitiveType<BigDecimal> theValue)voidsetValueAsQueryToken(FhirContext theContext, String theParamName, String theQualifier, String theValue)This method is generally only called by HAPI itself, and should not need to be called from user code.StringtoString()-
Methods inherited from class ca.uhn.fhir.rest.param.BaseParamWithPrefix
getPrefix, setPrefix
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ca.uhn.fhir.model.api.IQueryParameterType
getMissing, getQueryParameterQualifier, getValueAsQueryToken, setMissing, setValueAsQueryToken
-
-
-
-
Constructor Detail
-
QuantityParam
public QuantityParam()
Constructor
-
QuantityParam
public QuantityParam(ParamPrefixEnum thePrefix, BigDecimal theValue, String theSystem, String theUnits)
Constructor- Parameters:
thePrefix- The comparator, ornullfor an equals comparatortheValue- A quantity valuetheSystem- The unit systemtheUnits- The unit code
-
QuantityParam
public QuantityParam(ParamPrefixEnum thePrefix, double theValue, String theSystem, String theUnits)
Constructor- Parameters:
thePrefix- The comparator, ornullfor an equals comparatortheValue- A quantity valuetheSystem- The unit systemtheUnits- The unit code
-
QuantityParam
public QuantityParam(ParamPrefixEnum thePrefix, long theValue, String theSystem, String theUnits)
Constructor- Parameters:
thePrefix- The comparator, ornullfor an equals comparatortheValue- A quantity valuetheSystem- The unit systemtheUnits- The unit code
-
QuantityParam
public QuantityParam(String theQuantity)
Constructor- Parameters:
theQuantity- A quantity value (with no system or units), such as "100.0" or "gt4"
-
QuantityParam
public QuantityParam(long theQuantity)
Constructor- Parameters:
theQuantity- A quantity value (with no system or units), such as100
-
QuantityParam
public QuantityParam(String theQuantity, String theSystem, String theUnits)
Constructor- Parameters:
theQuantity- A quantity value (with no system or units), such as "100.0" or "<=4"theSystem- The unit systemtheUnits- The unit code
-
-
Method Detail
-
getValueAsString
public String getValueAsString()
-
getSystem
public String getSystem()
Returns the system, or null if none was providedNote that prior to HAPI FHIR 1.5, this method returned a
UriDt- Since:
- 1.5
-
getSystemAsUriDt
@Deprecated public UriDt getSystemAsUriDt()
Deprecated.Use {getSystem()} instead
-
getValue
public BigDecimal getValue()
Returns the quantity/value, or null if none was providedNote that prior to HAPI FHIR 1.5, this method returned a
DecimalDt- Since:
- 1.5
-
setSystem
public QuantityParam setSystem(String theSystem)
-
setSystem
public QuantityParam setSystem(IPrimitiveType<String> theSystem)
-
setUnits
public QuantityParam setUnits(String theUnits)
-
setValue
public QuantityParam setValue(BigDecimal theValue)
-
setValue
public QuantityParam setValue(IPrimitiveType<BigDecimal> theValue)
-
setValue
public QuantityParam setValue(String theValue)
-
setValue
public QuantityParam setValue(double theValue)
-
setValue
public QuantityParam setValue(long theValue)
-
getMissing
public Boolean getMissing()
If set to non-null value, indicates that this parameter has been populated with a "[name]:missing=true" or "[name]:missing=false" vale instead of a normal value- Specified by:
getMissingin interfaceIQueryParameterType
-
getQueryParameterQualifier
public final String getQueryParameterQualifier()
Description copied from interface:IQueryParameterTypeThis method will return any qualifier that should be appended to the parameter name (e.g ":exact"). Returns null if none are present.- Specified by:
getQueryParameterQualifierin interfaceIQueryParameterType
-
getValueAsQueryToken
public final String getValueAsQueryToken(FhirContext theContext)
Description copied from interface:IQueryParameterTypeReturns a representation of this parameter's value as it will be represented "over the wire". In other words, how it will be presented in a URL (although not URL escaped)See FHIR specification 2.2.2 Search SearchParameter Types for information on the token format
- Specified by:
getValueAsQueryTokenin interfaceIQueryParameterType- Parameters:
theContext- TODO- Returns:
- Returns a representation of this parameter's value as it will be represented "over the wire". In other words, how it will be presented in a URL (although not URL escaped)
-
isSupportsChain
protected boolean isSupportsChain()
Does this parameter type support chained parameters (only reference should returntruefor this)
-
setMissing
public ca.uhn.fhir.rest.param.BaseParam setMissing(Boolean theMissing)
If set to non-null value, indicates that this parameter has been populated with a "[name]:missing=true" or "[name]:missing=false" vale instead of a normal value- Specified by:
setMissingin interfaceIQueryParameterType- Returns:
- Returns a reference to
thisfor easier method chaining
-
setValueAsQueryToken
public final void setValueAsQueryToken(FhirContext theContext, String theParamName, String theQualifier, String theValue)
Description copied from interface:IQueryParameterTypeThis method is generally only called by HAPI itself, and should not need to be called from user code.See FHIR specification 2.2.2 Search SearchParameter Types for information on the token format
- Specified by:
setValueAsQueryTokenin interfaceIQueryParameterType- Parameters:
theContext- TODOtheParamName- TODOtheQualifier- The parameter name qualifier that accompanied this value. For example, if the complete query washttp://foo?name:exact=John, qualifier would be ":exact"theValue- The actual parameter value. For example, if the complete query washttp://foo?name:exact=John, the value would be "John"
-
-