Class ImmutableFileOrFiles

java.lang.Object
io.substrait.relation.files.ImmutableFileOrFiles
All Implemented Interfaces:
FileOrFiles

public final class ImmutableFileOrFiles extends Object implements FileOrFiles
Immutable implementation of FileOrFiles.

Use the builder to create immutable instances: ImmutableFileOrFiles.builder().

  • Method Details

    • pathType

      public Optional<FileOrFiles.PathType> pathType()
      Specified by:
      pathType in interface FileOrFiles
      Returns:
      The value of the pathType attribute
    • getPath

      public Optional<String> getPath()
      Specified by:
      getPath in interface FileOrFiles
      Returns:
      The value of the path attribute
    • getPartitionIndex

      public long getPartitionIndex()
      Specified by:
      getPartitionIndex in interface FileOrFiles
      Returns:
      The value of the partitionIndex attribute
    • getStart

      public long getStart()
      Specified by:
      getStart in interface FileOrFiles
      Returns:
      The value of the start attribute
    • getLength

      public long getLength()
      Specified by:
      getLength in interface FileOrFiles
      Returns:
      The value of the length attribute
    • getFileFormat

      public Optional<FileFormat> getFileFormat()
      Specified by:
      getFileFormat in interface FileOrFiles
      Returns:
      The value of the fileFormat attribute
    • withPathType

      public final ImmutableFileOrFiles withPathType(FileOrFiles.PathType value)
      Copy the current immutable object by setting a present value for the optional pathType attribute.
      Parameters:
      value - The value for pathType
      Returns:
      A modified copy or this if not changed
    • withPathType

      public final ImmutableFileOrFiles withPathType(Optional<? extends FileOrFiles.PathType> optional)
      Copy the current immutable object by setting an optional value for the pathType attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for pathType
      Returns:
      A modified copy or this if not changed
    • withPath

      public final ImmutableFileOrFiles withPath(String value)
      Copy the current immutable object by setting a present value for the optional path attribute.
      Parameters:
      value - The value for path
      Returns:
      A modified copy or this if not changed
    • withPath

      public final ImmutableFileOrFiles withPath(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the path attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for path
      Returns:
      A modified copy or this if not changed
    • withPartitionIndex

      public final ImmutableFileOrFiles withPartitionIndex(long value)
      Copy the current immutable object by setting a value for the partitionIndex attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for partitionIndex
      Returns:
      A modified copy or the this object
    • withStart

      public final ImmutableFileOrFiles withStart(long value)
      Copy the current immutable object by setting a value for the start attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for start
      Returns:
      A modified copy or the this object
    • withLength

      public final ImmutableFileOrFiles withLength(long value)
      Copy the current immutable object by setting a value for the length attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for length
      Returns:
      A modified copy or the this object
    • withFileFormat

      public final ImmutableFileOrFiles withFileFormat(FileFormat value)
      Copy the current immutable object by setting a present value for the optional fileFormat attribute.
      Parameters:
      value - The value for fileFormat
      Returns:
      A modified copy or this if not changed
    • withFileFormat

      public final ImmutableFileOrFiles withFileFormat(Optional<? extends FileFormat> optional)
      Copy the current immutable object by setting an optional value for the fileFormat attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for fileFormat
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableFileOrFiles that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: pathType, path, partitionIndex, start, length, fileFormat.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value FileOrFiles with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableFileOrFiles copyOf(FileOrFiles instance)
      Creates an immutable copy of a FileOrFiles value. 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 FileOrFiles instance
    • builder

      public static ImmutableFileOrFiles.Builder builder()
      Creates a builder for ImmutableFileOrFiles.
       ImmutableFileOrFiles.builder()
          .pathType(Optional<io.substrait.relation.files.FileOrFiles.PathType>) // optional pathType
          .path(Optional<String>) // optional path
          .partitionIndex(long) // required partitionIndex
          .start(long) // required start
          .length(long) // required length
          .fileFormat(Optional<io.substrait.relation.files.FileFormat>) // optional fileFormat
          .build();
       
      Returns:
      A new ImmutableFileOrFiles builder