Package io.github.astrapi69.file.create
Class FileInfo
- java.lang.Object
-
- io.github.astrapi69.file.create.FileInfo
-
- Direct Known Subclasses:
FileContentInfo
public class FileInfo extends java.lang.Object
The classFileInfo
provides data for create aFile
Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FileInfo.FileInfoBuilder<C extends FileInfo,B extends FileInfo.FileInfoBuilder<C,B>>
-
Constructor Summary
Constructors Modifier Constructor Description FileInfo()
protected
FileInfo(FileInfo.FileInfoBuilder<?,?> b)
FileInfo(java.io.File file)
FileInfo(java.lang.String name, java.lang.String path)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FileInfo.FileInfoBuilder<?,?>
builder()
protected boolean
canEqual(java.lang.Object other)
boolean
equals(java.lang.Object o)
java.lang.String
getName()
java.lang.String
getPath()
int
hashCode()
void
setName(java.lang.String name)
void
setPath(java.lang.String path)
static java.io.File
toFile(FileInfo fileInfo)
Factory method for creating only the newFile
object from the givenFileInfo
object.static FileInfo
toFileInfo(java.io.File file)
Converts the givenFile
object to aFileInfo
objectjava.lang.String
toString()
-
-
-
Constructor Detail
-
FileInfo
public FileInfo(java.lang.String name, java.lang.String path)
-
FileInfo
public FileInfo()
-
FileInfo
public FileInfo(java.io.File file)
-
FileInfo
protected FileInfo(FileInfo.FileInfoBuilder<?,?> b)
-
-
Method Detail
-
toFile
public static java.io.File toFile(FileInfo fileInfo)
Factory method for creating only the newFile
object from the givenFileInfo
object. This means that if the file does not exist it will not be created, if you want this behavior use theFileFactory.newFile(FileInfo)
orFileFactory.newFileQuietly(FileInfo)
method- Parameters:
fileInfo
- theFileInfo
object- Returns:
- the new
File
object
-
toFileInfo
public static FileInfo toFileInfo(java.io.File file)
Converts the givenFile
object to aFileInfo
object
-
builder
public static FileInfo.FileInfoBuilder<?,?> builder()
-
getName
public java.lang.String getName()
-
setName
public void setName(java.lang.String name)
-
getPath
public java.lang.String getPath()
-
setPath
public void setPath(java.lang.String path)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-