Class JavaPlatform

java.lang.Object
build.spin.module.java.JavaPlatform
All Implemented Interfaces:
build.spin.Extension, build.spin.Service

public class JavaPlatform extends Object implements build.spin.Service
A Service providing access to the available JDKs.
Since:
Nov-2019
Author:
brian.oliver
  • Constructor Details

    • JavaPlatform

      public JavaPlatform()
      Constructs a JavaPlatform.
  • Method Details

    • stream

      public Stream<build.spawn.jdk.JDK> stream()
      Obtains a Stream of the available JDKs for the JavaPlatform.
      Returns:
      a Stream of JDKs
    • getVersion

      public Optional<build.spawn.jdk.JDK> getVersion(int major)
      Obtains the highest available JDK with the specified major version.
      Parameters:
      major - the major version
      Returns:
      Optional JDK
    • getEarliest

      public Optional<build.spawn.jdk.JDK> getEarliest()
      Obtains the earliest (lowest version) JDK available.
      Returns:
      Optional JDK
    • getLatest

      public Optional<build.spawn.jdk.JDK> getLatest()
      Obtains the latest (highest version) JDK available.
      Returns:
      Optional JDK
    • isJavaPlatformModule

      public static boolean isJavaPlatformModule(String moduleName)
      Determines if the specified module name is for a JavaPlatform module.
      Parameters:
      moduleName - the module name
      Returns:
      true if the specified module name is a JavaPlatform module, false otherwise