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 TypeMethodDescriptionbooleanstatic IndexCreate an index from a JSON stringstatic IndexfromManifests(List<ManifestDescriptor> descriptors) Create an index from a list of manifestsstatic IndexCreate an index from a pathGet the annotationsGet the artifact type as string for JSON serializationGet the manifest descriptor for this describableGet the list of manifestsintGet the schema versionGet the subjectinthashCode()toString()withDescriptor(ManifestDescriptor descriptor) Return a new index with the given descriptorprotected IndexReturn 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
getAnnotationsForJson, 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
-
getArtifactTypeAsString
Get the artifact type as string for JSON serialization- Returns:
- The artifact type as string
-
withNewManifests
Return a new index with new manifest added to index- Parameters:
manifest- The manifest- Returns:
- The index
-
getDescriptor
Description copied from interface:DescribableGet the manifest descriptor for this describable- Specified by:
getDescriptorin interfaceDescribable- Returns:
- The manifest descriptor
-
getAnnotations
Get the annotations- Overrides:
getAnnotationsin 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:
withJsonin classDescriptor- Parameters:
json- The original JSON- Returns:
- The index
-
getSubject
Description copied from interface:DescribableGet the subject- Specified by:
getSubjectin 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
-
equals
- Overrides:
equalsin classDescriptor
-
hashCode
public int hashCode()- Overrides:
hashCodein classDescriptor
-
toString
- Overrides:
toStringin classDescriptor
-