Package land.oras

Record Class Annotations

java.lang.Object
java.lang.Record
land.oras.Annotations
Record Components:
manifestAnnotations - Annotations for the manifest
configAnnotations - Annotations for the config
filesAnnotations - Annotations for the layers/files

@NullMarked public record Annotations(Map<String,String> configAnnotations, Map<String,String> manifestAnnotations, Map<String,Map<String,String>> filesAnnotations) extends Record
Record for annotations
  • Constructor Details

  • Method Details

    • ofManifest

      public static Annotations ofManifest(@Nullable Map<String,String> manifestAnnotations)
      Create a new annotations record with only manifest annotations
      Parameters:
      manifestAnnotations - The manifest annotations
      Returns:
      The annotations
    • ofConfig

      public static Annotations ofConfig(Map<String,String> configAnnotations)
      Create a new annotations record with only config annotations
      Parameters:
      configAnnotations - The config annotations
      Returns:
      The annotations
    • empty

      public static Annotations empty()
      Empty annotations
      Returns:
      The empty annotations
    • getFileAnnotations

      public Map<String,String> getFileAnnotations(String key)
      Get the manifest annotations for a file
      Parameters:
      key - The key
      Returns:
      The annotations
    • fromJson

      public static Annotations fromJson(String json)
      Convert the annotations from a JSON string
      Parameters:
      json - The JSON string
      Returns:
      The annotations
    • toJson

      public String toJson()
      Convert the annotations to a JSON string
      Returns:
      The JSON string
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • configAnnotations

      public Map<String,String> configAnnotations()
      Returns the value of the configAnnotations record component.
      Returns:
      the value of the configAnnotations record component
    • manifestAnnotations

      public Map<String,String> manifestAnnotations()
      Returns the value of the manifestAnnotations record component.
      Returns:
      the value of the manifestAnnotations record component
    • filesAnnotations

      public Map<String,Map<String,String>> filesAnnotations()
      Returns the value of the filesAnnotations record component.
      Returns:
      the value of the filesAnnotations record component