Package land.oras

Class ManifestDescriptor

java.lang.Object
land.oras.ManifestDescriptor

@NullMarked public final class ManifestDescriptor extends Object
Manifest descriptor
  • Method Details

    • getArtifactType

      public @Nullable String getArtifactType()
      Get the artifact type
      Returns:
      The artifact type
    • getMediaType

      public String getMediaType()
      Get the media type
      Returns:
      The media type
    • getDigest

      public String getDigest()
      Get the digest
      Returns:
      The digest
    • getSize

      public long getSize()
      Get the size
      Returns:
      The size
    • getPlatform

      public Map<String,String> getPlatform()
      Get the platform
      Returns:
      The platform
    • getAnnotations

      public @Nullable Map<String,String> getAnnotations()
      Get the annotations
      Returns:
      The annotations
    • toJson

      public String toJson()
      Return the JSON representation of the manifest
      Returns:
      The JSON string
    • fromJson

      public static ManifestDescriptor fromJson(String json)
      Create a manifest descriptor from a JSON string
      Parameters:
      json - The JSON string
      Returns:
      The manifest
    • toDescriptor

      public Descriptor toDescriptor()
      Return this manifest descriptor as a descriptor
      Returns:
      The descriptor
    • toSubject

      public Subject toSubject()
      Return this manifest descriptor as a subject
      Returns:
      The subject
    • withAnnotations

      public ManifestDescriptor withAnnotations(@Nullable Map<String,String> annotations)
      Create a manifest descriptor with the given annotations
      Parameters:
      annotations - The annotations
      Returns:
      The subject
    • withArtifactType

      public ManifestDescriptor withArtifactType(@Nullable String artifactType)
      Create a manifest descriptor with the given artifact type
      Parameters:
      artifactType - The artifact type
      Returns:
      The subject
    • of

      public static ManifestDescriptor of(String mediaType, String digest, long size)
      Create a manifest descriptor
      Parameters:
      mediaType - The media type
      digest - The digest
      size - The size
      Returns:
      The subject
    • of

      public static ManifestDescriptor of(Descriptor descriptor)
      Create a manifest descriptor
      Parameters:
      descriptor - The descriptor
      Returns:
      The subject