Record Class Platform
java.lang.Object
java.lang.Record
de.infolektuell.gradle.jextract.model.Platform
- Record Components:
operatingSystem- Indicates the platform's operating systemarchitecture- Indicates the platform's processor architecture
public record Platform(Platform.OperatingSystem operatingSystem, Platform.Architecture architecture)
extends Record
Describes a platform where jextract can be installed and run.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDescribes a processor architecture for a given platform.static enumDescribes an operating system for a given platform. -
Constructor Summary
ConstructorsConstructorDescriptionPlatform(Platform.OperatingSystem operatingSystem, Platform.Architecture architecture) Creates an instance of aPlatformrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thearchitecturerecord component.final booleanIndicates whether some other object is "equal to" this one.static PlatformTries to infer the current running platform.final inthashCode()Returns a hash code value for this object.booleanisArch64()Checks if the platform's architecture is AArch64.booleanisLinux()Checks if the platform's OS is Linux.booleanisMac()Checks if the platform's OS is macOS.booleanChecks if the platform's OS is MS Windows.booleanisX64()Checks if the platform's architecture is X64.Returns the value of theoperatingSystemrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Platform
Creates an instance of aPlatformrecord class.- Parameters:
operatingSystem- the value for theoperatingSystemrecord componentarchitecture- the value for thearchitecturerecord component
-
-
Method Details
-
isLinux
public boolean isLinux()Checks if the platform's OS is Linux.- Returns:
- True if the platform's OS is Linux.
-
isMac
public boolean isMac()Checks if the platform's OS is macOS.- Returns:
- True if the platform's OS is macOS.
-
isWindows
public boolean isWindows()Checks if the platform's OS is MS Windows.- Returns:
- True if the platform's OS is MS Windows.
-
isArch64
public boolean isArch64()Checks if the platform's architecture is AArch64.- Returns:
- True if the platform's architecture is AArch64.
-
isX64
public boolean isX64()Checks if the platform's architecture is X64.- Returns:
- True if the platform's architecture is X64.
-
getCurrentPlatform
Tries to infer the current running platform.- Returns:
- The inferred platform, Linux on X64 by default.
-
toString
-
hashCode
-
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). -
operatingSystem
Returns the value of theoperatingSystemrecord component.- Returns:
- the value of the
operatingSystemrecord component
-
architecture
Returns the value of thearchitecturerecord component.- Returns:
- the value of the
architecturerecord component
-