Enum Class SampleDocument

java.lang.Object
java.lang.Enum<SampleDocument>
ai.pipestream.module.pipelineprobe.SampleDocument
All Implemented Interfaces:
Serializable, Comparable<SampleDocument>, Constable

public enum SampleDocument extends Enum<SampleDocument>
Curated set of well-known sample documents bundled into the sidecar JAR for quick testing without needing a repository or manual upload.
  • Enum Constant Details

    • ALICE_IN_WONDERLAND

      public static final SampleDocument ALICE_IN_WONDERLAND
      Lewis Carroll's classic novel, as plain text.
    • PRIDE_AND_PREJUDICE

      public static final SampleDocument PRIDE_AND_PREJUDICE
      Jane Austen's novel, as plain text.
    • US_CONSTITUTION

      public static final SampleDocument US_CONSTITUTION
      Full text of the United States Constitution, as plain text.
    • SAMPLE_ARTICLE

      public static final SampleDocument SAMPLE_ARTICLE
      Short news-style article, as plain text.
    • CATH_AND_BRAZZ

      public static final SampleDocument CATH_AND_BRAZZ
      Short story, as plain text.
    • ATTENTION_PAPER

      public static final SampleDocument ATTENTION_PAPER
      Vaswani et al. 2017 transformer paper, as a PDF.
    • APPLE_FINANCIALS

      public static final SampleDocument APPLE_FINANCIALS
      Apple quarterly financial statements, as a PDF.
    • IRS_1040

      public static final SampleDocument IRS_1040
      U.S. individual income tax return form, as a PDF.
    • BIBLE_KJV

      public static final SampleDocument BIBLE_KJV
      Full text of the King James Bible, as plain text — a large stress-test corpus.
  • Method Details

    • values

      public static SampleDocument[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SampleDocument valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getTitle

      public String getTitle()
      Returns the human-readable display title of this sample document.
      Returns:
      the display title
    • getFileName

      public String getFileName()
      Returns the bundled resource file name (without the directory prefix).
      Returns:
      the file name
    • getSizeBytes

      public long getSizeBytes()
      Returns the size of the bundled file in bytes.
      Returns:
      the size in bytes
    • getMimeType

      public String getMimeType()
      Returns the MIME type of the bundled file (e.g. text/plain or application/pdf).
      Returns:
      the MIME type
    • getDescription

      public String getDescription()
      Returns the human-readable description of this sample document.
      Returns:
      the description
    • getResourcePath

      public String getResourcePath()
      Returns the full classpath resource path of the bundled file, formed by prefixing the file name with the sample-data directory.
      Returns:
      the classpath resource path
    • loadBytes

      public byte[] loadBytes() throws IOException
      Loads the full contents of this sample's bundled file from the thread-context classloader.
      Returns:
      the file contents as a byte array
      Throws:
      IOException - if the resource is not present on the classpath or cannot be read
    • toInfo

      public Map<String,Object> toInfo()
      Builds a metadata map describing this sample document, suitable for JSON serialization. Carries the enum name as id plus the title, file name, byte size, MIME type, and description.
      Returns:
      an immutable map of this document's metadata
    • fromId

      public static SampleDocument fromId(String id)
      Resolves a sample document from its id (the enum constant name).
      Parameters:
      id - the enum constant name to look up
      Returns:
      the matching sample document
      Throws:
      IllegalArgumentException - if id matches no constant; the message lists the valid ids