Package land.oras

Class Index


public final class Index extends Descriptor
Index from an OCI layout
  • Method Details

    • getSchemaVersion

      public int getSchemaVersion()
      Get the schema version
      Returns:
      The schema version
    • getManifests

      public List<ManifestDescriptor> getManifests()
      Get the list of manifests
      Returns:
      The list of manifests
    • withNewManifests

      public Index withNewManifests(ManifestDescriptor manifest)
      Return a new index with new manifest added to index
      Parameters:
      manifest - The manifest
      Returns:
      The index
    • getDescriptor

      public ManifestDescriptor getDescriptor()
      Get the descriptor
      Returns:
      The descriptor
    • getAnnotations

      public @Nullable Map<String,String> getAnnotations()
      Get the annotations
      Overrides:
      getAnnotations in class Descriptor
      Returns:
      The annotations
    • withDescriptor

      public Index withDescriptor(ManifestDescriptor descriptor)
      Return a new index with the given descriptor
      Parameters:
      descriptor - The descriptor
      Returns:
      The manifest
    • withJson

      protected Index withJson(String json)
      Return same instance but with original JSON
      Overrides:
      withJson in class Descriptor
      Parameters:
      json - The original JSON
      Returns:
      The index
    • getSubject

      public Subject getSubject()
      Get the subject
      Returns:
      The subject
    • withSubject

      public Index withSubject(Subject subject)
      Return a new index with the given subject
      Parameters:
      subject - The subject
      Returns:
      The index
    • fromJson

      public static Index fromJson(String json)
      Create an index from a JSON string
      Parameters:
      json - The JSON string
      Returns:
      The index
    • fromPath

      public static Index fromPath(Path path)
      Create an index from a path
      Parameters:
      path - The path
      Returns:
      The index
    • fromManifests

      public static Index fromManifests(List<ManifestDescriptor> descriptors)
      Create an index from a list of manifests
      Parameters:
      descriptors - The list of manifests
      Returns:
      The index