Package land.oras
Class Layer
java.lang.Object
land.oras.Descriptor
land.oras.Layer
Class for layer
-
Field Summary
Fields inherited from class land.oras.Descriptor
annotations, artifactType, digest, json, mediaType, size -
Method Summary
Modifier and TypeMethodDescriptionstatic Layerempty()An empty configbooleanstatic LayerfromData(ContainerRef containerRef, byte[] data) Create a layer from datastatic LayerfromDigest(String digest, long size) Create a layer from a digeststatic LayerCreate a layer from a file using default digeststatic LayerfromFile(Path file, SupportedAlgorithm algorithm) Create a layer from a file using a specific algorithmstatic LayerCreate a layer from a JSON string@Nullable PathGet the blob path@Nullable StringgetData()Get the databyte[]Get the data as bytesinthashCode()toString()withAnnotations(Map<String, String> annotations) Create a new layer with annotationswithMediaType(String mediaType) Create a new layer with media typeMethods inherited from class land.oras.Descriptor
getAnnotations, getAnnotationsForJson, getArtifactType, getDigest, getJson, getMediaType, getSize, of, of, of, toJson, toSubject, withJson
-
Method Details
-
getData
Get the data- Returns:
- The data
-
getBlobPath
Get the blob path- Returns:
- The blob path
-
withAnnotations
Create a new layer with annotations- Parameters:
annotations- The annotations- Returns:
- The new layer
-
withMediaType
Create a new layer with media type- Parameters:
mediaType- The media type- Returns:
- The new layer
-
getDataBytes
public byte[] getDataBytes()Get the data as bytes- Returns:
- The data as bytes
-
fromJson
Create a layer from a JSON string- Parameters:
json- The JSON string- Returns:
- The manifest
-
fromFile
Create a layer from a file using default digest- Parameters:
file- The file- Returns:
- The layer
-
fromFile
Create a layer from a file using a specific algorithm- Parameters:
file- The filealgorithm- The algorithm- Returns:
- The layer
-
fromData
Create a layer from data- Parameters:
containerRef- The container referencedata- The data- Returns:
- The layer
-
fromDigest
Create a layer from a digest- Parameters:
digest- The digestsize- The size- Returns:
- The layer
-
empty
An empty config- Returns:
- The empty config
-
equals
- Overrides:
equalsin classDescriptor
-
hashCode
public int hashCode()- Overrides:
hashCodein classDescriptor
-
toString
- Overrides:
toStringin classDescriptor
-