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
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected Dicts()  
      Dicts​(MockNeat mockNeat)  
  • Method Summary

    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 Dicts dicts()
    Returns a Dicts object that can be used to generate data from the library existing dictionaries.
    MockUnitString type​(DictType type)
    Returns a new MockUnitString that can be used to generate arbitrary values from a Dictionary (DictType.
    MockUnitString types​(DictType... types)
    Returns a new MockUnitString that can be used to generate arbitrary values from a list of dictionaries DictType.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • dicts

      public static Dicts dicts()

      Returns a Dicts object that can be used to generate data from the library existing dictionaries.

      A dictionary is an enum mapping a text file containing a set of data

      The file contents are loaded in memory after the first call.

      Check DictType to see the comprehensive list.

      Returns:
      A re-usable Dicts object.
    • type

      public MockUnitString type​(DictType type)

      Returns a new MockUnitString that 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 new MockUnitString that can be used to generate arbitrary values from a list of dictionaries DictType.
      Parameters:
      types - A var-arg array containing a list of possible DictTypes.
      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