Class FileHandleImpl.MutableFileHandleImpl
java.lang.Object
org.refcodes.filesystem.FileHandleImpl
org.refcodes.filesystem.FileHandleImpl.MutableFileHandleImpl
- All Implemented Interfaces:
FileHandle, FileHandle.MutableFileHandle, FileSizeAccessor, FileSizeAccessor.FileSizeMutator, FileSizeAccessor.FileSizeProperty, CreatedDateAccessor, CreatedDateAccessor.CreatedDateMutator, CreatedDateAccessor.CreatedDateProperty, ModifiedDateAccessor, ModifiedDateAccessor.ModifiedDateMutator, ModifiedDateAccessor.ModifiedDateProperty, NameAccessor, NameAccessor.NameMutator, NameAccessor.NameProperty, PathAccessor<String>, PathAccessor.PathMutator<String>, PathAccessor.PathProperty<String>
- Enclosing class:
FileHandleImpl
public class FileHandleImpl.MutableFileHandleImpl
extends FileHandleImpl
implements FileHandle.MutableFileHandle
The implementation of a
FileHandle.MutableFileHandle.
-------------------------------------------------------------------------
CAUTION: fiddling with the path and the name attributes causes the
hashCode() and equals(Object) methods to change
behavior which can aCause problems ehttps://www.metacodes.proly 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.-
Nested Class Summary
Nested classes/interfaces inherited from class FileHandleImpl
FileHandleImpl.MutableFileHandleImplNested classes/interfaces inherited from interface CreatedDateAccessor
CreatedDateAccessor.CreatedDateMutator, CreatedDateAccessor.CreatedDatePropertyNested classes/interfaces inherited from interface FileHandle
FileHandle.MutableFileHandleNested classes/interfaces inherited from interface FileSizeAccessor
FileSizeAccessor.FileSizeBuilder<B>, FileSizeAccessor.FileSizeMutator, FileSizeAccessor.FileSizePropertyNested classes/interfaces inherited from interface ModifiedDateAccessor
ModifiedDateAccessor.ModifiedDateMutator, ModifiedDateAccessor.ModifiedDatePropertyNested classes/interfaces inherited from interface NameAccessor
NameAccessor.NameBuilder<B>, NameAccessor.NameMutator, NameAccessor.NamePropertyNested classes/interfaces inherited from interface PathAccessor
PathAccessor.PathBuilder<T,B>, PathAccessor.PathMutator<T>, PathAccessor.PathProperty<T> -
Field Summary
Fields inherited from class FileHandleImpl
_createdDate, _modifiedDate, _name, _path, _size -
Constructor Summary
ConstructorsConstructorDescriptionMutableFileHandleImpl(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. -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()voidsetCreatedDate(Date aCreatedDate) voidsetFileSize(long aSize) Sets the size for the size property.voidsetModifiedDate(Date aModifiedDate) voidvoidConverts theFileHandle.MutableFileHandleback to aFileHandleto avoid hassle with collections, theObject.hashCode()and theObject.equals(Object)operations.Methods inherited from class FileHandleImpl
getCreatedDate, getFileSize, getModifiedDate, getName, getPath, toKey, toMutableFileHandleMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CreatedDateAccessor.CreatedDateProperty
letCreatedDateMethods inherited from interface FileHandle
getCreatedDate, getFileSize, getModifiedDate, getName, getPath, toKey, toMutableFileHandleMethods inherited from interface FileSizeAccessor.FileSizeProperty
letFileSizeMethods inherited from interface ModifiedDateAccessor.ModifiedDateProperty
letModifiedDateMethods inherited from interface NameAccessor.NameProperty
letNameMethods inherited from interface PathAccessor.PathProperty
letPath
-
Constructor Details
-
MutableFileHandleImpl
-
MutableFileHandleImpl
Instantiates a new mutable file handle impl.- Parameters:
aFileHandle- the file handle
-
-
Method Details
-
setModifiedDate
- Specified by:
setModifiedDatein interfaceModifiedDateAccessor.ModifiedDateMutator
-
setFileSize
public void setFileSize(long aSize) Sets the size for the size property.- Specified by:
setFileSizein interfaceFileSizeAccessor.FileSizeMutator- Parameters:
aSize- The size to be stored by the size property.
-
setName
- Specified by:
setNamein interfaceNameAccessor.NameMutator
-
setPath
- Specified by:
setPathin interfacePathAccessor.PathMutator<String>
-
setCreatedDate
- Specified by:
setCreatedDatein interfaceCreatedDateAccessor.CreatedDateMutator
-
hashCode
public int hashCode()- Overrides:
hashCodein classFileHandleImpl
-
equals
- Overrides:
equalsin classFileHandleImpl
-
toFileHandle
Converts theFileHandle.MutableFileHandleback to aFileHandleto avoid hassle with collections, theObject.hashCode()and theObject.equals(Object)operations.- Specified by:
toFileHandlein interfaceFileHandle.MutableFileHandle- Returns:
- An immutable
FileHandlefrom thisFileHandle.MutableFileHandle.
-