Class PersistentSampler

java.lang.Object
de.ppi.deepsampler.persistence.api.PersistentSampler

public class PersistentSampler
extends java.lang.Object
The persistent sampler is the entry point for all operations regarding the persistence:
  • loading samples
  • recording samples

To use the persistent you need a SourceManager, which will determine in which way the samples have to be recorded/loaded.

If this prerequisite is fulfilled you can use {source(SourceManager)} to start the definition of the persistent sample.

Example of using a json-SourceManager:

PersistentSampleManager.source(JsonSourceManager.builder("file.json")).record();
It's also possible to define multiple sources to record/load to/from multiple targets: PersistentSampleManager.source(JsonSourceManager.builder("file.json")) .source(JsonSourceManager.builder("file-copy.json")) .record();

With the JsonSourceManager deepsampler provides a reference implementation of a SourceManager which is capable of writing/loading to/from *.json files. To use it just include the project persistence-json as maven dependency.
If you need to write/load your samples to other data-sources you can implement your own SourceManager.
  • Method Summary

    Modifier and Type Method Description
    static PersistentSampleManager source​(SourceManager sourceManager)
    Entry method to load/record some samples.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait