FileHandle
, FileHandle.MutableFileHandle
, 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
, org.refcodes.mixin.SizeAccessor
, org.refcodes.mixin.SizeAccessor.SizeMutator
, org.refcodes.mixin.SizeAccessor.SizeProperty
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
org.refcodes.mixin.ModifiedDateAccessor.ModifiedDateMutator, org.refcodes.mixin.ModifiedDateAccessor.ModifiedDateProperty
org.refcodes.mixin.NameAccessor.NameBuilder<B extends org.refcodes.mixin.NameAccessor.NameBuilder<B>>, org.refcodes.mixin.NameAccessor.NameMutator, org.refcodes.mixin.NameAccessor.NameProperty
_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 |
setModifiedDate(Date aModifiedDate) |
|
void |
setName(String aName) |
|
void |
setPath(String aPath) |
|
void |
setSize(long aSize) |
|
FileHandle |
toFileHandle() |
Converts the
FileHandle.MutableFileHandle back to a FileHandle
to avoid hassle with collections, the Object.hashCode() and
the Object.equals(Object) operations. |
getCreatedDate, getModifiedDate, getName, getPath, getSize, toKey, toMutableFileHandle
getCreatedDate, getModifiedDate, getName, getPath, getSize, toKey, toMutableFileHandle
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 setSize(long aSize)
setSize
in interface org.refcodes.mixin.SizeAccessor.SizeMutator
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 © 2018. All rights reserved.