Class FileInfo.FileInfoBuilder<C extends FileInfo,B extends FileInfo.FileInfoBuilder<C,B>>

java.lang.Object
io.github.astrapi69.file.create.model.FileInfo.FileInfoBuilder<C,B>
Type Parameters:
C - the type of `FileInfo` to build
B - the type of builder for `FileInfo`
Direct Known Subclasses:
FileContentInfo.FileContentInfoBuilder
Enclosing class:
FileInfo

public abstract static class FileInfo.FileInfoBuilder<C extends FileInfo,B extends FileInfo.FileInfoBuilder<C,B>> extends Object
The builder class for constructing `FileInfo` objects.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected B
    $fillValuesFrom(C instance)
    Internal method to fill the builder with values from an existing `FileInfo` instance.
    abstract C
    Builds the `FileInfo` object.
    directory(boolean directory)
    Sets whether the file is a directory.
    name(String name)
    Sets the name of the file.
    path(String path)
    Sets the path of the file.
    protected abstract B
    Returns this builder instance.
    Returns a string representation of the builder.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FileInfoBuilder

      public FileInfoBuilder()
  • Method Details

    • name

      public B name(String name)
      Sets the name of the file.
      Parameters:
      name - the name of the file
      Returns:
      this builder instance
    • path

      public B path(String path)
      Sets the path of the file.
      Parameters:
      path - the path of the file
      Returns:
      this builder instance
    • directory

      public B directory(boolean directory)
      Sets whether the file is a directory.
      Parameters:
      directory - true if the file is a directory, false otherwise
      Returns:
      this builder instance
    • $fillValuesFrom

      protected B $fillValuesFrom(C instance)
      Internal method to fill the builder with values from an existing `FileInfo` instance.
      Parameters:
      instance - the `FileInfo` instance to copy values from
      Returns:
      this builder instance
    • self

      protected abstract B self()
      Returns this builder instance.
      Returns:
      this builder instance
    • build

      public abstract C build()
      Builds the `FileInfo` object.
      Returns:
      the constructed `FileInfo` object
    • toString

      public String toString()
      Returns a string representation of the builder.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the builder