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, registry, size -
Method Summary
Modifier and TypeMethodDescriptionstatic Configempty()An empty configbooleanstatic ConfigA config with referrence on a blob (too large for data)static ConfigCreate a config from a JSON stringGet the annotations@Nullable StringgetData()Get the data as a stringbyte[]Get the data as bytesinthashCode()toString()withAnnotations(Annotations annotations) Create a new config with annotationswithMediaType(String mediaType) Create a new config with media typeprotected ConfigwithRegistry(String registry) Return same instance but with resolved registryMethods inherited from class land.oras.Descriptor
getAnnotationsForJson, getArtifactType, getDigest, getJson, getMediaType, getRegistry, getSize, of, of, of, toJson, toSubject, withJson
-
Method Details
-
getAnnotations
Get the annotations- Overrides:
getAnnotationsin 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
-
withRegistry
Description copied from class:DescriptorReturn same instance but with resolved registry- Overrides:
withRegistryin classDescriptor- Parameters:
registry- The resolved registry- Returns:
- The descriptor with resolved registry
-
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
-
equals
- Overrides:
equalsin classDescriptor
-
hashCode
public int hashCode()- Overrides:
hashCodein classDescriptor
-
toString
- Overrides:
toStringin classDescriptor
-