/** * @return {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) */ // syntactic sugar public IdType addConditionElement() {//2 IdType t = new IdType(); if (this.condition == null) this.condition = new ArrayList<IdType>(); this.condition.add(t); return t; }
/** * @return The id of the fixture used as the body of a PUT or POST request. */ public String getSourceId() { return this.sourceId == null ? null : this.sourceId.getValue(); }
@Override public IdType withResourceType(String theResourceName) { return new IdType(theResourceName, getIdPart(), getVersionIdPart()); }
/** * Returns a new IdType containing this IdType's values but with no server * base URL if one is present in this IdType. For example, if this IdType * contains the ID "http://foo/Patient/1", this method will return a new * IdType containing ID "Patient/1". */ @Override public IdType toUnqualified() { return new IdType(getResourceType(), getIdPart(), getVersionIdPart()); }
/** * Returns <code>true</code> if the unqualified ID is a valid {@link Long} * value (in other words, it consists only of digits) */ @Override public boolean isIdPartValidLong() { return isValidLong(getIdPart()); }
@Override public IdType toVersionless() { return new IdType(getBaseUrl(), getResourceType(), getIdPart(), null); }
@Override public IdType toUnqualifiedVersionless() { return new IdType(getResourceType(), getIdPart()); }
IdType resourceId = new IdType(next.getValue()); ValidateUtil.isTrueOrThrowInvalidRequest(resourceId.hasResourceType(), RESOURCE_ID + " parameter must have resource type"); ValidateUtil.isTrueOrThrowInvalidRequest(resourceId.hasIdPart(), RESOURCE_ID + " parameter must have resource ID part");
public boolean hasCondition() { if (this.condition == null) return false; for (IdType item : this.condition) if (!item.isEmpty()) return true; return false; }
/** * Returns true if this IdType matches the given IdType in terms of resource * type and ID, but ignores the URL base */ @SuppressWarnings("deprecation") public boolean equalsIgnoreBase(IdType theId) { if (theId == null) { return false; } if (theId.isEmpty()) { return isEmpty(); } return ObjectUtils.equals(getResourceType(), theId.getResourceType()) && ObjectUtils.equals(getIdPart(), theId.getIdPart()) && ObjectUtils.equals(getVersionIdPart(), theId.getVersionIdPart()); }
@Override public boolean hasIdPart() { return isNotBlank(getIdPart()); }
/** * Returns <code>true</code> if this ID contains an absolute URL (in other * words, a URL starting with "http://" or "https://" */ @Override public boolean isAbsolute() { if (StringUtils.isBlank(getValue())) { return false; } return isUrlAbsolute(getValue()); }
@Read(type = OperationDefinition.class) public OperationDefinition readOperationDefinition(@IdParam IdType theId) { if (theId == null || theId.hasIdPart() == false) { throw new ResourceNotFoundException(theId); List<OperationMethodBinding> sharedDescriptions = myOperationNameToBindings.get(theId.getIdPart()); if (sharedDescriptions == null || sharedDescriptions.isEmpty()) { throw new ResourceNotFoundException(theId);
if (id.hasResourceType() == false) { String resName = myContext.getResourceDefinition(nextRes).getName(); id = id.withResourceType(resName);
/** * Returns a new IdType containing this IdType's values but with no server * base URL if one is present in this IdType. For example, if this IdType * contains the ID "http://foo/Patient/1", this method will return a new * IdType containing ID "Patient/1". */ @Override public IdType toUnqualified() { return new IdType(getResourceType(), getIdPart(), getVersionIdPart()); }
@Override public IdType toVersionless() { return new IdType(getBaseUrl(), getResourceType(), getIdPart(), null); }