Record Class FileDto

java.lang.Object
java.lang.Record
com.usatiuk.dhfsfs.objects.FileDto
Record Components:
file - the file
chunks - the list of chunks, each represented as a pair of a long and a JObjectKey
All Implemented Interfaces:
JDataRemoteDto, Serializable

public record FileDto(File file, List<org.apache.commons.lang3.tuple.Pair<Long,JObjectKey>> chunks) extends Record implements JDataRemoteDto
FileDto is a data transfer object that contains a file and its chunks.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    FileDto(File file, List<org.apache.commons.lang3.tuple.Pair<Long,JObjectKey>> chunks)
    Creates an instance of a FileDto record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<org.apache.commons.lang3.tuple.Pair<Long,JObjectKey>>
    Returns the value of the chunks record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the file record component.
    final int
    Returns a hash code value for this object.
    Class<? extends JDataRemote>
    Returns the class of the remote object that this DTO represents.
    final String
    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

    • FileDto

      public FileDto(File file, List<org.apache.commons.lang3.tuple.Pair<Long,JObjectKey>> chunks)
      Creates an instance of a FileDto record class.
      Parameters:
      file - the value for the file record component
      chunks - the value for the chunks record component
  • Method Details

    • objClass

      public Class<? extends JDataRemote> objClass()
      Description copied from interface: JDataRemoteDto
      Returns the class of the remote object that this DTO represents.
      Specified by:
      objClass in interface JDataRemoteDto
      Returns:
      the class of the remote object that this DTO represents
    • toString

      public final 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • file

      public File file()
      Returns the value of the file record component.
      Returns:
      the value of the file record component
    • chunks

      public List<org.apache.commons.lang3.tuple.Pair<Long,JObjectKey>> chunks()
      Returns the value of the chunks record component.
      Returns:
      the value of the chunks record component