Package ai.djl.repository
Class Artifact
java.lang.Object
ai.djl.repository.Artifact
An
Artifact
is a set of data files such as a model or dataset.- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A file (possibly compressed) within anArtifact
.static final class
AComparator
to compare artifacts based on their version numbers. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the artifact arguments.getArguments
(Map<String, Object> override) Returns the artifact arguments.getFiles()
Returns all the file items in the artifact.Returns the metadata containing this artifact.Returns the metadata format version.getName()
Returns the artifact name.getOptions
(Map<String, String> override) Returns the artifact options.Returns the artifact version as aVersion
.Returns the artifact properties.Returns the location of the resource directory.Returns the artifact version.boolean
hasProperties
(Map<String, String> filter) Returns true if every filter matches the corresponding property.boolean
Returns true if the artifact is a snapshot.void
setArguments
(Map<String, Object> arguments) Sets the artifact arguments.void
setFiles
(Map<String, Artifact.Item> files) Sets the file items.void
setMetadata
(Metadata metadata) Sets the associated metadata.void
setMetadataVersion
(String metadataVersion) Sets the metadata format version.void
Sets the artifact name.void
setOptions
(Map<String, String> options) Sets the artifact arguments.void
setProperties
(Map<String, String> properties) Sets the artifact properties.void
setSnapshot
(boolean snapshot) Sets if the artifact is a snapshot.void
setVersion
(String version) Sets the artifact version.toString()
-
Constructor Details
-
Artifact
public Artifact()
-
-
Method Details
-
getMetadataVersion
Returns the metadata format version.- Returns:
- the metadata format version
-
setMetadataVersion
Sets the metadata format version.- Parameters:
metadataVersion
- the new version
-
getVersion
Returns the artifact version.- Returns:
- the artifact version
- See Also:
-
setVersion
Sets the artifact version.- Parameters:
version
- the new version- See Also:
-
isSnapshot
public boolean isSnapshot()Returns true if the artifact is a snapshot.- Returns:
- true if the artifact is a snapshot
- See Also:
-
setSnapshot
public void setSnapshot(boolean snapshot) Sets if the artifact is a snapshot.- Parameters:
snapshot
- true to make the artifact a snapshot- See Also:
-
getName
Returns the artifact name.- Returns:
- the artifact name
-
setName
Sets the artifact name.- Parameters:
name
- the new name
-
getProperties
Returns the artifact properties.- Returns:
- the artifact properties
- See Also:
-
setProperties
Sets the artifact properties.- Parameters:
properties
- the new properties- See Also:
-
getArguments
Returns the artifact arguments.- Parameters:
override
- the override configurations to the default arguments- Returns:
- the artifact arguments
- See Also:
-
getArguments
Returns the artifact arguments.- Returns:
- the artifact arguments
-
setArguments
Sets the artifact arguments.- Parameters:
arguments
- the new arguments- See Also:
-
getOptions
Returns the artifact options.- Parameters:
override
- the override options to the default options- Returns:
- the artifact options
-
setOptions
Sets the artifact arguments.- Parameters:
options
- the new arguments
-
getMetadata
Returns the metadata containing this artifact.- Returns:
- the metadata containing this artifact
- See Also:
-
setMetadata
Sets the associated metadata.- Parameters:
metadata
- the new metadata- See Also:
-
getResourceUri
Returns the location of the resource directory.- Returns:
- the location of the resource directory
-
getFiles
Returns all the file items in the artifact.- Returns:
- all the file items in the artifact
-
setFiles
Sets the file items.- Parameters:
files
- the replacement file items
-
hasProperties
Returns true if every filter matches the corresponding property.- Parameters:
filter
- the values to check against the properties- Returns:
- true if every filter matches the corresponding property
- See Also:
-
getParsedVersion
Returns the artifact version as aVersion
. -
toString
-