Record Class JdkQuery

java.lang.Object
java.lang.Record
com.dua3.gradle.jdkprovider.types.JdkQuery
Record Components:
os - the target operating system family; defaults to the current OS if null
arch - the target system architecture; defaults to the current architecture if null
nativeImageCapable - indicates whether the JDK should support native image compilation
javaFxBundled - indicates whether the JDK should include JavaFX libraries
versionSpec - the version specification for the JDK; defaults to the latest version if null
stableReleaseOnly - indicates whether only stable releases should be considered
longTermSupportOnly - indicates whether only long-term support (LTS) versions should be considered
freeForProductionUseOnly - indicates whether only JDKs free for production use should be considered
vendorSpec - the JVM vendor specification; defaults to matching any vendor if null
libcType - the type of C standard library (e.g., "glibc", "musl"); defaults to detected libc type if null

public record JdkQuery(OSFamily os, SystemArchitecture arch, Boolean nativeImageCapable, Boolean javaFxBundled, VersionSpec versionSpec, Boolean stableReleaseOnly, Boolean longTermSupportOnly, Boolean freeForProductionUseOnly, org.gradle.jvm.toolchain.JvmVendorSpec vendorSpec, String libcType) extends Record
Represents a query interface for specifying requirements or characteristics of a JDK in terms of operating system, architecture, vendor, and additional configurations such as support for native images and JavaFX.
  • Constructor Details

  • Method Details

    • isCompatible

      public static boolean isCompatible(JdkSpec jdkSpec, JdkQuery jdkQuery)
      Determines if the specified JdkSpec is compatible with the constraints defined in the JdkQuery. Compatibility is assessed based on a series of criteria such as operating system, system architecture, native image support, JavaFX inclusion, version, and vendor. If any of these criteria are not met, the method will return false.
      Parameters:
      jdkSpec - the specification of the JDK to be checked for compatibility.
      jdkQuery - the query defining the desired requirements for compatibility.
      Returns:
      true if the JdkSpec is compatible with the JdkQuery, otherwise false.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • os

      public OSFamily os()
      Returns the value of the os record component.
      Returns:
      the value of the os record component
    • arch

      public SystemArchitecture arch()
      Returns the value of the arch record component.
      Returns:
      the value of the arch record component
    • nativeImageCapable

      public Boolean nativeImageCapable()
      Returns the value of the nativeImageCapable record component.
      Returns:
      the value of the nativeImageCapable record component
    • javaFxBundled

      public Boolean javaFxBundled()
      Returns the value of the javaFxBundled record component.
      Returns:
      the value of the javaFxBundled record component
    • versionSpec

      public VersionSpec versionSpec()
      Returns the value of the versionSpec record component.
      Returns:
      the value of the versionSpec record component
    • stableReleaseOnly

      public Boolean stableReleaseOnly()
      Returns the value of the stableReleaseOnly record component.
      Returns:
      the value of the stableReleaseOnly record component
    • longTermSupportOnly

      public Boolean longTermSupportOnly()
      Returns the value of the longTermSupportOnly record component.
      Returns:
      the value of the longTermSupportOnly record component
    • freeForProductionUseOnly

      public Boolean freeForProductionUseOnly()
      Returns the value of the freeForProductionUseOnly record component.
      Returns:
      the value of the freeForProductionUseOnly record component
    • vendorSpec

      public org.gradle.jvm.toolchain.JvmVendorSpec vendorSpec()
      Returns the value of the vendorSpec record component.
      Returns:
      the value of the vendorSpec record component
    • libcType

      public String libcType()
      Returns the value of the libcType record component.
      Returns:
      the value of the libcType record component