Package land.oras
Class ManifestDescriptor
java.lang.Object
land.oras.ManifestDescriptor
Manifest descriptor
-
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic ManifestDescriptorCreate a manifest descriptor from a JSON stringGet the annotations@Nullable StringGet the artifact typeGet the digestGet the media typeReturn the platform as a Platform object@Nullable PlatformReturn the platform or null if the platform is not set Only use for serialization purposes, as the platform field is nullable in the JSON representation of the manifest descriptorlonggetSize()Get the sizeinthashCode()static ManifestDescriptorCreate a manifest descriptorstatic ManifestDescriptorof(Descriptor descriptor) Create a manifest descriptorstatic ManifestDescriptorof(Descriptor descriptor, @Nullable String digest) Create a manifest descriptor with the given digeststatic ManifestDescriptorUtility method.static ManifestDescriptorof(Manifest manifest, Platform platform, Annotations annotations, SupportedAlgorithm supportedAlgorithm) Utility method.Return this manifest descriptor as a descriptortoJson()Return the JSON representation of the manifesttoString()Return this manifest descriptor as a subjectwithAnnotations(@Nullable Map<String, String> annotations) Create a manifest descriptor with the given annotationswithArtifactType(@Nullable String artifactType) Create a manifest descriptor with the given artifact typewithPlatform(Platform platform) Create a manifest descriptor with the given platform
-
Method Details
-
getArtifactType
Get the artifact type- Returns:
- The artifact type
-
getMediaType
Get the media type- Returns:
- The media type
-
getDigest
Get the digest- Returns:
- The digest
-
getSize
public long getSize()Get the size- Returns:
- The size
-
getPlatform
Return the platform as a Platform object- Returns:
- The platform
-
getPlatformOrNull
Return the platform or null if the platform is not set Only use for serialization purposes, as the platform field is nullable in the JSON representation of the manifest descriptor- Returns:
- The platform or null
-
getAnnotations
Get the annotations- Returns:
- The annotations
-
toJson
Return the JSON representation of the manifest- Returns:
- The JSON string
-
fromJson
Create a manifest descriptor from a JSON string- Parameters:
json- The JSON string- Returns:
- The manifest
-
toDescriptor
Return this manifest descriptor as a descriptor- Returns:
- The descriptor
-
toSubject
Return this manifest descriptor as a subject- Returns:
- The subject
-
withAnnotations
Create a manifest descriptor with the given annotations- Parameters:
annotations- The annotations- Returns:
- The subject
-
withArtifactType
Create a manifest descriptor with the given artifact type- Parameters:
artifactType- The artifact type- Returns:
- The subject
-
withPlatform
Create a manifest descriptor with the given platform- Parameters:
platform- The platform- Returns:
- The subject
-
of
Create a manifest descriptor- Parameters:
mediaType- The media typedigest- The digestsize- The size- Returns:
- The subject
-
of
Create a manifest descriptor- Parameters:
descriptor- The descriptor- Returns:
- The subject
-
of
Utility method. Useful when assembly manifest to be added to an Index using no platform, empty annotations and default supported algorithm- Parameters:
manifest- The manifest- Returns:
- The manifest descriptor
-
of
public static ManifestDescriptor of(Manifest manifest, Platform platform, Annotations annotations, SupportedAlgorithm supportedAlgorithm) Utility method. Useful when assembly manifest to be added to an Index- Parameters:
manifest- The manifestplatform- The platformannotations- The annotationssupportedAlgorithm- The supported algorithm to calculate the digest of the manifest- Returns:
- The manifest descriptor
-
of
Create a manifest descriptor with the given digest- Parameters:
descriptor- The descriptordigest- The digest- Returns:
- The subject
-
equals
-
hashCode
public int hashCode() -
toString
-