Package com.codevasp.lazysodium.utils
Enum Class LibraryLoader.Mode
- All Implemented Interfaces:
Serializable,Comparable<LibraryLoader.Mode>,Constable
- Enclosing class:
- LibraryLoader
Library loading mode controls which libraries are attempted to be loaded (installed in the system or bundled
in the Lazysodium JAR) and in which order.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionLoad the bundled version, ignoring the system.Load the bundled native libraries first, then fallback to finding it in the system.Try to load the system sodium first, if that fails — load the bundled version.Load the system sodium only, ignoring the bundled. -
Method Summary
Modifier and TypeMethodDescriptionstatic LibraryLoader.ModeReturns the enum constant of this class with the specified name.static LibraryLoader.Mode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PREFER_SYSTEM
Try to load the system sodium first, if that fails — load the bundled version.This is the recommended mode, because it allows the clients to upgrade the sodium library as soon as it is available instead of waiting for lazysodium release and releasing a new version of the client library/application.
-
PREFER_BUNDLED
Load the bundled native libraries first, then fallback to finding it in the system. -
BUNDLED_ONLY
Load the bundled version, ignoring the system.This mode might be useful if the system sodium turns out to be outdated and cannot be upgraded.
-
SYSTEM_ONLY
Load the system sodium only, ignoring the bundled.This mode is recommended if it is required to use the system sodium only, and the application must fail if it is not installed.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-