Package land.oras
Class Index
java.lang.Object
land.oras.Descriptor
land.oras.Index
- All Implemented Interfaces:
Describable
Index from an OCI layout
-
Field Summary
Fields inherited from class land.oras.Descriptor
annotations, artifactType, digest, json, mediaType, size
-
Method Summary
Modifier and TypeMethodDescriptionstatic Index
Create an index from a JSON stringstatic Index
fromManifests
(List<ManifestDescriptor> descriptors) Create an index from a list of manifestsstatic Index
Create an index from a pathGet the annotationsGet the manifest descriptor for this describableGet the list of manifestsint
Get the schema versionGet the subjectwithDescriptor
(ManifestDescriptor descriptor) Return a new index with the given descriptorprotected Index
Return same instance but with original JSONwithNewManifests
(ManifestDescriptor manifest) Return a new index with new manifest added to indexwithSubject
(Subject subject) Return a new index with the given subjectMethods inherited from class land.oras.Descriptor
getArtifactType, getDigest, getJson, getMediaType, getSize, of, of, of, toJson, toSubject
-
Method Details
-
getSchemaVersion
public int getSchemaVersion()Get the schema version- Returns:
- The schema version
-
getManifests
Get the list of manifests- Returns:
- The list of manifests
-
withNewManifests
Return a new index with new manifest added to index- Parameters:
manifest
- The manifest- Returns:
- The index
-
getDescriptor
Description copied from interface:Describable
Get the manifest descriptor for this describable- Specified by:
getDescriptor
in interfaceDescribable
- Returns:
- The manifest descriptor
-
getAnnotations
Get the annotations- Overrides:
getAnnotations
in classDescriptor
- Returns:
- The annotations
-
withDescriptor
Return a new index with the given descriptor- Parameters:
descriptor
- The descriptor- Returns:
- The manifest
-
withJson
Return same instance but with original JSON- Overrides:
withJson
in classDescriptor
- Parameters:
json
- The original JSON- Returns:
- The index
-
getSubject
Description copied from interface:Describable
Get the subject- Specified by:
getSubject
in interfaceDescribable
- Returns:
- The subject
-
withSubject
Return a new index with the given subject- Parameters:
subject
- The subject- Returns:
- The index
-
fromJson
Create an index from a JSON string- Parameters:
json
- The JSON string- Returns:
- The index
-
fromPath
Create an index from a path- Parameters:
path
- The path- Returns:
- The index
-
fromManifests
Create an index from a list of manifests- Parameters:
descriptors
- The list of manifests- Returns:
- The index
-