Package ai.djl.repository
Class Metadata
- java.lang.Object
-
- ai.djl.repository.Metadata
-
- Direct Known Subclasses:
Metadata.MatchAllMetadata
public class Metadata extends java.lang.ObjectAMetadatais a collection ofArtifacts with unified metadata (includingMRL) 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:
Repository
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMetadata.MatchAllMetadataAMetadataclass that matches all any search criteria.
-
Constructor Summary
Constructors Constructor Description Metadata()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddArtifact(Artifact artifact)Adds one artifact for the metadata.voidaddLicense(License license)Adds oneLicense.ApplicationgetApplication()Returns theApplication.java.lang.StringgetArtifactId()Returns the artifactId.java.util.List<Artifact>getArtifacts()Returns all the artifacts in the metadata.java.lang.StringgetDescription()Returns the description.java.lang.StringgetGroupId()Returns the groupId.java.util.DategetLastUpdated()Returns the last update date for the metadata.java.util.Map<java.lang.String,License>getLicenses()Returns theLicense.java.lang.StringgetMetadataVersion()Returns the metadata format version.java.lang.StringgetName()Returns the metadata-level name.java.net.URIgetRepositoryUri()Returns the URI to the repository storing the metadata.java.lang.StringgetResourceType()Returns the resource type.java.lang.StringgetWebsite()Returns the website.voidinit(java.util.Map<java.lang.String,java.lang.String> arguments)Restores artifacts state.java.util.List<Artifact>search(VersionRange versionRange, java.util.Map<java.lang.String,java.lang.String> filter)Returns the artifacts matching the version and property requirements.voidsetApplication(Application application)Sets theApplication.voidsetArtifactId(java.lang.String artifactId)Sets the artifactId.voidsetArtifacts(java.util.List<Artifact> artifacts)Sets the artifacts for the metadata.voidsetDescription(java.lang.String description)Sets the description.voidsetGroupId(java.lang.String groupId)Sets the groupId.voidsetLastUpdated(java.util.Date lastUpdated)Sets the last update date for the metadata.voidsetLicense(java.util.Map<java.lang.String,License> licenses)Sets theLicense.voidsetMetadataVersion(java.lang.String metadataVersion)Sets the metadata format version.voidsetName(java.lang.String name)Sets the metadata-level name.voidsetRepositoryUri(java.net.URI repositoryUri)Sets the repository URI.voidsetResourceType(java.lang.String resourceType)Returns the resource type.voidsetWebsite(java.lang.String website)Sets the website.
-
-
-
Method Detail
-
search
public java.util.List<Artifact> search(VersionRange versionRange, java.util.Map<java.lang.String,java.lang.String> filter)
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
public java.lang.String getMetadataVersion()
Returns the metadata format version.- Returns:
- the metadata format version
-
setMetadataVersion
public void setMetadataVersion(java.lang.String metadataVersion)
Sets the metadata format version.- Parameters:
metadataVersion- the new version
-
getResourceType
public java.lang.String getResourceType()
Returns the resource type.- Returns:
- the resource type
-
setResourceType
public void setResourceType(java.lang.String resourceType)
Returns the resource type.- Parameters:
resourceType- the resource type
-
getGroupId
public java.lang.String getGroupId()
Returns the groupId.- Returns:
- the groupId
-
setGroupId
public void setGroupId(java.lang.String groupId)
Sets the groupId.- Parameters:
groupId- the new groupId
-
getArtifactId
public java.lang.String getArtifactId()
Returns the artifactId.- Returns:
- the artifactId
-
setArtifactId
public void setArtifactId(java.lang.String artifactId)
Sets the artifactId.- Parameters:
artifactId- the new artifactId
-
getName
public java.lang.String getName()
Returns the metadata-level name.- Returns:
- the metadata-level name
-
setName
public void setName(java.lang.String name)
Sets the metadata-level name.- Parameters:
name- the new metadata-level name
-
getDescription
public java.lang.String getDescription()
Returns the description.- Returns:
- the description
-
setDescription
public void setDescription(java.lang.String description)
Sets the description.- Parameters:
description- the description
-
getWebsite
public java.lang.String getWebsite()
Returns the website.- Returns:
- the website
-
setWebsite
public void setWebsite(java.lang.String website)
Sets the website.- Parameters:
website- the website
-
getApplication
public Application getApplication()
Returns theApplication.- Returns:
- the
Application
-
setApplication
public final void setApplication(Application application)
Sets theApplication.- Parameters:
application-Application
-
getLicenses
public java.util.Map<java.lang.String,License> getLicenses()
Returns theLicense.- Returns:
- licenses in this metadata
-
setLicense
public void setLicense(java.util.Map<java.lang.String,License> licenses)
Sets theLicense.- Parameters:
licenses-License
-
getArtifacts
public java.util.List<Artifact> getArtifacts()
Returns all the artifacts in the metadata.- Returns:
- the artifacts in the metadata
-
setArtifacts
public void setArtifacts(java.util.List<Artifact> artifacts)
Sets the artifacts for the metadata.- Parameters:
artifacts- the new artifacts
-
addArtifact
public void addArtifact(Artifact artifact)
Adds one artifact for the metadata.- Parameters:
artifact- the new artifact
-
getLastUpdated
public java.util.Date getLastUpdated()
Returns the last update date for the metadata.- Returns:
- the last update date
-
setLastUpdated
public void setLastUpdated(java.util.Date lastUpdated)
Sets the last update date for the metadata.- Parameters:
lastUpdated- the new last update date
-
getRepositoryUri
public java.net.URI getRepositoryUri()
Returns the URI to the repository storing the metadata.- Returns:
- the URI to the repository storing the metadata
-
setRepositoryUri
public void setRepositoryUri(java.net.URI repositoryUri)
Sets the repository URI.- Parameters:
repositoryUri- the new URI
-
init
public final void init(java.util.Map<java.lang.String,java.lang.String> arguments)
Restores artifacts state.This call is required after the metadata is restored back from JSON.
- Parameters:
arguments- the override arguments
-
-