Class SingleResourceResult<T extends Resource>
- java.lang.Object
 - 
- org.linuxforhealth.fhir.persistence.SingleResourceResult<T>
 
 
- 
public class SingleResourceResult<T extends Resource> extends java.lang.ObjectA Result wrapper for FHIR interactions that return a single resource. Instances are immutable and can be constructed vianew SingleResourceResult.Builder<T>(). 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSingleResourceResult.Builder<T extends Resource> 
- 
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.IntegerifNoneMatchVersion 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.IntegergetIfNoneMatchVersion()Getter for the ifNoneMatchVersion valuejava.time.InstantgetLastUpdated()Get the lastUpdated value for the resource we just readjava.lang.StringgetLogicalId()OperationOutcomegetOutcome()An OperationOutcome that represents the outcome of the interactionTgetResource()The resource resulting from the interactionjava.lang.StringgetResourceTypeName()InteractionStatusgetStatus()Getter for the interaction statusintgetVersion()booleanisDeleted()Whether or not the resource is deletedbooleanisSuccess()Whether or not the interaction was successful<X extends Resource>
SingleResourceResult<X>replace(X newResource)Obtain a copy of thisSingleResourceResultwith the resource value replaced with the given newResource parameter. 
 - 
 
- 
- 
Method Detail
- 
isSuccess
public boolean isSuccess()
Whether or not the interaction was successful- Returns:
 - whether the interaction was successful
 
 
- 
isDeleted
public boolean isDeleted()
Whether or not the resource is deleted- Returns:
 - whether the resource is deleted
 
 
- 
getLastUpdated
public java.time.Instant getLastUpdated()
Get the lastUpdated value for the resource we just read- Returns:
 
 
- 
getResource
public T getResource()
The resource resulting from the interaction- Returns:
 - An immutable object of type 
Resource. 
 
- 
getStatus
public InteractionStatus getStatus()
Getter for the interaction status- Returns:
 
 
- 
getIfNoneMatchVersion
public java.lang.Integer getIfNoneMatchVersion()
Getter for the ifNoneMatchVersion value- Returns:
 
 
- 
getOutcome
public OperationOutcome getOutcome()
An OperationOutcome that represents the outcome of the interaction- Returns:
 - An immutable object of type 
OperationOutcome 
 
- 
getResourceTypeName
public java.lang.String getResourceTypeName()
- Returns:
 - the type name of the resource
 
 
- 
getLogicalId
public java.lang.String getLogicalId()
- Returns:
 - the logicalId of the resource
 
 
- 
getVersion
public int getVersion()
- Returns:
 - the version of the resource, or 0 if resourceResult is null
 
 
- 
replace
public <X extends Resource> SingleResourceResult<X> replace(X newResource)
Obtain a copy of thisSingleResourceResultwith the resource value replaced with the given newResource parameter. As an optimization, if the newResource equals the current value, this object is returned.- Parameters:
 newResource-- Returns:
 
 
 - 
 
 -