Package com.ibm.fhir.audit.cadf
Class CadfResource.Builder
- java.lang.Object
-
- com.ibm.fhir.audit.cadf.CadfResource.Builder
-
- Enclosing class:
- CadfResource
public static class CadfResource.Builder extends java.lang.Object
Builder for immutable CadfResource objects
-
-
Constructor Summary
Constructors Constructor Description Builder(java.lang.String id, ResourceType typeURI)
Creates an instance of the CadfResource builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CadfResource.Builder
address(CadfEndpoint address)
A convenience method to add one address at a time.CadfResource.Builder
addresses(CadfEndpoint[] addresses)
An optional array of descriptive addresses (including URLs) of the resourceCadfResource.Builder
addresses(java.util.ArrayList<CadfEndpoint> addresses)
An optional ArrayList of descriptive addresses (including URLs) of the resourceCadfResource.Builder
attachment(CadfAttachment attachment)
A convenience method to add one attachment at a time.CadfResource.Builder
attachments(CadfAttachment[] attachments)
An optional array of additional data containing information about the reporter or any action it performed that affected the CADF Event Record contents.CadfResource.Builder
attachments(java.util.ArrayList<CadfAttachment> attachments)
An optional array of additional data containing information about the reporter or any action it performed that affected the CADF Event Record contents.CadfResource
build()
Build an immutable ReporterStep instance.CadfResource.Builder
credential(CadfCredential cred)
Set the optional optional security credentials associated with the resource’s identity.CadfResource.Builder
domain(java.lang.String domain)
Set the optional name of the domain that qualifies the name of the resource (e.g., a path name, a container name, etc.).CadfResource.Builder
geolocation(CadfGeolocation geoloc)
Set the property describing the geographic location of the resource using a CADF Geolocation data type.CadfResource.Builder
geolocationId(java.lang.String geolocId)
This optional property identifies a CADF Geolocation by reference and whose definition exists outside the event record itself (e.g., within the same CADF Log or Report level).CadfResource.Builder
host(java.lang.String host)
Set the optional information about the (network) host of the resourceCadfResource.Builder
id(java.lang.String id)
Set the optional local name for the resource (not necessarily unique)CadfResource.Builder
name(java.lang.String name)
Set the optional local name for the resource (not necessarily unique)CadfResource.Builder
typeURI(ResourceType typeURI)
-
-
-
Constructor Detail
-
Builder
public Builder(java.lang.String id, ResourceType typeURI)
Creates an instance of the CadfResource builder.- Parameters:
id
- - String. Resource identifier.typeURI
- - CadfEvent.ResourceType. Resource classification in the CADF taxonomy.- See Also:
ResourceType
-
-
Method Detail
-
id
public CadfResource.Builder id(java.lang.String id)
Set the optional local name for the resource (not necessarily unique)- Parameters:
name
-- Returns:
- Builder
-
name
public CadfResource.Builder name(java.lang.String name)
Set the optional local name for the resource (not necessarily unique)- Parameters:
name
-- Returns:
- Builder
-
host
public CadfResource.Builder host(java.lang.String host)
Set the optional information about the (network) host of the resource- Parameters:
host
-- Returns:
- Builder
-
typeURI
public CadfResource.Builder typeURI(ResourceType typeURI)
-
domain
public CadfResource.Builder domain(java.lang.String domain)
Set the optional name of the domain that qualifies the name of the resource (e.g., a path name, a container name, etc.).- Parameters:
domain
-- Returns:
- Builder
-
credential
public CadfResource.Builder credential(CadfCredential cred)
Set the optional optional security credentials associated with the resource’s identity.- Parameters:
cred
-- Returns:
- Builder
-
geolocationId
public CadfResource.Builder geolocationId(java.lang.String geolocId)
This optional property identifies a CADF Geolocation by reference and whose definition exists outside the event record itself (e.g., within the same CADF Log or Report level). Note: This property can be used instead of the "geolocation" property to reference a valid CADF Geolocation definition, which is already defined outside the resource itself, by its identifier (e.g., a CADF Geolocation already defined at the CADF Log or Report level that also contains the CADF Resource definition). This property is required if the geolocation property is not used.- Parameters:
geolocId
-- Returns:
- Builder
-
geolocation
public CadfResource.Builder geolocation(CadfGeolocation geoloc)
Set the property describing the geographic location of the resource using a CADF Geolocation data type. This property is required if the geolocationId property is not used.- Parameters:
geoloc
-- Returns:
- Builder
-
attachments
public CadfResource.Builder attachments(CadfAttachment[] attachments)
An optional array of additional data containing information about the reporter or any action it performed that affected the CADF Event Record contents.
-
attachments
public CadfResource.Builder attachments(java.util.ArrayList<CadfAttachment> attachments)
An optional array of additional data containing information about the reporter or any action it performed that affected the CADF Event Record contents.
-
attachment
public CadfResource.Builder attachment(CadfAttachment attachment)
A convenience method to add one attachment at a time.- See Also:
attachments(CadfAttachment[])
-
addresses
public CadfResource.Builder addresses(CadfEndpoint[] addresses)
An optional array of descriptive addresses (including URLs) of the resource
-
addresses
public CadfResource.Builder addresses(java.util.ArrayList<CadfEndpoint> addresses)
An optional ArrayList of descriptive addresses (including URLs) of the resource
-
address
public CadfResource.Builder address(CadfEndpoint address)
A convenience method to add one address at a time.- See Also:
addresses(CadfEndpoint[])
-
build
public CadfResource build()
Build an immutable ReporterStep instance.- Returns:
- ReporterStep
- Throws:
java.lang.IllegalStateException
- when the properties do not meet the specification.
-
-