Package com.usatiuk.dhfsfs.objects
Record Class File
java.lang.Object
java.lang.Record
com.usatiuk.dhfsfs.objects.File
- Record Components:
key
- unique keymode
- file modecTime
- inode modification timemTime
- modification timesymlink
- 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 Summary
ConstructorsConstructorDescriptionFile
(JObjectKey key, long mode, long cTime, long mTime, boolean symlink) Creates an instance of aFile
record class. -
Method Summary
Modifier and TypeMethodDescriptionCollect outgoing references to other objects.long
cTime()
Returns the value of thecTime
record component.Class
<? extends JDataRemoteDto> dtoClass()
Returns the class of DTO of this object that should be used for remote synchronization.final boolean
Indicates whether some other object is "equal to" this one.int
Returns the estimated size of this remote object in bytes.final int
hashCode()
Returns a hash code value for this object.key()
Returns the value of thekey
record component.long
mode()
Returns the value of themode
record component.long
mTime()
Returns the value of themTime
record component.boolean
symlink()
Returns the value of thesymlink
record component.final String
toString()
Returns a string representation of this record class.withCTime
(long cTime) withMode
(long mode) withMTime
(long mTime) withSymlink
(boolean symlink)
-
Constructor Details
-
File
Creates an instance of aFile
record class.
-
-
Method Details
-
withSymlink
-
withMode
-
withCTime
-
withMTime
-
withCurrentMTime
-
withCurrentCTime
-
collectRefsTo
Description copied from interface:JDataRemote
Collect outgoing references to other objects.- Specified by:
collectRefsTo
in interfaceJDataRemote
- 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 interfaceJData
- Specified by:
estimateSize
in interfaceJDataRemote
- Returns:
- the estimated size of this remote object in bytes
-
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 interfaceJDataRemote
- Returns:
- the class of DTO of this object that should be used for remote synchronization
-
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. -
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. -
equals
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 withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
key
Returns the value of thekey
record component.- Specified by:
key
in interfaceJData
- Specified by:
key
in interfaceJDataRemote
- Returns:
- the value of the
key
record component
-
mode
public long mode()Returns the value of themode
record component.- Returns:
- the value of the
mode
record component
-
cTime
public long cTime()Returns the value of thecTime
record component.- Returns:
- the value of the
cTime
record component
-
mTime
public long mTime()Returns the value of themTime
record component.- Returns:
- the value of the
mTime
record component
-
symlink
public boolean symlink()Returns the value of thesymlink
record component.- Returns:
- the value of the
symlink
record component
-