Package net.andreinc.mockneat.unit.text
Class Dicts
- java.lang.Object
-
- net.andreinc.mockneat.abstraction.MockUnitBase
-
- net.andreinc.mockneat.unit.text.Dicts
-
public class Dicts extends MockUnitBase
-
-
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 java.util.List<java.lang.String>data(DictType type)Returns all data from the dictionary as an immutable list.static Dictsdicts()Returns aDictsobject that can be used to generate data from the library existing dictionaries.MockUnitStringtype(DictType type)Returns a newMockUnitStringthat can be used to generate arbitrary values from a Dictionary (DictType.MockUnitStringtypes(DictType... types)Returns a newMockUnitStringthat can be used to generate arbitrary values from a list of dictionariesDictType.
-
-
-
Constructor Detail
-
Dicts
protected Dicts()
-
Dicts
public Dicts(MockNeat mockNeat)
-
-
Method Detail
-
dicts
public static Dicts dicts()
Returns a
Dictsobject that can be used to generate data from the library existing dictionaries.A dictionary is an
enummapping a text file containing a set of dataThe file contents are loaded in memory after the first call.
Check
DictTypeto see the comprehensive list.- Returns:
- A re-usable
Dictsobject.
-
type
public MockUnitString type(DictType type)
Returns a new
MockUnitStringthat can be used to generate arbitrary values from a Dictionary (DictType.- Parameters:
type- The type of the dictionary.- Returns:
- A new
MockUnitString
-
types
public MockUnitString types(DictType... types)
Returns a newMockUnitStringthat can be used to generate arbitrary values from a list of dictionariesDictType.- Parameters:
types- A var-arg array containing a list of possibleDictTypes.- Returns:
- A mew
MockUnitString
-
data
public java.util.List<java.lang.String> data(DictType type)
Returns all data from the dictionary as an immutable list.- Parameters:
type- the dictionary type we want to retrieve- Returns:
- The list of lines from the dict
-
-