
Package ca.uhn.fhir.rest.param
Class DateParam
- java.lang.Object
-
- ca.uhn.fhir.rest.param.BaseParam
-
- 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 class
DateParam.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 boolean
equals(Object obj)
TemporalPrecisionEnum
getPrecision()
Date
getValue()
String
getValueAsString()
List<DateParam>
getValuesAsQueryTokens()
int
hashCode()
boolean
isEmpty()
Returnstrue
if no date/time is specified.DateParam
setValue(Date theValue)
Sets the value of the param to the given date (sets to themillisecond
precision, and will be encoded using the system local time zone).void
setValue(IPrimitiveType<Date> theValue)
Sets the value using a FHIR Date type, such as aDateDt
, or a DateTimeType.void
setValueAsString(String theDate)
Accepts values with or without a prefix (e.g.void
setValuesAsQueryTokens(FhirContext theContext, String theParamName, QualifiedParamList theParameters)
String
toString()
-
Methods inherited from class ca.uhn.fhir.rest.param.BaseParamWithPrefix
getPrefix, setPrefix
-
Methods inherited from class ca.uhn.fhir.rest.param.BaseParam
getMissing, getQueryParameterQualifier, getValueAsQueryToken, isSupportsChain, setMissing, setValueAsQueryToken
-
-
-
-
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:
getValuesAsQueryTokens
in interfaceIQueryParameterOr<DateParam>
-
isEmpty
public boolean isEmpty()
Returnstrue
if 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 themillisecond
precision, 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-01
and2011-01-01
). If no prefix is provided in the given value, theexisting prefix
is preserved
-
setValuesAsQueryTokens
public void setValuesAsQueryTokens(FhirContext theContext, String theParamName, QualifiedParamList theParameters)
- Specified by:
setValuesAsQueryTokens
in interfaceIQueryParameterOr<DateParam>
-
-