Package ai.djl.repository
Class Metadata
java.lang.Object
ai.djl.repository.Metadata
- Direct Known Subclasses:
Metadata.MatchAllMetadata
A
Metadata
is a collection of Artifact
s with unified metadata (including MRL
) that are stored in the same "metadata.json" file.
All of the artifacts located within the metadata share the data defined at the metadata level such as name, description, and website. The key difference between the artifacts within the same metadata are the properties.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
AMetadata
class that matches all any search criteria. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addArtifact
(Artifact artifact) Adds one artifact for the metadata.void
addLicense
(License license) Adds oneLicense
.Returns theApplication
.Returns the artifactId.Returns all the artifacts in the metadata.Returns the description.Returns the groupId.Returns the last update date for the metadata.Returns theLicense
.Returns the metadata format version.getName()
Returns the metadata-level name.Returns the URI to the repository storing the metadata.Returns the resource type.Returns the website.final void
Restores artifacts state.search
(VersionRange versionRange, Map<String, String> filter) Returns the artifacts matching the version and property requirements.final void
setApplication
(Application application) Sets theApplication
.void
setArtifactId
(String artifactId) Sets the artifactId.void
setArtifacts
(List<Artifact> artifacts) Sets the artifacts for the metadata.void
setDescription
(String description) Sets the description.void
setGroupId
(String groupId) Sets the groupId.void
setLastUpdated
(Date lastUpdated) Sets the last update date for the metadata.void
setLicense
(Map<String, License> licenses) Sets theLicense
.void
setMetadataVersion
(String metadataVersion) Sets the metadata format version.void
Sets the metadata-level name.void
setRepositoryUri
(URI repositoryUri) Sets the repository URI.void
setResourceType
(String resourceType) Returns the resource type.void
setWebsite
(String website) Sets the website.
-
Field Details
-
groupId
-
artifactId
-
licenses
-
artifacts
-
-
Constructor Details
-
Metadata
public Metadata()
-
-
Method Details
-
search
Returns the artifacts matching the version and property requirements.- Parameters:
versionRange
- the version range for the artifactfilter
- the property filter- Returns:
- the matching artifacts
-
getMetadataVersion
Returns the metadata format version.- Returns:
- the metadata format version
-
setMetadataVersion
Sets the metadata format version.- Parameters:
metadataVersion
- the new version
-
getResourceType
Returns the resource type.- Returns:
- the resource type
-
setResourceType
Returns the resource type.- Parameters:
resourceType
- the resource type
-
getGroupId
Returns the groupId.- Returns:
- the groupId
-
setGroupId
Sets the groupId.- Parameters:
groupId
- the new groupId
-
getArtifactId
Returns the artifactId.- Returns:
- the artifactId
-
setArtifactId
Sets the artifactId.- Parameters:
artifactId
- the new artifactId
-
getName
Returns the metadata-level name.- Returns:
- the metadata-level name
-
setName
Sets the metadata-level name.- Parameters:
name
- the new metadata-level name
-
getDescription
Returns the description.- Returns:
- the description
-
setDescription
Sets the description.- Parameters:
description
- the description
-
getWebsite
Returns the website.- Returns:
- the website
-
setWebsite
Sets the website.- Parameters:
website
- the website
-
getApplication
Returns theApplication
.- Returns:
- the
Application
-
setApplication
Sets theApplication
.- Parameters:
application
-Application
-
getLicenses
Returns theLicense
.- Returns:
- licenses in this metadata
-
setLicense
Sets theLicense
.- Parameters:
licenses
-License
-
addLicense
Adds oneLicense
.- Parameters:
license
-License
-
getArtifacts
Returns all the artifacts in the metadata.- Returns:
- the artifacts in the metadata
-
setArtifacts
Sets the artifacts for the metadata.- Parameters:
artifacts
- the new artifacts
-
addArtifact
Adds one artifact for the metadata.- Parameters:
artifact
- the new artifact
-
getLastUpdated
Returns the last update date for the metadata.- Returns:
- the last update date
-
setLastUpdated
Sets the last update date for the metadata.- Parameters:
lastUpdated
- the new last update date
-
getRepositoryUri
Returns the URI to the repository storing the metadata.- Returns:
- the URI to the repository storing the metadata
-
setRepositoryUri
Sets the repository URI.- Parameters:
repositoryUri
- the new URI
-
init
Restores artifacts state.This call is required after the metadata is restored back from JSON.
- Parameters:
arguments
- the override arguments
-