Class AbstractOriginSupplier<T,​B extends 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
    • Method Detail

      • newCharSequenceOrigin

        protected static AbstractOrigin.CharSequenceOrigin newCharSequenceOrigin​(java.lang.CharSequence origin)
        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​(java.io.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​(java.lang.String origin)
        Constructs a new file origin for a file path.
        Parameters:
        origin - the file path.
        Returns:
        a new file origin.
      • newPathOrigin

        protected static AbstractOrigin.PathOrigin newPathOrigin​(java.nio.file.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​(java.lang.String origin)
        Constructs a new path name origin for a path name.
        Parameters:
        origin - the path name.
        Returns:
        a new path name origin.
      • newReaderOrigin

        protected static AbstractOrigin.ReaderOrigin newReaderOrigin​(java.io.Reader origin)
        Constructs a new reader origin for a reader.
        Parameters:
        origin - the reader.
        Returns:
        a new reader origin.
      • newURIOrigin

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

        protected AbstractOrigin<?,​?> checkOrigin()
        Checks whether the origin is null.
        Returns:
        the origin.
        Throws:
        java.lang.IllegalStateException - if the origin is null.
      • 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
      • setCharSequence

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

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

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

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

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

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

        public B setPath​(java.nio.file.Path origin)
        Sets a new origin.
        Parameters:
        origin - the new origin.
        Returns:
        this
      • setPath

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

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

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

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