Class Chars
- java.lang.Object
-
- net.andreinc.mockneat.abstraction.MockUnitBase
-
- net.andreinc.mockneat.unit.types.Chars
-
- All Implemented Interfaces:
MockUnit<java.lang.Character>
public class Chars extends MockUnitBase implements MockUnit<java.lang.Character>
-
-
Field Summary
-
Fields inherited from class net.andreinc.mockneat.abstraction.MockUnitBase
mockNeat
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MockUnit<java.lang.Character>alphaNumeric()Returns a newMockUnit<Character>that is used to generate arbitraryCharactervalues.static Charschars()Returns aCharsobject that can be used to generate arbitraryCharactervalues.MockUnit<java.lang.Character>digits()Returns a newMockUnit<Character>that is used to generate arbitraryCharactervalues.MockUnit<java.lang.Character>from(char[] alphabet)Creates a newMockUnit<Character>that is used to generate arbitrary characters contained in thealphabet.MockUnit<java.lang.Character>from(java.lang.String alphabet)Creates a newMockUnit<Character>that is used to generate arbitrary characters contained in thealphabet.MockUnit<java.lang.Character>hex()Returns a newMockUnit<Character>that is used to generate arbitraryCharactervalues.MockUnit<java.lang.Character>letters()Returns a newMockUnit<Character>that is used to generate arbitraryCharactervalues.MockUnit<java.lang.Character>lowerLetters()Returns a newMockUnit<Character>that is used to generate arbitraryCharactervalues.java.util.function.Supplier<java.lang.Character>supplier()Returns the internalSupplier<Character>that is used to generate arbitraryCharactervalues.MockUnit<java.lang.Character>type(CharsType type)Returns a newMockUnit<Character>that is used to generate arbitraryCharactervalues.MockUnit<java.lang.Character>types(CharsType... types)Returns a newMockUnit<Character>that is used to generate arbitraryCharactervalues.MockUnit<java.lang.Character>upperLetters()Returns a newMockUnit<Character>that is used to generate arbitraryCharactervalues.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.andreinc.mockneat.abstraction.MockUnit
array, array, collection, collection, collection, collection, collection, collection, consume, consume, get, get, list, list, list, list, list, list, map, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapToDouble, mapToInt, mapToLocalDate, mapToLong, mapToString, mapToString, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, serialize, set, set, set, set, set, set, stream, val, val, valStr, valStr
-
-
-
-
Constructor Detail
-
Chars
protected Chars()
-
Chars
public Chars(MockNeat mock)
-
-
Method Detail
-
chars
public static Chars chars()
Returns a
Charsobject that can be used to generate arbitraryCharactervalues.Note: Without any additional constraint, the
Charsobject will generate alphanumeric characters.- Returns:
- A re-usable
Charsinstance. The class implementsMockUnit<Character>.
-
supplier
public java.util.function.Supplier<java.lang.Character> supplier()
Returns the internal
Supplier<Character>that is used to generate arbitraryCharactervalues. The generated characters are alphanumeric.
-
digits
public MockUnit<java.lang.Character> digits()
Returns a new
MockUnit<Character>that is used to generate arbitraryCharactervalues. The generated characters are digits.- Returns:
- A new
MockUnit<Character>that generates digits characters (Eg.: '0', '1', etc.)
-
lowerLetters
public MockUnit<java.lang.Character> lowerLetters()
Returns a new
MockUnit<Character>that is used to generate arbitraryCharactervalues. The generated characters are lower-case letters.- Returns:
- A new
MockUnit<Character>that generates lower-letter characters (Eg.: 'a', 'z', etc.)
-
upperLetters
public MockUnit<java.lang.Character> upperLetters()
Returns a new
MockUnit<Character>that is used to generate arbitraryCharactervalues. The generated characters are upper-case letters.- Returns:
- A new
MockUnit<Character>that generate lower-letters characters (Eg.: 'A', 'J', etc.)
-
letters
public MockUnit<java.lang.Character> letters()
Returns a new
MockUnit<Character>that is used to generate arbitraryCharactervalues. The generated values are letters.Note: The generated values are both lower-case and uppercase.
- Returns:
- A new
MockUnit<Character>that generate letters characters (Eg.: 'a', 'X', etc.)
-
hex
public MockUnit<java.lang.Character> hex()
Returns a new
MockUnit<Character>that is used to generate arbitraryCharactervalues. The generated values are HEXA-characters.Note: By HEXA-characters we mean:
{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9","a", "b", "c", "d", "e", "f"}- Returns:
- A new
MockUnit<Character>that generated HEXA-characters.
-
alphaNumeric
public MockUnit<java.lang.Character> alphaNumeric()
Returns a new
MockUnit<Character>that is used to generate arbitraryCharactervalues. The generated values are alphanumeric. The ' ' (space) character is not included.- Returns:
- A new
MockUnit<Character>that generate alpha-numeric characters.
-
type
public MockUnit<java.lang.Character> type(CharsType type)
Returns a new
MockUnit<Character>that is used to generate arbitraryCharactervalues. The generated characters match the supplied type:CharsType- Parameters:
type- The type of the characters.- Returns:
- A new
MockUnit<Character>that generatesCharactervalues of the giventype.
-
types
public MockUnit<java.lang.Character> types(CharsType... types)
Returns a new
MockUnit<Character>that is used to generate arbitraryCharactervalues. The generated characters match one of the supplied types:CharsType- Parameters:
types- A var-arg array of types. Everything you callval()on theMockUnita new character is generated matching one of the types.- Returns:
- A new
MockUnit<Character>that generatesCharactervalues of the given type(s).
-
from
public MockUnit<java.lang.Character> from(java.lang.String alphabet)
Creates a new
MockUnit<Character>that is used to generate arbitrary characters contained in thealphabet.- Parameters:
alphabet- Thealphabetfrom where the characters are randomly picked.- Returns:
- A new
MockUnit<Character>that generatesCharactervalues from the givenalphabet.
-
from
public MockUnit<java.lang.Character> from(char[] alphabet)
Creates a new
MockUnit<Character>that is used to generate arbitrary characters contained in thealphabet.- Parameters:
alphabet- Thealphabetfrom where the characters are randomly picked.- Returns:
- A new
MockUnit<Character>that generatesCharactervalues from the givenalphabet.
-
-