Package ca.uhn.fhir.rest.param
Class DateParam
- java.lang.Object
-
- ca.uhn.fhir.rest.param.BaseParamWithPrefix<DateParam>
-
- ca.uhn.fhir.rest.param.DateParam
-
- All Implemented Interfaces:
IQueryParameterOr<DateParam>,IQueryParameterType,Serializable
public class DateParam extends BaseParamWithPrefix<DateParam> implements IQueryParameterOr<DateParam>
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDateParam.DateParamDateTimeHolder
-
Constructor Summary
Constructors Constructor Description DateParam()ConstructorDateParam(ParamPrefixEnum thePrefix, long theDate)ConstructorDateParam(ParamPrefixEnum thePrefix, DateTimeDt theDate)ConstructorDateParam(ParamPrefixEnum thePrefix, String theDate)ConstructorDateParam(ParamPrefixEnum thePrefix, Date theDate)ConstructorDateParam(ParamPrefixEnum thePrefix, IPrimitiveType<Date> theDate)ConstructorDateParam(String theString)Constructor which takes a complete [qualifier]{date} string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)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 valueTemporalPrecisionEnumgetPrecision()StringgetQueryParameterQualifier()This method will return any qualifier that should be appended to the parameter name (e.g ":exact").DategetValue()StringgetValueAsQueryToken(FhirContext theContext)Returns a representation of this parameter's value as it will be represented "over the wire".StringgetValueAsString()List<DateParam>getValuesAsQueryTokens()inthashCode()booleanisEmpty()Returnstrueif no date/time is specified.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 valueDateParamsetValue(Date theValue)Sets the value of the param to the given date (sets to themillisecondprecision, and will be encoded using the system local time zone).voidsetValue(IPrimitiveType<Date> theValue)Sets the value using a FHIR Date type, such as aDateDt, or a DateTimeType.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.voidsetValueAsString(String theDate)Accepts values with or without a prefix (e.g.voidsetValuesAsQueryTokens(FhirContext theContext, String theParamName, QualifiedParamList theParameters)StringtoString()-
Methods inherited from class ca.uhn.fhir.rest.param.BaseParamWithPrefix
getPrefix, setPrefix
-
-
-
-
Constructor Detail
-
DateParam
public DateParam()
Constructor
-
DateParam
public DateParam(ParamPrefixEnum thePrefix, Date theDate)
Constructor
-
DateParam
public DateParam(ParamPrefixEnum thePrefix, DateTimeDt theDate)
Constructor
-
DateParam
public DateParam(ParamPrefixEnum thePrefix, IPrimitiveType<Date> theDate)
Constructor
-
DateParam
public DateParam(ParamPrefixEnum thePrefix, long theDate)
Constructor
-
DateParam
public DateParam(ParamPrefixEnum thePrefix, String theDate)
Constructor
-
-
Method Detail
-
getPrecision
public TemporalPrecisionEnum getPrecision()
-
getValueAsString
public String getValueAsString()
-
getValuesAsQueryTokens
public List<DateParam> getValuesAsQueryTokens()
- Specified by:
getValuesAsQueryTokensin interfaceIQueryParameterOr<DateParam>
-
isEmpty
public boolean isEmpty()
Returnstrueif no date/time is specified. Note that this method does not check the comparator, so a QualifiedDateParam with only a comparator and no date/time is considered empty.
-
setValue
public DateParam setValue(Date theValue)
Sets the value of the param to the given date (sets to themillisecondprecision, and will be encoded using the system local time zone).
-
setValue
public void setValue(IPrimitiveType<Date> theValue)
Sets the value using a FHIR Date type, such as aDateDt, or a DateTimeType.
-
setValueAsString
public void setValueAsString(String theDate)
Accepts values with or without a prefix (e.g.gt2011-01-01and2011-01-01). If no prefix is provided in the given value, theexisting prefixis preserved
-
setValuesAsQueryTokens
public void setValuesAsQueryTokens(FhirContext theContext, String theParamName, QualifiedParamList theParameters)
- Specified by:
setValuesAsQueryTokensin interfaceIQueryParameterOr<DateParam>
-
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"
-
-