Package land.oras
Record Class Platform
java.lang.Object
java.lang.Record
land.oras.Platform
- Record Components:
os- The operating system of the platformarchitecture- The architecture of the platformvariant- The variant of the platform, which is optional and may be nullosVersion- The operating system version of the platform, which is optional and may befeatures- The features of the platform, which is optional and may be nullosFeatures- The operating system features of the platform, which is optional and may be
@NullMarked
public record Platform(@Nullable String os, @Nullable String architecture, @Nullable String osVersion, @Nullable String variant, @Nullable List<String> features, @Nullable List<String> osFeatures)
extends Record
Record for platform information
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the os of the platform, or "unknown" if the os is nullstatic Platformempty()Create a new platform with empty os and architecturefinal booleanIndicates whether some other object is "equal to" this one.features()Returns the value of thefeaturesrecord component.final inthashCode()Returns a hash code value for this object.static Platformlinux386()Create a new platform linux/amd64static PlatformCreate a new platform linux/amd64static PlatformCreate a new platform linux arm64/v8static PlatformCreate a new platform linux arm/v6static PlatformCreate a new platform linux arm/v7static PlatformCreate a new platform ppc64lestatic PlatformCreate a new platform riscv64static PlatformCreate a new platform s390xstatic booleanCheck if 2 platform are matching, which means the os and architecture are the same (including variant)static booleanCheck if 2 platform are matching, which means the os and architecture are the same (including variant)static PlatformCreate a new platform with the given os and architecturestatic PlatformCreate a new platform with the given os, architecture and variantos()Return the os of the platform, or "unknown" if the os is nullReturns the value of theosFeaturesrecord component.@Nullable StringReturns the value of theosVersionrecord component.final StringtoString()Returns a string representation of this record class.static Platformunknown()Create a new platform with unknown os and architecturestatic booleanunspecified(Platform platform) Return true if the platform is unspecified, which means both os and architecture are either empty or unknown@Nullable Stringvariant()Returns the value of thevariantrecord component.static PlatformCreate a new platform windows/amd64withFeatures(List<String> features) Create a new platform with the given featureswithOsFeatures(List<String> osFeatures) Create a new platform with the given os featureswithOsVersion(String osVersion) Create a new platform with the given os versionwithVariant(String variant) Create a new platform with the given variant
-
Constructor Details
-
Platform
public Platform(@Nullable String os, @Nullable String architecture, @Nullable String osVersion, @Nullable String variant, @Nullable List<String> features, @Nullable List<String> osFeatures) Creates an instance of aPlatformrecord class.- Parameters:
os- the value for theosrecord componentarchitecture- the value for thearchitecturerecord componentosVersion- the value for theosVersionrecord componentvariant- the value for thevariantrecord componentfeatures- the value for thefeaturesrecord componentosFeatures- the value for theosFeaturesrecord component
-
-
Method Details
-
linuxAmd64
Create a new platform linux/amd64- Returns:
- The platform
-
windowsAmd64
Create a new platform windows/amd64- Returns:
- The platform
-
linux386
Create a new platform linux/amd64- Returns:
- The platform
-
linuxArmV6
Create a new platform linux arm/v6- Returns:
- The platform
-
linuxArmV7
Create a new platform linux arm/v7- Returns:
- The platform
-
linuxArm64V8
Create a new platform linux arm64/v8- Returns:
- The platform
-
linuxPpc64le
Create a new platform ppc64le- Returns:
- The platform
-
linuxRiscv64
Create a new platform riscv64- Returns:
- The platform
-
linuxS390x
Create a new platform s390x- Returns:
- The platform
-
empty
Create a new platform with empty os and architecture- Returns:
- The platform
-
unknown
Create a new platform with unknown os and architecture- Returns:
- The platform
-
of
Create a new platform with the given os and architecture- Parameters:
os- The os of the platformarchitecture- The architecture of the platform- Returns:
- The platform
-
of
Create a new platform with the given os, architecture and variant- Parameters:
os- The os of the platformarchitecture- The architecture of the platformvariant- The variant of the platform- Returns:
- The platform
-
os
Return the os of the platform, or "unknown" if the os is null- Returns:
- The os of the platform
-
architecture
Return the os of the platform, or "unknown" if the os is null- Returns:
- The os of the platform
-
withFeatures
Create a new platform with the given features- Parameters:
features- The features of the platform- Returns:
- The platform
-
withVariant
Create a new platform with the given variant- Parameters:
variant- The variant of the platform- Returns:
- The platform
-
withOsVersion
Create a new platform with the given os version- Parameters:
osVersion- The os version of the platform- Returns:
- The platform
-
withOsFeatures
Create a new platform with the given os features- Parameters:
osFeatures- The os features of the platform- Returns:
- The platform
-
unspecified
Return true if the platform is unspecified, which means both os and architecture are either empty or unknown- Parameters:
platform- The platform to check- Returns:
- True if the platform is unspecified, false otherwise
-
matches
Check if 2 platform are matching, which means the os and architecture are the same (including variant)- Parameters:
platform- The platform to checktarget- The target platform to match- Returns:
- True if the platform is matching, false otherwise
-
matches
Check if 2 platform are matching, which means the os and architecture are the same (including variant)- Parameters:
platform- The platform to checktarget- The target platform to matchincludeVersion- Whether to include os version- Returns:
- True if the platform is matching, false otherwise
-
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). -
osVersion
Returns the value of theosVersionrecord component.- Returns:
- the value of the
osVersionrecord component
-
variant
Returns the value of thevariantrecord component.- Returns:
- the value of the
variantrecord component
-
features
Returns the value of thefeaturesrecord component.- Returns:
- the value of the
featuresrecord component
-
osFeatures
Returns the value of theosFeaturesrecord component.- Returns:
- the value of the
osFeaturesrecord component
-