Uses of Interface
org.instancio.InstancioApi
-
Uses of InstancioApi in org.instancio
Modifier and TypeInterfaceDescriptioninterface
Instancio API for defining type parameters for generic classes.interface
Instancio API for generating collections populated with random data.Modifier and TypeMethodDescriptionInstancioApi.assign
(Assignment... assignments) Generates values based on given assignments.<V> InstancioApi
<T> InstancioApi.generate
(TargetSelector selector, GeneratorSpec<V> spec) Customises values using arbitrary generator specs.<V> InstancioApi
<T> InstancioApi.generate
(TargetSelector selector, GeneratorSpecProvider<V> gen) Customises values using built-in generators provided by thegen
parameter, of typeGenerators
.InstancioApi.ignore
(TargetSelector selector) Specifies that a class or field should be ignored.InstancioApi.lenient()
Disables strict mode in which unused selectors trigger an error.static <T> InstancioApi
<T> Builder version ofInstancio.create(Model)
that allows overriding of generation parameters of an existing model.static <T> InstancioApi
<T> Instancio.of
(TypeTokenSupplier<T> typeToken) Builder version ofInstancio.create(TypeTokenSupplier)
that allows customisation of generated values.<V> InstancioApi
<T> InstancioApi.onComplete
(TargetSelector selector, OnCompleteCallback<V> callback) A callback that gets invoked after an object has been fully populated.<V> InstancioApi
<T> InstancioApi.set
(TargetSelector selector, V value) Sets a value to matching selector targets.<V> InstancioApi
<T> InstancioApi.setModel
(TargetSelector selector, Model<V> model) Applies givenmodel
to the specifiedselector
.InstancioApi.subtype
(TargetSelector selector, Class<?> subtype) Maps target field or class to the given subtype.<V> InstancioApi
<T> InstancioApi.supply
(TargetSelector selector, Supplier<V> supplier) Supplies an object using aSupplier
.<V> InstancioApi
<T> InstancioApi.supply
(TargetSelector selector, Generator<V> generator) Supplies an object using aGenerator
to matching selector targets.InstancioApi.verbose()
Outputs debug information toSystem.out
.InstancioApi.withMaxDepth
(int maxDepth) Specifies the maximum depth for populating an object.InstancioApi.withNullable
(TargetSelector selector) Specifies that a field or class is nullable.InstancioApi.withSeed
(long seed) Sets the seed value for the random number generator.<V> InstancioApi
<T> InstancioApi.withSetting
(SettingKey<V> key, V value) Override setting for the givenkey
with the specifiedvalue
.InstancioApi.withSettings
(Settings settings) Override defaultSettings
for generating values.InstancioOfClassApi.withTypeParameters
(Class<?>... types) Method for supplying type parameters for generic classes.