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
org.refcodes.mixin.PathAccessor.PathBuilder<B extends org.refcodes.mixin.PathAccessor.PathBuilder<?>>, org.refcodes.mixin.PathAccessor.PathMutator, org.refcodes.mixin.PathAccessor.PathProperty
org.refcodes.mixin.NameAccessor.NameBuilder<B extends org.refcodes.mixin.NameAccessor.NameBuilder<B>>, org.refcodes.mixin.NameAccessor.NameMutator, org.refcodes.mixin.NameAccessor.NameProperty
org.refcodes.mixin.SizeAccessor.SizeMutator, org.refcodes.mixin.SizeAccessor.SizeProperty
_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 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
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 © 2017. All rights reserved.