Class BackMatter.Resource.Rlink

java.lang.Object
dev.metaschema.oscal.lib.model.BackMatter.Resource.Rlink
All Implemented Interfaces:
dev.metaschema.core.model.IBoundObject
Enclosing class:
BackMatter.Resource

@MetaschemaAssembly(formalName="Resource link", description="A URL-based pointer to an external resource with an optional hash for verification and change detection.", name="rlink", moduleClass=OscalMetadataModule.class, remarks="Multiple `rlink` objects can be included for a resource. In such a case, all provided `rlink` items are intended to be equivalent in content, but may differ in structure or format.\n\nA `media-type` is used to identify the format of a given rlink, and can be used to differentiate items in a collection of rlinks. The `media-type` provides a hint to the OSCAL document consumer about the structure of the resource referenced by the `rlink`.") public static class BackMatter.Resource.Rlink extends Object implements dev.metaschema.core.model.IBoundObject
A URL-based pointer to an external resource with an optional hash for verification and change detection.
  • Constructor Details

    • Rlink

      public Rlink()
      Constructs a new dev.metaschema.oscal.lib.model.BackMatter.Resource.Rlink instance with no metadata.
    • Rlink

      public Rlink(dev.metaschema.core.model.IMetaschemaData data)
      Constructs a new dev.metaschema.oscal.lib.model.BackMatter.Resource.Rlink instance with the specified metadata.
      Parameters:
      data - the metaschema data, or null if none
  • Method Details

    • getMetaschemaData

      public dev.metaschema.core.model.IMetaschemaData getMetaschemaData()
      Specified by:
      getMetaschemaData in interface dev.metaschema.core.model.IBoundObject
    • getHref

      @NonNull public URI getHref()
      Get the "Hypertext Reference".

      A resolvable URL pointing to the referenced resource.

      Returns:
      the href value
    • setHref

      public void setHref(@NonNull URI value)
      Set the "Hypertext Reference".

      A resolvable URL pointing to the referenced resource.

      Parameters:
      value - the href value to set
    • getMediaType

      @Nullable public String getMediaType()
      Get the "Media Type".

      A label that indicates the nature of a resource, as a data serialization or format.

      Returns:
      the media-type value, or null if not set
    • setMediaType

      public void setMediaType(@Nullable String value)
      Set the "Media Type".

      A label that indicates the nature of a resource, as a data serialization or format.

      Parameters:
      value - the media-type value to set, or null to clear
    • getHashes

      @NonNull public List<Hash> getHashes()
      Get the "Hash".

      A hash of the resource identified by href, which can be used to verify the resource was not changed since it was hashed.

      Returns:
      the hash value
    • setHashes

      public void setHashes(@NonNull List<Hash> value)
      Set the "Hash".

      A hash of the resource identified by href, which can be used to verify the resource was not changed since it was hashed.

      Parameters:
      value - the hash value to set
    • addHash

      public boolean addHash(Hash item)
      Add a new Hash item to the underlying collection.
      Parameters:
      item - the item to add
      Returns:
      true
    • removeHash

      public boolean removeHash(Hash item)
      Remove the first matching Hash item from the underlying collection.
      Parameters:
      item - the item to remove
      Returns:
      true if the item was removed or false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object