Package land.oras
Class Config
java.lang.Object
land.oras.Descriptor
land.oras.Config
Class for config
-
Field Summary
Fields inherited from class land.oras.Descriptor
annotations, artifactType, digest, json, mediaType, size
-
Method Summary
Modifier and TypeMethodDescriptionstatic Config
empty()
An empty configstatic Config
A config with referrence on a blob (too large for data)static Config
Create a config from a JSON stringGet the annotations@Nullable String
getData()
Get the data as a stringbyte[]
Get the data as byteswithAnnotations
(Annotations annotations) Create a new config with annotationswithMediaType
(String mediaType) Create a new config with media typeMethods inherited from class land.oras.Descriptor
getArtifactType, getDigest, getJson, getMediaType, getSize, of, of, of, toJson, toSubject, withJson
-
Method Details
-
getAnnotations
Get the annotations- Overrides:
getAnnotations
in classDescriptor
- Returns:
- The annotations
-
withAnnotations
Create a new config with annotations- Parameters:
annotations
- The annotations- Returns:
- The new config
-
withMediaType
Create a new config with media type- Parameters:
mediaType
- The media type- Returns:
- The new config
-
getDataBytes
public byte[] getDataBytes()Get the data as bytes- Returns:
- The data as bytes
-
getData
Get the data as a string- Returns:
- The data as a string
-
fromJson
Create a config from a JSON string- Parameters:
json
- The JSON string- Returns:
- The config
-
empty
An empty config- Returns:
- The empty config
-
fromBlob
A config with referrence on a blob (too large for data)- Parameters:
mediaType
- The media typelayer
- The layer- Returns:
- The config
-