private boolean hasLink(String theLinkType, Bundle theBundle) { for (BundleLinkComponent next : theBundle.getLink()) { if (theLinkType.equals(next.getRelation())) { return true; } } return false; }
/** * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. * If no link is found which matches the given relation, returns <code>null</code>. If more than one * link is found which matches the given relation, returns the first matching BundleLinkComponent. * * @param theRelation * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}. * @return Returns a matching BundleLinkComponent, or <code>null</code> * @see IBaseBundle#LINK_NEXT * @see IBaseBundle#LINK_PREV * @see IBaseBundle#LINK_SELF */ public BundleLinkComponent getLink(String theRelation) { org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); for (BundleLinkComponent next : getLink()) { if (theRelation.equals(next.getRelation())) { return next; } } return null; }
/** * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. * If no link is found which matches the given relation, creates a new BundleLinkComponent with the * given relation and adds it to this Bundle. If more than one * link is found which matches the given relation, returns the first matching BundleLinkComponent. * * @param theRelation * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}. * @return Returns a matching BundleLinkComponent, or <code>null</code> * @see IBaseBundle#LINK_NEXT * @see IBaseBundle#LINK_PREV * @see IBaseBundle#LINK_SELF */ public BundleLinkComponent getLinkOrCreate(String theRelation) { org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); for (BundleLinkComponent next : getLink()) { if (theRelation.equals(next.getRelation())) { return next; } } BundleLinkComponent retVal = new BundleLinkComponent(); retVal.setRelation(theRelation); getLink().add(retVal); return retVal; } protected void listChildren(List<Property> childrenList) {
@Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("type")) this.type = new BundleTypeEnumFactory().fromType(value); // Enumeration<BundleType> else if (name.equals("total")) this.total = castToUnsignedInt(value); // UnsignedIntType else if (name.equals("link")) this.getLink().add((BundleLinkComponent) value); else if (name.equals("entry")) this.getEntry().add((BundleEntryComponent) value); else if (name.equals("signature")) this.signature = castToSignature(value); // Signature else super.setProperty(name, value); }
public org.hl7.fhir.r4.model.Bundle convertBundle(org.hl7.fhir.instance.model.Bundle src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.Bundle tgt = new org.hl7.fhir.r4.model.Bundle(); copyResource(src, tgt); tgt.setType(convertBundleType(src.getType())); if (src.hasTotal()) tgt.setTotal(src.getTotal()); for (org.hl7.fhir.instance.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); for (org.hl7.fhir.instance.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); tgt.setSignature(convertSignature(src.getSignature())); return tgt; }
public org.hl7.fhir.dstu3.model.Bundle convertBundle(org.hl7.fhir.instance.model.Bundle src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Bundle tgt = new org.hl7.fhir.dstu3.model.Bundle(); copyResource(src, tgt); tgt.setType(convertBundleType(src.getType())); if (src.hasTotal()) tgt.setTotal(src.getTotal()); for (org.hl7.fhir.instance.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); for (org.hl7.fhir.instance.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); tgt.setSignature(convertSignature(src.getSignature())); return tgt; }
private boolean hasLink(String theLinkType, Bundle theBundle) { for (BundleLinkComponent next : theBundle.getLink()) { if (theLinkType.equals(next.getRelation())) { return true; } } return false; }
/** * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. * If no link is found which matches the given relation, returns <code>null</code>. If more than one * link is found which matches the given relation, returns the first matching BundleLinkComponent. * * @param theRelation * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}. * @return Returns a matching BundleLinkComponent, or <code>null</code> * @see IBaseBundle#LINK_NEXT * @see IBaseBundle#LINK_PREV * @see IBaseBundle#LINK_SELF */ public BundleLinkComponent getLink(String theRelation) { org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); for (BundleLinkComponent next : getLink()) { if (theRelation.equals(next.getRelation())) { return next; } } return null; }
/** * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. * If no link is found which matches the given relation, creates a new BundleLinkComponent with the * given relation and adds it to this Bundle. If more than one * link is found which matches the given relation, returns the first matching BundleLinkComponent. * * @param theRelation * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}. * @return Returns a matching BundleLinkComponent, or <code>null</code> * @see IBaseBundle#LINK_NEXT * @see IBaseBundle#LINK_PREV * @see IBaseBundle#LINK_SELF */ public BundleLinkComponent getLinkOrCreate(String theRelation) { org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); for (BundleLinkComponent next : getLink()) { if (theRelation.equals(next.getRelation())) { return next; } } BundleLinkComponent retVal = new BundleLinkComponent(); retVal.setRelation(theRelation); getLink().add(retVal); return retVal; } protected void listChildren(List<Property> childrenList) {
@Override public void setProperty(String name, Base value) throws FHIRException { if (name.equals("type")) this.type = new BundleTypeEnumFactory().fromType(value); // Enumeration<BundleType> else if (name.equals("total")) this.total = castToUnsignedInt(value); // UnsignedIntType else if (name.equals("link")) this.getLink().add((BundleLinkComponent) value); else if (name.equals("entry")) this.getEntry().add((BundleEntryComponent) value); else if (name.equals("signature")) this.signature = castToSignature(value); // Signature else super.setProperty(name, value); }
public org.hl7.fhir.r4.model.Bundle convertBundle(org.hl7.fhir.instance.model.Bundle src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.Bundle tgt = new org.hl7.fhir.r4.model.Bundle(); copyResource(src, tgt); tgt.setType(convertBundleType(src.getType())); if (src.hasTotal()) tgt.setTotal(src.getTotal()); for (org.hl7.fhir.instance.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); for (org.hl7.fhir.instance.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); tgt.setSignature(convertSignature(src.getSignature())); return tgt; }
public org.hl7.fhir.dstu3.model.Bundle convertBundle(org.hl7.fhir.instance.model.Bundle src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Bundle tgt = new org.hl7.fhir.dstu3.model.Bundle(); copyResource(src, tgt); tgt.setType(convertBundleType(src.getType())); if (src.hasTotal()) tgt.setTotal(src.getTotal()); for (org.hl7.fhir.instance.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); for (org.hl7.fhir.instance.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); tgt.setSignature(convertSignature(src.getSignature())); return tgt; }