FhirResource.Builder
  public
  static
  final
  
  class
  FhirResource.Builder
  
    extends Object
  
  
  
  
  
  
| java.lang.Object | |
| ↳ | android.health.connect.datatypes.FhirResource.Builder | 
Builder class for FhirResource.
Summary
Public constructors | |
|---|---|
      
      Builder(FhirResource other)
      
      
        Constructs a clone of the other   | 
  |
      
      Builder(FhirResource.Builder other)
      
      
        Constructs a clone of the other   | 
  |
      
      Builder(int type, String id, String data)
      
      
        Constructs a new   | 
  |
Public methods | |
|---|---|
        
        
        
        
        
        FhirResource
     | 
  
    
      
      build()
      
      
        Returns a new instance of   | 
  
        
        
        
        
        
        FhirResource.Builder
     | 
  
    
      
      setData(String data)
      
      
        Sets the FHIR resource data in JSON representation.  | 
  
        
        
        
        
        
        FhirResource.Builder
     | 
  
    
      
      setId(String id)
      
      
        Sets the FHIR resource ID.  | 
  
        
        
        
        
        
        FhirResource.Builder
     | 
  
    
      
      setType(int type)
      
      
        Sets the FHIR resource type.  | 
  
Inherited methods | |
|---|---|
Public constructors
Builder
public Builder (FhirResource other)
Constructs a clone of the other FhirResource instance.
| Parameters | |
|---|---|
other | 
        
          FhirResource: This value cannot be null. | 
      
Builder
public Builder (FhirResource.Builder other)
Constructs a clone of the other FhirResource.Builder.
| Parameters | |
|---|---|
other | 
        
          FhirResource.Builder: This value cannot be null. | 
      
Builder
public Builder (int type, 
                String id, 
                String data)Constructs a new FhirResource.Builder instance.
| Throws | |
|---|---|
IllegalArgumentException | 
          if the provided FHIR resource type is not a
     valid supported type. | 
        
Public methods
build
public FhirResource build ()
Returns a new instance of FhirResource with the specified parameters.
| Returns | |
|---|---|
FhirResource | 
        This value cannot be null. | 
      
setData
public FhirResource.Builder setData (String data)
Sets the FHIR resource data in JSON representation.
| Parameters | |
|---|---|
data | 
        
          String: This value cannot be null. | 
      
| Returns | |
|---|---|
FhirResource.Builder | 
        This value cannot be null. | 
      
setId
public FhirResource.Builder setId (String id)
Sets the FHIR resource ID. This is extracted from the "id" field in data. This is
 NOT a unique identifier among all FhirResources.
| Parameters | |
|---|---|
id | 
        
          String: This value cannot be null. | 
      
| Returns | |
|---|---|
FhirResource.Builder | 
        This value cannot be null. | 
      
setType
public FhirResource.Builder setType (int type)
Sets the FHIR resource type. This is extracted from the "resourceType" field in data.
| Returns | |
|---|---|
FhirResource.Builder | 
        This value cannot be null. | 
      
| Throws | |
|---|---|
IllegalArgumentException | 
          if the provided FHIR resource type is not a
     valid supported type. |