Record Class File

java.lang.Object
java.lang.Record
com.usatiuk.dhfsfs.objects.File
Record Components:
key - unique key
mode - file mode
cTime - inode modification time
mTime - modification time
symlink - true if the file is a symlink, false otherwise
All Implemented Interfaces:
JMapHolder<JMapLongKey>, JDataRemote, JData, Serializable

public record File(JObjectKey key, long mode, long cTime, long mTime, boolean symlink) extends Record implements JDataRemote, JMapHolder<JMapLongKey>
File is a data structure that represents a file in the file system
See Also:
  • Constructor Details

    • File

      public File(JObjectKey key, long mode, long cTime, long mTime, boolean symlink)
      Creates an instance of a File record class.
      Parameters:
      key - the value for the key record component
      mode - the value for the mode record component
      cTime - the value for the cTime record component
      mTime - the value for the mTime record component
      symlink - the value for the symlink record component
  • Method Details

    • withSymlink

      public File withSymlink(boolean symlink)
    • withMode

      public File withMode(long mode)
    • withCTime

      public File withCTime(long cTime)
    • withMTime

      public File withMTime(long mTime)
    • withCurrentMTime

      public File withCurrentMTime()
    • withCurrentCTime

      public File withCurrentCTime()
    • collectRefsTo

      public Collection<JObjectKey> collectRefsTo()
      Description copied from interface: JDataRemote
      Collect outgoing references to other objects.
      Specified by:
      collectRefsTo in interface JDataRemote
      Returns:
      list of outgoing references
    • estimateSize

      public int estimateSize()
      Description copied from interface: JDataRemote
      Returns the estimated size of this remote object in bytes.
      Specified by:
      estimateSize in interface JData
      Specified by:
      estimateSize in interface JDataRemote
      Returns:
      the estimated size of this remote object in bytes
    • dtoClass

      public Class<? extends JDataRemoteDto> dtoClass()
      Description copied from interface: JDataRemote
      Returns the class of DTO of this object that should be used for remote synchronization. It can be the same as the object.
      Specified by:
      dtoClass in interface JDataRemote
      Returns:
      the class of DTO of this object that should be used for remote synchronization
    • 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. 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.
    • key

      public JObjectKey key()
      Returns the value of the key record component.
      Specified by:
      key in interface JData
      Specified by:
      key in interface JDataRemote
      Returns:
      the value of the key record component
    • mode

      public long mode()
      Returns the value of the mode record component.
      Returns:
      the value of the mode record component
    • cTime

      public long cTime()
      Returns the value of the cTime record component.
      Returns:
      the value of the cTime record component
    • mTime

      public long mTime()
      Returns the value of the mTime record component.
      Returns:
      the value of the mTime record component
    • symlink

      public boolean symlink()
      Returns the value of the symlink record component.
      Returns:
      the value of the symlink record component