Class Metadata

java.lang.Object
ai.djl.repository.Metadata
Direct Known Subclasses:
Metadata.MatchAllMetadata

public class Metadata extends Object
A Metadata is a collection of Artifacts 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:
  • Field Details

  • Constructor Details

    • Metadata

      public Metadata()
  • Method Details

    • search

      public List<Artifact> search(VersionRange versionRange, Map<String,String> filter)
      Returns the artifacts matching the version and property requirements.
      Parameters:
      versionRange - the version range for the artifact
      filter - the property filter
      Returns:
      the matching artifacts
    • getMetadataVersion

      public String getMetadataVersion()
      Returns the metadata format version.
      Returns:
      the metadata format version
    • setMetadataVersion

      public void setMetadataVersion(String metadataVersion)
      Sets the metadata format version.
      Parameters:
      metadataVersion - the new version
    • getResourceType

      public String getResourceType()
      Returns the resource type.
      Returns:
      the resource type
    • setResourceType

      public void setResourceType(String resourceType)
      Returns the resource type.
      Parameters:
      resourceType - the resource type
    • getGroupId

      public String getGroupId()
      Returns the groupId.
      Returns:
      the groupId
    • setGroupId

      public void setGroupId(String groupId)
      Sets the groupId.
      Parameters:
      groupId - the new groupId
    • getArtifactId

      public String getArtifactId()
      Returns the artifactId.
      Returns:
      the artifactId
    • setArtifactId

      public void setArtifactId(String artifactId)
      Sets the artifactId.
      Parameters:
      artifactId - the new artifactId
    • getName

      public String getName()
      Returns the metadata-level name.
      Returns:
      the metadata-level name
    • setName

      public void setName(String name)
      Sets the metadata-level name.
      Parameters:
      name - the new metadata-level name
    • getDescription

      public String getDescription()
      Returns the description.
      Returns:
      the description
    • setDescription

      public void setDescription(String description)
      Sets the description.
      Parameters:
      description - the description
    • getWebsite

      public String getWebsite()
      Returns the website.
      Returns:
      the website
    • setWebsite

      public void setWebsite(String website)
      Sets the website.
      Parameters:
      website - the website
    • getApplication

      public Application getApplication()
      Returns the Application.
      Returns:
      the Application
    • setApplication

      public final void setApplication(Application application)
      Sets the Application.
      Parameters:
      application - Application
    • getLicenses

      public Map<String,License> getLicenses()
      Returns the License.
      Returns:
      licenses in this metadata
    • setLicense

      public void setLicense(Map<String,License> licenses)
      Sets the License.
      Parameters:
      licenses - License
    • addLicense

      public void addLicense(License license)
      Adds one License.
      Parameters:
      license - License
    • getArtifacts

      public List<Artifact> getArtifacts()
      Returns all the artifacts in the metadata.
      Returns:
      the artifacts in the metadata
    • setArtifacts

      public void setArtifacts(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 Date getLastUpdated()
      Returns the last update date for the metadata.
      Returns:
      the last update date
    • setLastUpdated

      public void setLastUpdated(Date lastUpdated)
      Sets the last update date for the metadata.
      Parameters:
      lastUpdated - the new last update date
    • getRepositoryUri

      public URI getRepositoryUri()
      Returns the URI to the repository storing the metadata.
      Returns:
      the URI to the repository storing the metadata
    • setRepositoryUri

      public void setRepositoryUri(URI repositoryUri)
      Sets the repository URI.
      Parameters:
      repositoryUri - the new URI
    • init

      public final void init(Map<String,String> arguments)
      Restores artifacts state.

      This call is required after the metadata is restored back from JSON.

      Parameters:
      arguments - the override arguments