Class LoremIpsum4J


  • public class LoremIpsum4J
    extends Object
    Simple lorem ipsum text generator.

    Suitable for creating sample data for test cases and performance tests.

    Version:
    1.0
    Author:
    Sven Jacobs
    • Field Detail

      • LOREM_IPSUM

        public static final String LOREM_IPSUM
    • Constructor Detail

      • LoremIpsum4J

        public LoremIpsum4J()
    • Method Detail

      • getWords

        public String getWords()
        Returns one sentence (50 words) of the lorem ipsum text.
        Returns:
        50 words of lorem ipsum text
      • getWords

        public String getWords​(int amount)
        Returns words from the lorem ipsum text.
        Parameters:
        amount - Amount of words
        Returns:
        Lorem ipsum text
      • getWords

        public String getWords​(int amount,
                               int startIndex)
        Returns words from the lorem ipsum text.
        Parameters:
        amount - Amount of words
        startIndex - Start index of word to begin with (must be >= 0 and < 50)
        Returns:
        Lorem ipsum text
        Throws:
        IndexOutOfBoundsException - If startIndex is < 0 or > 49
      • getParagraphs

        public String getParagraphs()
        Returns two paragraphs of lorem ipsum.
        Returns:
        Lorem ipsum paragraphs
      • getParagraphs

        public String getParagraphs​(int amount)
        Returns paragraphs of lorem ipsum.
        Parameters:
        amount - Amount of paragraphs
        Returns:
        Lorem ipsum paragraphs