Class AbstractOriginSupplier<T,B extends AbstractOriginSupplier<T,B>>

java.lang.Object
org.apache.commons.io.build.AbstractSupplier<T,B>
org.apache.commons.io.build.AbstractOriginSupplier<T,B>
Type Parameters:
T - the type of instances to build.
B - the type of builder subclass.
All Implemented Interfaces:
IOSupplier<T>
Direct Known Subclasses:
AbstractStreamBuilder

public abstract class AbstractOriginSupplier<T,B extends AbstractOriginSupplier<T,B>> extends AbstractSupplier<T,B>
Abstracts building an instance of T.
Since:
2.12.0
  • Constructor Details

  • Method Details

    • newByteArrayOrigin

      protected static AbstractOrigin.ByteArrayOrigin newByteArrayOrigin(byte[] origin)
      Constructs a new byte array origin for a byte array.
      Parameters:
      origin - the byte array.
      Returns:
      a new byte array origin.
    • newCharSequenceOrigin

      Constructs a new CharSequence origin for a CharSequence.
      Parameters:
      origin - the CharSequence.
      Returns:
      a new file origin.
      Since:
      2.13.0
    • newFileOrigin

      protected static AbstractOrigin.FileOrigin newFileOrigin(File origin)
      Constructs a new file origin for a file.
      Parameters:
      origin - the file.
      Returns:
      a new file origin.
    • newFileOrigin

      protected static AbstractOrigin.FileOrigin newFileOrigin(String origin)
      Constructs a new file origin for a file path.
      Parameters:
      origin - the file path.
      Returns:
      a new file origin.
    • newInputStreamOrigin

      Constructs a new input stream origin for a file.
      Parameters:
      origin - the input stream.
      Returns:
      a new input stream origin.
    • newOutputStreamOrigin

      Constructs a new output stream origin for a file.
      Parameters:
      origin - the output stream.
      Returns:
      a new output stream origin.
    • newPathOrigin

      protected static AbstractOrigin.PathOrigin newPathOrigin(Path origin)
      Constructs a new path origin for a file.
      Parameters:
      origin - the path.
      Returns:
      a new path origin.
    • newPathOrigin

      protected static AbstractOrigin.PathOrigin newPathOrigin(String origin)
      Constructs a new path name origin for a path name.
      Parameters:
      origin - the path name.
      Returns:
      a new path name origin.
    • newReaderOrigin

      Constructs a new reader origin for a reader.
      Parameters:
      origin - the reader.
      Returns:
      a new reader origin.
    • newURIOrigin

      protected static AbstractOrigin.URIOrigin newURIOrigin(URI origin)
      Constructs a new reader origin for a URI.
      Parameters:
      origin - the URI.
      Returns:
      a new URI origin.
    • newWriterOrigin

      Constructs a new writer origin for a file.
      Parameters:
      origin - the writer.
      Returns:
      a new writer .
    • checkOrigin

      protected AbstractOrigin<?,?> checkOrigin()
      Checks whether the origin is null.
      Returns:
      the origin.
      Throws:
      IllegalStateException - if the origin is null.
    • getOrigin

      protected AbstractOrigin<?,?> getOrigin()
      Gets the origin.
      Returns:
      the origin.
    • hasOrigin

      protected boolean hasOrigin()
      Tests whether the origin is null.
      Returns:
      whether the origin is null.
    • setByteArray

      public B setByteArray(byte[] origin)
      Sets a new origin.
      Parameters:
      origin - the new origin.
      Returns:
      this instance.
    • setCharSequence

      public B setCharSequence(CharSequence origin)
      Sets a new origin.
      Parameters:
      origin - the new origin.
      Returns:
      this instance.
      Since:
      2.13.0
    • setFile

      public B setFile(File origin)
      Sets a new origin.
      Parameters:
      origin - the new origin.
      Returns:
      this instance.
    • setFile

      public B setFile(String origin)
      Sets a new origin.
      Parameters:
      origin - the new origin.
      Returns:
      this instance.
    • setInputStream

      public B setInputStream(InputStream origin)
      Sets a new origin.
      Parameters:
      origin - the new origin.
      Returns:
      this instance.
    • setOrigin

      protected B setOrigin(AbstractOrigin<?,?> origin)
      Sets a new origin.
      Parameters:
      origin - the new origin.
      Returns:
      this instance.
    • setOutputStream

      public B setOutputStream(OutputStream origin)
      Sets a new origin.
      Parameters:
      origin - the new origin.
      Returns:
      this instance.
    • setPath

      public B setPath(Path origin)
      Sets a new origin.
      Parameters:
      origin - the new origin.
      Returns:
      this instance.
    • setPath

      public B setPath(String origin)
      Sets a new origin.
      Parameters:
      origin - the new origin.
      Returns:
      this instance.
    • setReader

      public B setReader(Reader origin)
      Sets a new origin.
      Parameters:
      origin - the new origin.
      Returns:
      this instance.
    • setURI

      public B setURI(URI origin)
      Sets a new origin.
      Parameters:
      origin - the new origin.
      Returns:
      this instance.
    • setWriter

      public B setWriter(Writer origin)
      Sets a new origin.
      Parameters:
      origin - the new origin.
      Returns:
      this instance.