Class NativeLibraries.LibraryInfo

java.lang.Object
com.jme3.system.NativeLibraries.LibraryInfo
Enclosing class:
NativeLibraries

public static class NativeLibraries.LibraryInfo extends Object
A helper class that defines a native library by name, list of its native variants for target platforms and a load function used to load library from an absolute path after extracted by NativeLibraryLoader.
  • Constructor Details

    • LibraryInfo

      public LibraryInfo(String name)
      Define a library by the specified name and a default load function that uses System.load(String) to load extracted native from absolute path.
      Parameters:
      name - The library name. (not null)
    • LibraryInfo

      public LibraryInfo(String name, Consumer<String> loadFunction)
      Define a library by the specified name and specified load function that is used to load extracted native from an absolute path string.
      Parameters:
      name - The library name (not null)
      loadFunction - The load function for loading library from an absolute path string. (not null)
  • Method Details

    • getName

      public String getName()
      Returns:
      the library name.
    • getNativeVariants

      public List<com.jme3.system.NativeLibrary> getNativeVariants()
      Returns:
      the list of native variants, each targeting a specific platform.
    • addNativeVariant

      public NativeLibraries.LibraryInfo addNativeVariant(Platform platform, String pathInNativesJar)
      Adds a new native library that targets specified platform.
      Parameters:
      platform - The platform this library targets
      pathInNativesJar - The path of native file inside library jar
      Returns:
      this
    • addNativeVariant

      public NativeLibraries.LibraryInfo addNativeVariant(Platform platform, String pathInNativesJar, String extractedAsFileName)
      Adds a new native library that targets specified platform.
      Parameters:
      platform - The platform this library targets
      pathInNativesJar - The path of native file inside library jar
      extractedAsFileName - The filename that the library should be extracted as
      Returns:
      this