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 nullarch- the target system architecture; defaults to the current architecture if nullnativeImageCapable- indicates whether the JDK should support native image compilationjavaFxBundled- indicates whether the JDK should include JavaFX librariesversionSpec- the version specification for the JDK; defaults to the latest version if nullstableReleaseOnly- indicates whether only stable releases should be consideredlongTermSupportOnly- indicates whether only long-term support (LTS) versions should be consideredfreeForProductionUseOnly- indicates whether only JDKs free for production use should be consideredvendorSpec- the JVM vendor specification; defaults to matching any vendor if nulllibcType- 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 Summary
ConstructorsConstructorDescriptionJdkQuery(OSFamily os, SystemArchitecture arch, Boolean nativeImageCapable, Boolean javaFxBundled, VersionSpec versionSpec, Boolean stableReleaseOnly, Boolean longTermSupportOnly, Boolean freeForProductionUseOnly, org.gradle.jvm.toolchain.JvmVendorSpec vendorSpec, String libcType) Initializes the query with defaults for unspecified attributes. -
Method Summary
Modifier and TypeMethodDescriptionarch()Returns the value of thearchrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefreeForProductionUseOnlyrecord component.final inthashCode()Returns a hash code value for this object.static booleanisCompatible(JdkSpec jdkSpec, JdkQuery jdkQuery) Determines if the specifiedJdkSpecis compatible with the constraints defined in theJdkQuery.Returns the value of thejavaFxBundledrecord component.libcType()Returns the value of thelibcTyperecord component.Returns the value of thelongTermSupportOnlyrecord component.Returns the value of thenativeImageCapablerecord component.os()Returns the value of theosrecord component.Returns the value of thestableReleaseOnlyrecord component.final StringtoString()Returns a string representation of this record class.org.gradle.jvm.toolchain.JvmVendorSpecReturns the value of thevendorSpecrecord component.Returns the value of theversionSpecrecord component.
-
Constructor Details
-
JdkQuery
public 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) Initializes the query with defaults for unspecified attributes.
-
-
Method Details
-
isCompatible
Determines if the specifiedJdkSpecis compatible with the constraints defined in theJdkQuery. 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 returnfalse.- Parameters:
jdkSpec- the specification of the JDK to be checked for compatibility.jdkQuery- the query defining the desired requirements for compatibility.- Returns:
trueif theJdkSpecis compatible with theJdkQuery, otherwisefalse.
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
os
Returns the value of theosrecord component.- Returns:
- the value of the
osrecord component
-
arch
Returns the value of thearchrecord component.- Returns:
- the value of the
archrecord component
-
nativeImageCapable
Returns the value of thenativeImageCapablerecord component.- Returns:
- the value of the
nativeImageCapablerecord component
-
javaFxBundled
Returns the value of thejavaFxBundledrecord component.- Returns:
- the value of the
javaFxBundledrecord component
-
versionSpec
Returns the value of theversionSpecrecord component.- Returns:
- the value of the
versionSpecrecord component
-
stableReleaseOnly
Returns the value of thestableReleaseOnlyrecord component.- Returns:
- the value of the
stableReleaseOnlyrecord component
-
longTermSupportOnly
Returns the value of thelongTermSupportOnlyrecord component.- Returns:
- the value of the
longTermSupportOnlyrecord component
-
freeForProductionUseOnly
Returns the value of thefreeForProductionUseOnlyrecord component.- Returns:
- the value of the
freeForProductionUseOnlyrecord component
-
vendorSpec
public org.gradle.jvm.toolchain.JvmVendorSpec vendorSpec()Returns the value of thevendorSpecrecord component.- Returns:
- the value of the
vendorSpecrecord component
-
libcType
Returns the value of thelibcTyperecord component.- Returns:
- the value of the
libcTyperecord component
-