Class FromFiles

java.lang.Object
net.andreinc.mockneat.abstraction.MockUnitBase
net.andreinc.mockneat.unit.text.FromFiles

public class FromFiles
extends MockUnitBase
  • Field Summary

    Fields inherited from class net.andreinc.mockneat.abstraction.MockUnitBase

    mockNeat
  • Constructor Summary

    Constructors 
    Constructor Description
    FromFiles()  
    FromFiles​(MockNeat mockNeat)  
  • Method Summary

    Modifier and Type Method Description
    static FromFiles files()
    Returns a FromFiles object that can used to generate random strings from a given text file.
    MockUnitString from​(java.lang.String path)
    Generates a new MockUnitString that can be used to generate String lines from the given path.

    Methods inherited from class java.lang.Object

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

  • Method Details

    • files

      public static FromFiles files()

      Returns a FromFiles object that can used to generate random strings from a given text file.

      Note: The file is loaded in memory. For the moment there is no functionality to "unload" it.

      Returns:
      A re-usable FromFiles object.
    • from

      public MockUnitString from​(java.lang.String path)

      Generates a new MockUnitString that can be used to generate String lines from the given path.

      Note: The files needs to exist and have read rights.

      Parameters:
      path - The path of the file from the disk.
      Returns:
      A new MockUnitString