public final class NamedFile extends Object
This is an immutable class.
The name is intended to be a compact unique identifier for a file (in a particular context).
Constructor and Description |
---|
NamedFile(String identifier,
File file)
Create with an identifier and a file.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
File |
getFile()
The file.
|
String |
getIdentifier()
Unique identifier associated with the file.
|
Path |
getPath()
The path of
getFile() . |
int |
hashCode() |
NamedFile |
mapIdentifier(java.util.function.BiFunction<String,File,String> function)
Immutably renames the file, by assigning it a new identifier.
|
Path |
toPath()
Like
File.toPath() . |
String |
toString() |
public NamedFile mapIdentifier(java.util.function.BiFunction<String,File,String> function)
function
- generates a new identifier from the existing identifier and filepublic Path toPath()
File.toPath()
.public String getIdentifier()
public File getFile()
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.