Package io.substrait.hint
Class ImmutableStats
java.lang.Object
io.substrait.hint.Hint.Stats
io.substrait.hint.ImmutableStats
- All Implemented Interfaces:
HasExtension
Immutable implementation of
Hint.Stats.
Use the builder to create immutable instances:
ImmutableStats.builder().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableStats.Builderbuilder()Creates a builder forImmutableStats.static ImmutableStatscopyOf(Hint.Stats instance) Creates an immutable copy of aHint.Statsvalue.booleanThis instance is equal to all instances ofImmutableStatsthat have equal attribute values.inthashCode()Computes a hash code from attributes:extension,rowCount,recordSize.doubledoublerowCount()toString()Prints the immutable valueStatswith attribute values.final ImmutableStatswithExtension(AdvancedExtension value) Copy the current immutable object by setting a present value for the optionalextensionattribute.final ImmutableStatswithExtension(Optional<? extends AdvancedExtension> optional) Copy the current immutable object by setting an optional value for theextensionattribute.final ImmutableStatswithRecordSize(double value) Copy the current immutable object by setting a value for therecordSizeattribute.final ImmutableStatswithRowCount(double value) Copy the current immutable object by setting a value for therowCountattribute.
-
Method Details
-
getExtension
- Returns:
- the
AdvancedExtensionassociated directly with the class
-
rowCount
public double rowCount()- Specified by:
rowCountin classHint.Stats- Returns:
- The value of the
rowCountattribute
-
recordSize
public double recordSize()- Specified by:
recordSizein classHint.Stats- Returns:
- The value of the
recordSizeattribute
-
withExtension
Copy the current immutable object by setting a present value for the optionalextensionattribute.- Parameters:
value- The value for extension- Returns:
- A modified copy or
thisif not changed
-
withExtension
Copy the current immutable object by setting an optional value for theextensionattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for extension- Returns:
- A modified copy or
thisif not changed
-
withRowCount
Copy the current immutable object by setting a value for therowCountattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for rowCount- Returns:
- A modified copy or the
thisobject
-
withRecordSize
Copy the current immutable object by setting a value for therecordSizeattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for recordSize- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofImmutableStatsthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:extension,rowCount,recordSize. -
toString
Prints the immutable valueStatswith attribute values. -
copyOf
Creates an immutable copy of aHint.Statsvalue. 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 Stats instance
-
builder
Creates a builder forImmutableStats.ImmutableStats.builder() .extension(Optional<io.substrait.extension.AdvancedExtension>) // optionalextension.rowCount(double) // requiredrowCount.recordSize(double) // requiredrecordSize.build();- Returns:
- A new ImmutableStats builder
-