Package org.exoplatform.services.bench
Class LoremIpsum4J
- java.lang.Object
-
- org.exoplatform.services.bench.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 Summary
Fields Modifier and Type Field Description static StringLOREM_IPSUM
-
Constructor Summary
Constructors Constructor Description LoremIpsum4J()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetParagraphs()Returns two paragraphs of lorem ipsum.StringgetParagraphs(int amount)Returns paragraphs of lorem ipsum.StringgetWords()Returns one sentence (50 words) of the lorem ipsum text.StringgetWords(int amount)Returns words from the lorem ipsum text.StringgetWords(int amount, int startIndex)Returns words from the lorem ipsum text.
-
-
-
Field Detail
-
LOREM_IPSUM
public static final String LOREM_IPSUM
-
-
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 wordsstartIndex- 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
-
-