Package io.substrait.plan
Class ImmutableVersion
java.lang.Object
io.substrait.plan.Plan.Version
io.substrait.plan.ImmutableVersion
Immutable implementation of
Plan.Version.
Use the builder to create immutable instances:
ImmutableVersion.builder().
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class io.substrait.plan.Plan.Version
DEFAULT_VERSION -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableVersion.Builderbuilder()Creates a builder forImmutableVersion.static ImmutableVersioncopyOf(Plan.Version instance) Creates an immutable copy of aPlan.Versionvalue.booleanThis instance is equal to all instances ofImmutableVersionthat have equal attribute values.intgetMajor()intgetMinor()intgetPatch()inthashCode()Computes a hash code from attributes:major,minor,patch,gitHash,producer.toString()Prints the immutable valueVersionwith attribute values.final ImmutableVersionwithGitHash(String value) Copy the current immutable object by setting a present value for the optionalgitHashattribute.final ImmutableVersionwithGitHash(Optional<String> optional) Copy the current immutable object by setting an optional value for thegitHashattribute.final ImmutableVersionwithMajor(int value) Copy the current immutable object by setting a value for themajorattribute.final ImmutableVersionwithMinor(int value) Copy the current immutable object by setting a value for theminorattribute.final ImmutableVersionwithPatch(int value) Copy the current immutable object by setting a value for thepatchattribute.final ImmutableVersionwithProducer(String value) Copy the current immutable object by setting a present value for the optionalproducerattribute.final ImmutableVersionwithProducer(Optional<String> optional) Copy the current immutable object by setting an optional value for theproducerattribute.
-
Method Details
-
getMajor
public int getMajor()- Specified by:
getMajorin classPlan.Version- Returns:
- The value of the
majorattribute
-
getMinor
public int getMinor()- Specified by:
getMinorin classPlan.Version- Returns:
- The value of the
minorattribute
-
getPatch
public int getPatch()- Specified by:
getPatchin classPlan.Version- Returns:
- The value of the
patchattribute
-
getGitHash
- Specified by:
getGitHashin classPlan.Version- Returns:
- The value of the
gitHashattribute
-
getProducer
- Specified by:
getProducerin classPlan.Version- Returns:
- The value of the
producerattribute
-
withMajor
Copy the current immutable object by setting a value for themajorattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for major- Returns:
- A modified copy or the
thisobject
-
withMinor
Copy the current immutable object by setting a value for theminorattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for minor- Returns:
- A modified copy or the
thisobject
-
withPatch
Copy the current immutable object by setting a value for thepatchattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for patch- Returns:
- A modified copy or the
thisobject
-
withGitHash
Copy the current immutable object by setting a present value for the optionalgitHashattribute.- Parameters:
value- The value for gitHash- Returns:
- A modified copy or
thisif not changed
-
withGitHash
Copy the current immutable object by setting an optional value for thegitHashattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for gitHash- Returns:
- A modified copy or
thisif not changed
-
withProducer
Copy the current immutable object by setting a present value for the optionalproducerattribute.- Parameters:
value- The value for producer- Returns:
- A modified copy or
thisif not changed
-
withProducer
Copy the current immutable object by setting an optional value for theproducerattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for producer- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofImmutableVersionthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:major,minor,patch,gitHash,producer. -
toString
Prints the immutable valueVersionwith attribute values. -
copyOf
Creates an immutable copy of aPlan.Versionvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Version instance
-
builder
Creates a builder forImmutableVersion.ImmutableVersion.builder() .major(int) // requiredmajor.minor(int) // requiredminor.patch(int) // requiredpatch.gitHash(Optional<String>) // optionalgitHash.producer(Optional<String>) // optionalproducer.build();- Returns:
- A new ImmutableVersion builder
-