Record Class FileInfo
java.lang.Object
java.lang.Record
io.agentscope.harness.agent.filesystem.model.FileInfo
- Record Components:
path- absolute or relative file pathisDirectory- whether the entry is a directorysize- file size in bytes (approximate)modifiedAt- ISO 8601 timestamp of last modification, or empty string if unknown
public record FileInfo(String path, boolean isDirectory, long size, String modifiedAt)
extends Record
Structured file listing info. Only
path is required;
other fields are best-effort and may be absent depending on filesystem implementation.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisDirectoryrecord component.Returns the value of themodifiedAtrecord component.static FileInfostatic FileInfostatic FileInfostatic FileInfopath()Returns the value of thepathrecord component.longsize()Returns the value of thesizerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FileInfo
Creates an instance of aFileInforecord class.- Parameters:
path- the value for thepathrecord componentisDirectory- the value for theisDirectoryrecord componentsize- the value for thesizerecord componentmodifiedAt- the value for themodifiedAtrecord component
-
-
Method Details
-
ofFile
-
ofDir
-
ofFile
-
ofDir
-
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 '=='. -
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-
isDirectory
public boolean isDirectory()Returns the value of theisDirectoryrecord component.- Returns:
- the value of the
isDirectoryrecord component
-
size
public long size()Returns the value of thesizerecord component.- Returns:
- the value of the
sizerecord component
-
modifiedAt
Returns the value of themodifiedAtrecord component.- Returns:
- the value of the
modifiedAtrecord component
-