public class FileHandleImpl.MutableFileHandleImpl extends FileHandleImpl implements FileHandle.MutableFileHandle
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 MutableFileHandle
in a
collection.FileHandleImpl.MutableFileHandleImpl
FileHandle.MutableFileHandle
PathAccessor.PathMutator, PathAccessor.PathProperty
NameAccessor.NameBuilder<B extends NameAccessor.NameBuilder<B>>, NameAccessor.NameMutator, NameAccessor.NameProperty
SizeAccessor.SizeMutator, SizeAccessor.SizeProperty
CreatedDateAccessor.CreatedDateMutator, CreatedDateAccessor.CreatedDateProperty
ModifiedDateAccessor.ModifiedDateMutator, ModifiedDateAccessor.ModifiedDateProperty
_createdDate, _modifiedDate, _name, _path, _size
Constructor and Description |
---|
MutableFileHandleImpl(FileHandle aFileHandle) |
MutableFileHandleImpl(String aPath,
String aName,
long aSize,
Date aCreatedDate,
Date aModifiedDate) |
Modifier and Type | Method and 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 #hashCode() and the
#equals(Object) operations. |
getCreatedDate, getModifiedDate, getName, getPath, getSize, toKey, toMutableFileHandle
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getCreatedDate, getModifiedDate, getName, getPath, getSize, toKey, toMutableFileHandle
public MutableFileHandleImpl(String aPath, String aName, long aSize, Date aCreatedDate, Date aModifiedDate)
public MutableFileHandleImpl(FileHandle aFileHandle)
public void setModifiedDate(Date aModifiedDate)
setModifiedDate
in interface ModifiedDateAccessor.ModifiedDateMutator
public void setSize(long aSize)
setSize
in interface SizeAccessor.SizeMutator
public void setName(String aName)
setName
in interface NameAccessor.NameMutator
public void setPath(String aPath)
setPath
in interface PathAccessor.PathMutator
public void setCreatedDate(Date aCreatedDate)
setCreatedDate
in interface CreatedDateAccessor.CreatedDateMutator
public int hashCode()
hashCode
in class FileHandleImpl
public boolean equals(Object obj)
equals
in class FileHandleImpl
public FileHandle toFileHandle()
FileHandle.MutableFileHandle
FileHandle.MutableFileHandle
back to a FileHandle
to avoid hassle with collections, the #hashCode()
and the
#equals(Object)
operations.toFileHandle
in interface FileHandle.MutableFileHandle
FileHandle
from this
FileHandle.MutableFileHandle
.Copyright © 2016. All rights reserved.