throw Error when a value is assigned to NamingSystem.url

This commit is contained in:
Grahame Grieve 2020-04-07 14:49:27 +10:00
parent b179c482e7
commit d2dc15e2c8
4 changed files with 25 additions and 1 deletions

View File

@ -193,10 +193,15 @@ public abstract class MetadataResource extends DomainResource {
* @param value {@link #url} (An absolute URI that is used to identify this metadata resource when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this metadata resource is (or will be) published. The URL SHOULD include the major version of the metadata resource. For more information see [Technical and Business Versions](resource.html#versions).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
*/
public MetadataResource setUrlElement(UriType value) {
checkCanUseUrl();
this.url = value;
return this;
}
protected void checkCanUseUrl() {
// it's fine
}
/**
* @return An absolute URI that is used to identify this metadata resource when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this metadata resource is (or will be) published. The URL SHOULD include the major version of the metadata resource. For more information see [Technical and Business Versions](resource.html#versions).
*/
@ -211,6 +216,7 @@ public abstract class MetadataResource extends DomainResource {
if (Utilities.noString(value))
this.url = null;
else {
checkCanUseUrl();
if (this.url == null)
this.url = new UriType();
this.url.setValue(value);
@ -1049,6 +1055,7 @@ public abstract class MetadataResource extends DomainResource {
return fhirType()+"["+getUrl()+"]";
}
// end addition
}

View File

@ -2093,6 +2093,11 @@ public class NamingSystem extends MetadataResource {
*/
public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
@Override
protected void checkCanUseUrl() {
throw new Error("URL cannot be used on NamingSystem");
}
}

View File

@ -192,11 +192,16 @@ public abstract class MetadataResource extends DomainResource {
/**
* @param value {@link #url} (An absolute URI that is used to identify this metadata resource when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this metadata resource is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the metadata resource is stored on different servers.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
*/
public MetadataResource setUrlElement(UriType value) {
public MetadataResource setUrlElement(UriType value) {
checkCanUseUrl();
this.url = value;
return this;
}
protected void checkCanUseUrl() {
// it's fine
}
/**
* @return An absolute URI that is used to identify this metadata resource when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this metadata resource is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the metadata resource is stored on different servers.
*/
@ -211,6 +216,7 @@ public abstract class MetadataResource extends DomainResource {
if (Utilities.noString(value))
this.url = null;
else {
checkCanUseUrl();
if (this.url == null)
this.url = new UriType();
this.url.setValue(value);

View File

@ -2096,5 +2096,11 @@ public class NamingSystem extends MetadataResource {
public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
@Override
protected void checkCanUseUrl() {
throw new Error("URL cannot be used on NamingSystem");
}
}