Package ca.uhn.fhir.model.primitive

Examples of ca.uhn.fhir.model.primitive.InstantDt


   */
  public Test addInstantErr( Date theDate) {
    if (myInstantErr == null) {
      myInstantErr = new java.util.ArrayList<InstantDt>();
    }
    myInstantErr.add(new InstantDt(theDate));
    return this;
  }
View Full Code Here


   */
  public Test addInstantErr( Date theDate,  TemporalPrecisionEnum thePrecision) {
    if (myInstantErr == null) {
      myInstantErr = new java.util.ArrayList<InstantDt>();
    }
    myInstantErr.add(new InstantDt(theDate, thePrecision));
    return this;
  }
View Full Code Here

  private Class<?> myType;

  @Override
  public void translateClientArgumentIntoQueryArgument(FhirContext theContext, Object theSourceClientArgument, Map<String, List<String>> theTargetQueryArguments, BaseHttpClientInvocation theClientInvocation) throws InternalErrorException {
    if (theSourceClientArgument != null) {
      InstantDt since = ParameterUtil.toInstant(theSourceClientArgument);
      if (since.isEmpty() == false) {
        theTargetQueryArguments.put(Constants.PARAM_SINCE, Collections.singletonList(since.getValueAsString()));
      }
    }
  }
View Full Code Here

    String[] sinceParams = theRequest.getParameters().remove(Constants.PARAM_SINCE);
    if (sinceParams != null) {
      if (sinceParams.length > 0) {
        if (StringUtils.isNotBlank(sinceParams[0])) {
          try {
            InstantDt since = new InstantDt(sinceParams[0]);
            return ParameterUtil.fromInstant(myType, since);
          } catch (DataFormatException e) {
            throw new InvalidRequestException("Invalid " + Constants.PARAM_SINCE + " value: " + sinceParams[0]);
          }
        }
View Full Code Here

    }
    theHttpResponse.setCharacterEncoding(Constants.CHARSET_UTF_8);

    theServer.addHeadersToResponse(theHttpResponse);

    InstantDt lastUpdated = ResourceMetadataKeyEnum.UPDATED.get(theResource);
    if (lastUpdated != null) {
      theHttpResponse.addHeader(Constants.HEADER_LAST_MODIFIED, lastUpdated.getValueAsString());
    }

    TagList list = (TagList) theResource.getResourceMetadata().get(ResourceMetadataKeyEnum.TAG_LIST);
    if (list != null) {
      for (Tag tag : list) {
View Full Code Here

  }

  public static Object fromInstant(Class<?> theType, InstantDt theArgument) {
    if (theType.equals(InstantDt.class)) {
      if (theArgument == null) {
        return new InstantDt();
      }
      return theArgument;
    }
    if (theType.equals(Date.class)) {
      if (theArgument == null) {
View Full Code Here

  public static InstantDt toInstant(Object theArgument) {
    if (theArgument instanceof InstantDt) {
      return (InstantDt) theArgument;
    }
    if (theArgument instanceof Date) {
      return new InstantDt((Date) theArgument);
    }
    if (theArgument instanceof Calendar) {
      return new InstantDt((Calendar) theArgument);
    }
    return null;
  }
View Full Code Here

    @Override
    public void attributeValue(String theName, String theValue) throws DataFormatException {
      if ("ref".equals(theName)) {
        getEntry().setId(new IdDt(theValue));
      } else if ("when".equals(theName)) {
        getEntry().setDeleted(new InstantDt(theValue));
      }
    }
View Full Code Here

      if (lmHeaders != null && lmHeaders.size() > 0 && StringUtils.isNotBlank(lmHeaders.get(0))) {
        String headerValue = lmHeaders.get(0);
        Date headerDateValue;
        try {
          headerDateValue = DateUtils.parseDate(headerValue);
          InstantDt lmValue = new InstantDt(headerDateValue);
          resource.getResourceMetadata().put(ResourceMetadataKeyEnum.UPDATED, lmValue);
        } catch (Exception e) {
          ourLog.warn("Unable to parse date string '{}'. Error is: {}", headerValue, e.toString());
        }
      }
View Full Code Here

  /**
   * Create a new unmodifiable empty resource list with the current time as the publish date.
   */
  public static IBundleProvider newEmptyList() {
    final InstantDt published = InstantDt.withCurrentTime();
    return new IBundleProvider() {
      @Override
      public List<IResource> getResources(int theFromIndex, int theToIndex) {
        return Collections.emptyList();
      }
View Full Code Here

TOP

Related Classes of ca.uhn.fhir.model.primitive.InstantDt

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.