public final class ImmutableVersionRange extends VersionRange
VersionRange.
Use the builder to create immutable instances:
ImmutableVersionRange.builder().
Use the static factory method to create immutable instances:
ImmutableVersionRange.of().
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableVersionRange.Builder
Builds instances of type
ImmutableVersionRange. |
| Modifier and Type | Method and Description |
|---|---|
static ImmutableVersionRange.Builder |
builder()
Creates a builder for
ImmutableVersionRange. |
static ImmutableVersionRange |
copyOf(VersionRange instance)
Creates an immutable copy of a
VersionRange value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableVersionRange that have equal attribute values. |
int |
hashCode()
Computes a hash code from attributes:
min, max. |
static ImmutableVersionRange |
of(NumericVersion min,
NumericVersion max)
Construct a new immutable
VersionRange instance. |
String |
toString()
Prints the immutable value
VersionRange with attribute values. |
ImmutableVersionRange |
withMax(NumericVersion value)
Copy the current immutable object by setting a value for the
max attribute. |
ImmutableVersionRange |
withMin(NumericVersion value)
Copy the current immutable object by setting a value for the
min attribute. |
match, ofclone, finalize, getClass, notify, notifyAll, wait, wait, waitall, andThen, anypublic final ImmutableVersionRange withMin(NumericVersion value)
min attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for minthis objectpublic final ImmutableVersionRange withMax(NumericVersion value)
max attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for maxthis objectpublic boolean equals(Object another)
ImmutableVersionRange that have equal attribute values.public int hashCode()
min, max.public String toString()
VersionRange with attribute values.public static ImmutableVersionRange of(NumericVersion min, NumericVersion max)
VersionRange instance.min - The value for the min attributemax - The value for the max attributepublic static ImmutableVersionRange copyOf(VersionRange instance)
VersionRange 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 ImmutableVersionRange.Builder builder()
ImmutableVersionRange.
ImmutableVersionRange.builder()
.min(de.flapdoodle.embed.mongo.distribution.NumericVersion) // required min
.max(de.flapdoodle.embed.mongo.distribution.NumericVersion) // required max
.build();
Copyright © 2021. All rights reserved.