FileMetaData (Lucene 10.5.0 replicator API)
Description: declaration: package: org.apache.lucene.replicator.nrt, record: FileMetaData

Package org.apache.lucene.replicator.nrt

# Record Class FileMetaData

java.lang.Object
java.lang.Record
org.apache.lucene.replicator.nrt.FileMetaData

Record Components:
  `header` - Header of the file
  `footer` - Footer of the file
  `length` - Length of the file
  `checksum` - Used to ensure no bit flips when copying the file:

public record FileMetaData(byte[] header, byte[] footer, long length, long checksum) extends Record
Holds metadata details about a single file that we use to confirm two files (one remote, one local) are in fact "identical". Header and footer of the file must be identical between primary and replica to consider the files equal:

WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FileMetaData(byte[] header, byte[] footer, long length, long checksum)`
  Creates an instance of a `FileMetaData` record class.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long`
  `checksum()`
  Returns the value of the `checksum` record component.
  `final boolean`
  `equals(Object o)`
  Indicates whether some other object is "equal to" this one.
  `byte[]`
  `footer()`
  Returns the value of the `footer` record component.
  `final int`
  `hashCode()`
  Returns a hash code value for this object.
  `byte[]`
  `header()`
  Returns the value of the `header` record component.
  `long`
  `length()`
  Returns the value of the `length` record component.
  `String`
  `toString()`
  Returns a string representation of this record class.

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### FileMetaData

    public FileMetaData(byte[] header, byte[] footer, long length, long checksum)
    Creates an instance of a `FileMetaData` record class.
    Parameters:
      `header` - the value for the `header` record component
      `footer` - the value for the `footer` record component
      `length` - the value for the `length` record component
      `checksum` - the value for the `checksum` record component

- ## Method Details

  - ### toString

    public String toString()
    Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
    Specified by:
      `toString` in class `Record`
    Returns:
      a string representation of this object

  - ### hashCode

    public final int hashCode()
    Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
    Specified by:
      `hashCode` in class `Record`
    Returns:
      a hash code value for this object

  - ### equals

    public final boolean equals(Object o)
    Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with `Objects::equals(Object,Object)`; primitive components are compared with '=='.
    Specified by:
      `equals` in class `Record`
    Parameters:
      `o` - the object with which to compare
    Returns:
      `true` if this object is the same as the `o` argument; `false` otherwise.

  - ### header

    public byte[] header()
    Returns the value of the `header` record component.
    Returns:
      the value of the `header` record component

  - ### footer

    public byte[] footer()
    Returns the value of the `footer` record component.
    Returns:
      the value of the `footer` record component

  - ### length

    public long length()
    Returns the value of the `length` record component.
    Returns:
      the value of the `length` record component

  - ### checksum

    public long checksum()
    Returns the value of the `checksum` record component.
    Returns:
      the value of the `checksum` record component