Package net.glowstone.util.library
Class Library
java.lang.Object
net.glowstone.util.library.Library
- All Implemented Interfaces:
Comparable<Library>
Represents a library that will be injected into the classpath at runtime.
-
Constructor Summary
ConstructorDescriptionLibrary
(@NonNls String groupId, @NonNls String artifactId, @NonNls String version, LibraryManager.HashAlgorithm checksumType, @NonNls String checksumValue) Creates aLibrary
instance with the specified group ID, artifact ID, version, and checksum.Creates aLibrary
instance with the specified group ID, artifact ID, and version.Creates aLibrary
instance with the specified group ID, artifact ID, version, and repository.Library
(String groupId, String artifactId, String version, String repository, LibraryManager.HashAlgorithm checksumType, String checksumValue, boolean excludeDependencies) Creates aLibrary
instance with the specified group ID, artifact ID, version, repository, and checksum. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
static Library
fromConfigMap
(Map<?, ?> configMap) Extracts the needed information from a map of key-value pairs inside a config file to download aLibrary
and inject it at runtime.Returns the artifact ID of this library.The algorithm used to generate the checksum for this library, if one was specified.The checksum itself, validated against the library to make sure the library is intact.Returns the group ID of this library.The group ID of the library in a maven-style repo.The optional URL for this library, for use in cases where the library is not part of the default Maven repo.The version number of the library in a maven-style repo.int
hashCode()
boolean
Excludes the dependency from any dependency checks.Map<?,
?> Converts theLibrary
instance to a map that can be serialized and saved into a config file.toString()
-
Constructor Details
-
Library
Creates aLibrary
instance with the specified group ID, artifact ID, and version.- Parameters:
groupId
- The group ID of the library, separated by periods.artifactId
- The artifact ID of the library.version
- The version of the library.
-
Library
Creates aLibrary
instance with the specified group ID, artifact ID, version, and repository.- Parameters:
groupId
- The group ID of the library, separated by periods.artifactId
- The artifact ID of the library.version
- The version of the library.repository
- The URL of the library's repository.
-
Library
public Library(@NonNls @NonNls String groupId, @NonNls @NonNls String artifactId, @NonNls @NonNls String version, LibraryManager.HashAlgorithm checksumType, @NonNls @NonNls String checksumValue) Creates aLibrary
instance with the specified group ID, artifact ID, version, and checksum.- Parameters:
groupId
- The group ID of the library, separated by periods.artifactId
- The artifact ID of the library.version
- The version of the library.checksumType
- The type of hash the checksum is using.checksumValue
- The checksum to validate the downloaded library against.
-
Library
public Library(String groupId, String artifactId, String version, String repository, LibraryManager.HashAlgorithm checksumType, String checksumValue, boolean excludeDependencies) Creates aLibrary
instance with the specified group ID, artifact ID, version, repository, and checksum.- Parameters:
groupId
- The group ID of the library, separated by periods.artifactId
- The artifact ID of the library.version
- The version of the library.repository
- The URL of the library's repository.checksumType
- The type of hash the checksum is using.checksumValue
- The checksum to validate the downloaded library against.excludeDependencies
- Specifies that dependencies may be excluded.
-
-
Method Details
-
fromConfigMap
Extracts the needed information from a map of key-value pairs inside a config file to download aLibrary
and inject it at runtime.- Parameters:
configMap
- The Map that was extracted from a config file.- Returns:
- A
Library
instance populated with whatever information we could extract.
-
toConfigMap
Converts theLibrary
instance to a map that can be serialized and saved into a config file.- Returns:
- A map that is able to be serialized into a config.
-
getGroupId
Returns the group ID of this library. -
getArtifactId
Returns the artifact ID of this library. -
toString
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<Library>
-
getLibraryKey
The group ID of the library in a maven-style repo. Parts of the group ID must be separated by periods. -
getVersion
The version number of the library in a maven-style repo. -
getRepository
The optional URL for this library, for use in cases where the library is not part of the default Maven repo. -
getChecksumType
The algorithm used to generate the checksum for this library, if one was specified. -
getChecksumValue
The checksum itself, validated against the library to make sure the library is intact. -
isExcludeDependencies
public boolean isExcludeDependencies()Excludes the dependency from any dependency checks. Use this if the library is locally hosted.
-