Package org.instancio

Interface Result<T>

Type Parameters:
T - the result type

public interface Result<T>
A result containing a created object and seed that was used for populating its values. A result can be obtained by calling the InstancioApi.asResult() method.

Example:


 Result<Person> result = Instancio.of(Person.class)
     .set(field(Person::getName), "Homer Simpson")
     .asResult();

 Person person = result.get();
 long seed = result.getSeed();
 
Since:
1.5.1
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
    Returns the created object.
    long
    Returns the seed that was used to populate the created object.
  • Method Details

    • get

      T get()
      Returns the created object.
      Returns:
      created object
      Since:
      1.5.1
    • getSeed

      long getSeed()
      Returns the seed that was used to populate the created object.
      Returns:
      the seed
      Since:
      1.5.1