Skip to content

Commit

Permalink
Merge pull request #538 from IBM/issue-536
Browse files Browse the repository at this point in the history
issue #536 - introduce examples to the Swagger/OpenAPI
  • Loading branch information
lmsurpre authored Dec 24, 2019
2 parents 03ecee6 + f1de1be commit 8154257
Show file tree
Hide file tree
Showing 9 changed files with 8,814 additions and 4,970 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ public <T extends Resource> boolean is(Class<T> resourceType) {
return resourceType.isInstance(this);
}

/**
* @throws ClassCastException
* when this resources cannot be cast to the requested resourceType
*/
public <T extends Resource> T as(Class<T> resourceType) {
return resourceType.cast(this);
}
Expand Down
4 changes: 4 additions & 0 deletions fhir-model/src/main/java/com/ibm/fhir/model/type/Element.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ public <T extends Element> boolean is(Class<T> elementType) {
return elementType.isInstance(this);
}

/**
* @throws ClassCastException
* when this element cannot be cast to the requested elementType
*/
public <T extends Element> T as(Class<T> elementType) {
return elementType.cast(this);
}
Expand Down
Loading

0 comments on commit 8154257

Please sign in to comment.