Package land.oras
Record Class Annotations
java.lang.Object
java.lang.Record
land.oras.Annotations
- Record Components:
manifestAnnotations- Annotations for the manifestconfigAnnotations- Annotations for the configfilesAnnotations- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconfigAnnotationsrecord component.static Annotationsempty()Empty annotationsfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefilesAnnotationsrecord component.static AnnotationsConvert the annotations from a JSON stringgetFileAnnotations(String key) Get the manifest annotations for a filefinal inthashCode()Returns a hash code value for this object.Returns the value of themanifestAnnotationsrecord component.static AnnotationsCreate a new annotations record with only config annotationsstatic AnnotationsofManifest(@Nullable Map<String, String> manifestAnnotations) Create a new annotations record with only manifest annotationstoJson()Convert the annotations to a JSON stringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Annotations
public Annotations(Map<String, String> configAnnotations, Map<String, String> manifestAnnotations, Map<String, Map<String, String>> filesAnnotations) Creates an instance of aAnnotationsrecord class.- Parameters:
configAnnotations- the value for theconfigAnnotationsrecord componentmanifestAnnotations- the value for themanifestAnnotationsrecord componentfilesAnnotations- the value for thefilesAnnotationsrecord component
-
-
Method Details
-
ofManifest
Create a new annotations record with only manifest annotations- Parameters:
manifestAnnotations- The manifest annotations- Returns:
- The annotations
-
ofConfig
Create a new annotations record with only config annotations- Parameters:
configAnnotations- The config annotations- Returns:
- The annotations
-
empty
Empty annotations- Returns:
- The empty annotations
-
getFileAnnotations
Get the manifest annotations for a file- Parameters:
key- The key- Returns:
- The annotations
-
fromJson
Convert the annotations from a JSON string- Parameters:
json- The JSON string- Returns:
- The annotations
-
toJson
Convert the annotations to a JSON string- Returns:
- The JSON 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. -
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. -
equals
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 withObjects::equals(Object,Object). -
configAnnotations
Returns the value of theconfigAnnotationsrecord component.- Returns:
- the value of the
configAnnotationsrecord component
-
manifestAnnotations
Returns the value of themanifestAnnotationsrecord component.- Returns:
- the value of the
manifestAnnotationsrecord component
-
filesAnnotations
Returns the value of thefilesAnnotationsrecord component.- Returns:
- the value of the
filesAnnotationsrecord component
-