FileHandle
, FileHandle.MutableFileHandle
, FileSizeAccessor
, FileSizeAccessor.FileSizeMutator
, FileSizeAccessor.FileSizeProperty
, org.refcodes.mixin.CreatedDateAccessor
, org.refcodes.mixin.CreatedDateAccessor.CreatedDateMutator
, org.refcodes.mixin.CreatedDateAccessor.CreatedDateProperty
, org.refcodes.mixin.ModifiedDateAccessor
, org.refcodes.mixin.ModifiedDateAccessor.ModifiedDateMutator
, org.refcodes.mixin.ModifiedDateAccessor.ModifiedDateProperty
, org.refcodes.mixin.NameAccessor
, org.refcodes.mixin.NameAccessor.NameMutator
, org.refcodes.mixin.NameAccessor.NameProperty
, org.refcodes.mixin.PathAccessor
, org.refcodes.mixin.PathAccessor.PathMutator
, org.refcodes.mixin.PathAccessor.PathProperty
public class FileHandleImpl.MutableFileHandleImpl extends FileHandleImpl implements FileHandle.MutableFileHandle
FileHandle.MutableFileHandle
.
-------------------------------------------------------------------------
CAUTION: fiddling with the path and the name attributes causes the
hashCode()
and equals(Object)
methods to change
behavior which can cause problems especially in collections!
-------------------------------------------------------------------------
ATTENTION: In order to avoid the above mentioned problems with the
equals(Object)
and hashCode()
methods, use
toFileHandle()
before storing a FileHandle.MutableFileHandle
in a
collection.org.refcodes.mixin.CreatedDateAccessor.CreatedDateMutator, org.refcodes.mixin.CreatedDateAccessor.CreatedDateProperty
FileHandle.MutableFileHandle
FileHandleImpl.MutableFileHandleImpl
FileSizeAccessor.FileSizeMutator, FileSizeAccessor.FileSizeProperty
org.refcodes.mixin.ModifiedDateAccessor.ModifiedDateMutator, org.refcodes.mixin.ModifiedDateAccessor.ModifiedDateProperty
_createdDate, _modifiedDate, _name, _path, _size
Constructor | Description |
---|---|
MutableFileHandleImpl(String aPath,
String aName,
long aSize,
Date aCreatedDate,
Date aModifiedDate) |
Instantiates a new mutable file handle impl.
|
MutableFileHandleImpl(FileHandle aFileHandle) |
Instantiates a new mutable file handle impl.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(Object obj) |
|
int |
hashCode() |
|
void |
setCreatedDate(Date aCreatedDate) |
|
void |
setFileSize(long aSize) |
Sets the size for the size property.
|
void |
setModifiedDate(Date aModifiedDate) |
|
void |
setName(String aName) |
|
void |
setPath(String aPath) |
|
FileHandle |
toFileHandle() |
Converts the
FileHandle.MutableFileHandle back to a FileHandle
to avoid hassle with collections, the Object.hashCode() and
the Object.equals(Object) operations. |
letCreatedDate
getCreatedDate, getFileSize, getModifiedDate, getName, getPath, toKey, toMutableFileHandle
getCreatedDate, getFileSize, getModifiedDate, getName, getPath, toKey, toMutableFileHandle
letFileSize
letModifiedDate
public MutableFileHandleImpl(String aPath, String aName, long aSize, Date aCreatedDate, Date aModifiedDate)
aPath
- the pathaName
- the nameaSize
- the sizeaCreatedDate
- the created dateaModifiedDate
- the modified datepublic MutableFileHandleImpl(FileHandle aFileHandle)
aFileHandle
- the file handlepublic void setModifiedDate(Date aModifiedDate)
setModifiedDate
in interface org.refcodes.mixin.ModifiedDateAccessor.ModifiedDateMutator
public void setFileSize(long aSize)
setFileSize
in interface FileSizeAccessor.FileSizeMutator
aSize
- The size to be stored by the size property.public void setName(String aName)
setName
in interface org.refcodes.mixin.NameAccessor.NameMutator
public void setPath(String aPath)
setPath
in interface org.refcodes.mixin.PathAccessor.PathMutator
public void setCreatedDate(Date aCreatedDate)
setCreatedDate
in interface org.refcodes.mixin.CreatedDateAccessor.CreatedDateMutator
public int hashCode()
hashCode
in class FileHandleImpl
public boolean equals(Object obj)
equals
in class FileHandleImpl
public FileHandle toFileHandle()
FileHandle.MutableFileHandle
back to a FileHandle
to avoid hassle with collections, the Object.hashCode()
and
the Object.equals(Object)
operations.toFileHandle
in interface FileHandle.MutableFileHandle
FileHandle
from this
FileHandle.MutableFileHandle
.Copyright © 2021. All rights reserved.