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 theconfigAnnotations
record component.static Annotations
empty()
Empty annotationsfinal boolean
Indicates whether some other object is "equal to" this one.Returns the value of thefilesAnnotations
record component.static Annotations
Convert the annotations from a JSON stringgetFileAnnotations
(String key) Get the manifest annotations for a filefinal int
hashCode()
Returns a hash code value for this object.Returns the value of themanifestAnnotations
record component.static Annotations
Create a new annotations record with only config annotationsstatic Annotations
ofManifest
(@Nullable Map<String, String> manifestAnnotations) Create a new annotations record with only manifest annotationstoJson()
Convert the annotations to a JSON stringfinal String
toString()
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 aAnnotations
record class.- Parameters:
configAnnotations
- the value for theconfigAnnotations
record componentmanifestAnnotations
- the value for themanifestAnnotations
record componentfilesAnnotations
- the value for thefilesAnnotations
record 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 theconfigAnnotations
record component.- Returns:
- the value of the
configAnnotations
record component
-
manifestAnnotations
Returns the value of themanifestAnnotations
record component.- Returns:
- the value of the
manifestAnnotations
record component
-
filesAnnotations
Returns the value of thefilesAnnotations
record component.- Returns:
- the value of the
filesAnnotations
record component
-