public final class ImmutableDistribution extends Distribution
Distribution.
Use the builder to create immutable instances:
ImmutableDistribution.builder().
Use the static factory method to create immutable instances:
ImmutableDistribution.of().
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableDistribution.Builder
Builds instances of type
ImmutableDistribution. |
| Modifier and Type | Method and Description |
|---|---|
static ImmutableDistribution.Builder |
builder()
Creates a builder for
ImmutableDistribution. |
static ImmutableDistribution |
copyOf(Distribution instance)
Creates an immutable copy of a
Distribution value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableDistribution that have equal attribute values. |
int |
hashCode()
Computes a hash code from attributes:
version, platform. |
static ImmutableDistribution |
of(Version version,
de.flapdoodle.os.Platform platform)
Construct a new immutable
Distribution instance. |
de.flapdoodle.os.Platform |
platform() |
Version |
version() |
ImmutableDistribution |
withPlatform(de.flapdoodle.os.Platform value)
Copy the current immutable object by setting a value for the
platform attribute. |
ImmutableDistribution |
withVersion(Version value)
Copy the current immutable object by setting a value for the
version attribute. |
detectFor, toStringpublic Version version()
version in class Distributionversion attributepublic de.flapdoodle.os.Platform platform()
platform in class Distributionplatform attributepublic final ImmutableDistribution withVersion(Version value)
version attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for versionthis objectpublic final ImmutableDistribution withPlatform(de.flapdoodle.os.Platform value)
platform attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for platformthis objectpublic boolean equals(Object another)
ImmutableDistribution that have equal attribute values.public int hashCode()
version, platform.public static ImmutableDistribution of(Version version, de.flapdoodle.os.Platform platform)
Distribution instance.version - The value for the version attributeplatform - The value for the platform attributepublic static ImmutableDistribution copyOf(Distribution instance)
Distribution value.
Uses accessors to get values to initialize the new immutable instance.
If an instance is already immutable, it is returned as is.instance - The instance to copypublic static ImmutableDistribution.Builder builder()
ImmutableDistribution.
ImmutableDistribution.builder()
.version(de.flapdoodle.embed.process.distribution.Version) // required version
.platform(de.flapdoodle.os.Platform) // required platform
.build();
Copyright © 2022. All rights reserved.