Package land.oras
Class Descriptor
java.lang.Object
land.oras.Descriptor
Main class for descriptor
-
Field Summary
FieldsModifier and TypeFieldDescriptionAnnotations for the layerprotected final @Nullable String
The artifact typeprotected final @Nullable String
The digest of the layerprotected String
Original jsonprotected final String
The media type of the layerprotected final @Nullable Long
The size of the layer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the annotations@Nullable ArtifactType
Get the artifact type@Nullable String
Get the digestgetJson()
Return the original JSONfinal String
Get the media type@Nullable Long
getSize()
Get the sizestatic Descriptor
Create a new descriptorstatic Descriptor
Create a new descriptorstatic Descriptor
Create a new descriptorfinal String
toJson()
Return the JSON representation of this descriptorReturn this manifest descriptor as a subjectprotected Descriptor
Return same instance but with original JSON
-
Field Details
-
mediaType
The media type of the layer -
annotations
Annotations for the layer -
digest
The digest of the layer -
size
The size of the layer -
artifactType
The artifact type -
json
Original json
-
-
Constructor Details
-
Descriptor
protected Descriptor(String digest, Long size, String mediaType, Map<String, String> annotations, String artifactType, String json) Constructor- Parameters:
digest
- The digestsize
- The sizemediaType
- The media typeannotations
- The annotationsartifactType
- The artifact typejson
- The original JSON
-
-
Method Details
-
getJson
Return the original JSON- Returns:
- The original JSON
-
getAnnotations
Get the annotations- Returns:
- The annotations
-
getMediaType
Get the media type- Returns:
- The media type
-
getDigest
Get the digest- Returns:
- The digest
-
getSize
Get the size- Returns:
- The size
-
getArtifactType
Get the artifact type- Returns:
- The artifact type
-
toJson
Return the JSON representation of this descriptor- Returns:
- The JSON string
-
withJson
Return same instance but with original JSON- Parameters:
json
- The original JSON- Returns:
- The index
-
toSubject
Return this manifest descriptor as a subject- Returns:
- The subject
-
of
public static Descriptor of(String digest, Long size, String mediaType, Map<String, String> annotations, String artifactType) Create a new descriptor- Parameters:
digest
- The digestsize
- The sizemediaType
- The media typeannotations
- The annotationsartifactType
- The artifact type- Returns:
- The descriptor
-
of
Create a new descriptor- Parameters:
digest
- The digestsize
- The sizemediaType
- The media type- Returns:
- The descriptor
-
of
Create a new descriptor- Parameters:
digest
- The digestsize
- The size- Returns:
- The descriptor
-