Uses of Annotation Type
org.instancio.documentation.ExperimentalApi
Packages that use ExperimentalApi
Package
Description
Instancio public-facing APIs; for usage examples see
Instancio.Contains classes related to
Feed.Contains classes related to generators.
Defines generator specs.
Defines classes that provide access to built-in generators.
Provides classes for overriding settings at runtime.
Defines Service Provider Interfaces for providing custom implementations.
Packages with annotations of type ExperimentalApi
-
Uses of ExperimentalApi in org.instancio
Classes in org.instancio with annotations of type ExperimentalApiModifier and TypeClassDescriptionfinal classA collection of static factory methods for creating assignments.interfaceAn assignment that can be passed to theInstancioApi.assign(Assignment...)method.interfaceInterface for configuringFeedinstances.interfaceA predicate for testing values using theBaseApi.filter(TargetSelector, FilterPredicate)method.interfaceRepresents an origin selector of a conditional assignment.interfaceRepresents an origin and a destination of a conditional assigment.interfaceDefines optional methods that can be chained toAssign.given(TargetSelector)builder expression.interfaceDefines methods one of which follow theAssign.given(TargetSelector)builder expressions to create an assignment.interfaceDefines optional methods that can be chained toAssign.given(TargetSelector, TargetSelector)builder expression.interfaceProvides an API for generating the Cartesian product.interfaceInstancioFeedApi<F extends Feed>An API for customising the properties of aFeed.interfaceA shorthand API for generating value types, such as strings, numbers, dates, etc.interfaceA supplier ofstartandendinterval values.interfaceRandomFunction<T,R> A function that accepts an argument and produces a randomised result.interfaceRepresents a unary operator that produces a result of the same type as its operand.interfaceValue of a target selector of an assignment.interfaceAn assigment containing origin and destination selectors.interfaceAn assigment containing origin and destination selectors, and a predicate that the origin value must satisfy for the assignment to be applied.final classProvides convenience methods for creatingPredicates.Methods in org.instancio with annotations of type ExperimentalApiModifier and TypeMethodDescriptionApplies this function to the giveninput.Applies this operator to the given operand, using the providedRandominstance.BaseApi.applyFeed(TargetSelector selector, Feed feed) Applies the providedfeedto the specifiedselector.BaseApi.applyFeed(TargetSelector selector, FeedProvider provider) Creates a feed and applies it to the specifiedselector.InstancioApi.applyFeed(TargetSelector selector, Feed feed) Applies the providedfeedto the specifiedselector.InstancioApi.applyFeed(TargetSelector selector, FeedProvider provider) Creates a feed and applies it to the specifiedselector.InstancioCartesianProductApi.applyFeed(TargetSelector selector, Feed feed) Applies the providedfeedto the specifiedselector.InstancioCartesianProductApi.applyFeed(TargetSelector selector, FeedProvider provider) Creates a feed and applies it to the specifiedselector.default <R> RA convenience method for mapping the result (as returned by theInstancioApi.create()method) to another object using afunction.InstancioApi.assign(Assignment... assignments) Generates values based on given assignments.InstancioCartesianProductApi.assign(Assignment... assignments) Generates values based on given assignments.Restricts this selector's targets to a depth that satisfies the givenpredicate.DepthSelector.atDepth(int depth) Restricts this selector's targets to the specified depth.InstancioCartesianProductApi.create()Returns he Cartesian product generated from values specified via theInstancioCartesianProductApi.with(TargetSelector, Object[])method as a list.InstancioFeedApi.create()Creates an instance of the feed.static <T> TInstancio.createBlank(Class<T> type) Creates a blank object of the specified class.static <F extends Feed>
FInstancio.createFeed(Class<F> type) Creates a feed of the specified type.FeedApi.dataAccess(FeedDataAccess feedDataAccess) Specifies the data access mode for the feed (sequential or random).IntervalSupplier.end()Returns a supplier that produces interval end value.BaseApi.filter(TargetSelector selector, FilterPredicate<V> predicate) Filters generated values using givenpredicate.<V> InstancioApi<T> InstancioApi.filter(TargetSelector selector, FilterPredicate<V> predicate) Filters generated values using givenpredicate.InstancioCartesianProductApi.filter(TargetSelector selector, FilterPredicate<V> predicate) Filters generated values using givenpredicate.FeedApi.formatOptions(FormatOptionsProvider provider) Specifies the data format options of aFeed, for example:InstancioFeedApi.formatOptions(FormatOptionsProvider provider) Specifies the data format options of aFeed, for example:FeedApi.formatType(FeedFormatType feedFormatType) Specifies the data format type for the feed, such as CSV (by default) or JSON, for example:InstancioFeedApi.formatType(FeedFormatType feedFormatType) Specifies the data format type for the feed, such as CSV (by default) or JSON, for example:static InstancioGenApiInstancio.gen()A shorthand API for generating simple value types, such as strings, numbers, dates, etc.<V> InstancioApi<T> InstancioApi.generate(TargetSelector selector, GeneratorSpec<V> spec) Customises values using arbitrary generator specs.InstancioCartesianProductApi.generate(TargetSelector selector, GeneratorSpec<V> spec) Customises values using arbitrary generator specs.static <T> GivenOriginCreates a conditional assignment for a givenorigintype.static <T,R> GivenOrigin Assign.given(GetMethodSelector<T, R> origin) Creates a conditional assignment for a givenoriginmethod reference and one or moredestinationselectors.static GivenOriginAssign.given(TargetSelector origin) Creates a conditional for a givenoriginand one or moredestinationselectors.static GivenOriginDestinationAssign.given(TargetSelector origin, TargetSelector destination) Creates a conditional assigment for a given pair oforiginanddestinationselectors.static <T> Predicate<T> When.is(T value) A predicate that returnstrueif values are equal usingObjects.equals(Object, Object).static <T> Predicate<T> When.isIn(T... values) A predicate that checks whether a value is equal to any element in thevaluesarray usingObjects.equals(Object, Object).static <T> Predicate<T> When.isNot(T value) A predicate that returnstrueif values are not equal usingObjects.equals(Object, Object).static <T> Predicate<T> When.isNotNull()A predicate that checks if a value is notnull.static <T> Predicate<T> When.isNull()A predicate that checks if a value isnull.static <T> InstancioClassApi<T> Builder version of theInstancio.createBlank(Class)method that allows customisation of generated values.static <T> InstancioCartesianProductApi<T> Instancio.ofCartesianProduct(Class<T> type) Generates the Cartesian product based on the values specified via thewith()method.static <T> InstancioCartesianProductApi<T> Instancio.ofCartesianProduct(Model<T> model) Generates the Cartesian product based on the values specified via thewith()method.static <T> InstancioCartesianProductApi<T> Instancio.ofCartesianProduct(TypeTokenSupplier<T> typeToken) Generates the Cartesian product based on the values specified via thewith()method.static <F extends Feed>
InstancioFeedApi<F> Builder version ofInstancio.createFeed(Class)that allows customising the feed's properties.FeedApi.onDataEnd(FeedDataEndAction feedDataEndAction) Specifies the action to take when the end of the data feed is reached.static ScopeSelect.scope(PredicateSelector selector) Creates a scope from the given predicate selector.BaseApi.setBlank(TargetSelector selector) Specifies that a blank object should be generated for the selected target.InstancioApi.setBlank(TargetSelector selector) Specifies that a blank object should be generated for the selected target.InstancioCartesianProductApi.setBlank(TargetSelector selector) Specifies that a blank object should be generated for the selected target.BaseApi.setModel(TargetSelector selector, Model<V> model) Applies givenmodelto the specifiedselector.<V> InstancioApi<T> InstancioApi.setModel(TargetSelector selector, Model<V> model) Applies givenmodelto the specifiedselector.InstancioCartesianProductApi.setModel(TargetSelector selector, Model<V> model) Applies givenmodelto the specifiedselector.static SelectorSelects a setter method by name in the specified class.static SelectorSelects a setter method by name and parameter type in the specified class.static SelectorSelects a setter by name declared in the class being created.static <T,U> Selector Select.setter(SetMethodSelector<T, U> methodReference) Selects a setter method based on the given method reference.IntervalSupplier.start()Returns a supplier that produces interval start value.FieldSelectorBuilder.toScope()Scope representation of a selector.PredicateSelector.toScope()Scope representation of a selector.TypeSelectorBuilder.toScope()Scope representation of a selector.static <T> ValueOfCreates an assignment for a given targettype.static <T,R> ValueOf Assign.valueOf(GetMethodSelector<T, R> target) Creates an assignment for a giventargetmethod reference.static ValueOfAssign.valueOf(TargetSelector target) Creates an assignment builder with a giventargetselector.InstancioApi.verbose()Outputs debug information toSystem.out.InstancioCartesianProductApi.with(TargetSelector selector, V... values) Sets a range of values for generating the Cartesian product.InstancioFeedApi.withDataSource(DataSourceProvider provider) Specifies the data source for aFeed, for example:Specifies the scope for this selector in order to narrow down its target.Specifies the scope for this selector in order to narrow down its target.Specifies the scope for this selector in order to narrow down its target.<V> InstancioFeedApi<F> InstancioFeedApi.withSetting(SettingKey<V> key, V value) Overrides the setting for the givenkeywith the specifiedvalue.<V> InstancioGenApiInstancioGenApi.withSetting(SettingKey<V> key, V value) Overrides the setting for the givenkeywith the specifiedvalue.InstancioFeedApi.withSettings(Settings settings) Merges the specifiedSettingswith the current settings, allowing for the addition and update of settings.InstancioGenApi.withSettings(Settings settings) Merges the specifiedSettingswith the current settings, allowing for the addition and update of settings.FeedApi.withTagKey(String tagKey) Specifies the tag key for filtering records in the data feed.InstancioFeedApi.withTagKey(String tagKey) Specifies the tag key for filtering records in the data feed.FeedApi.withTagValue(String tagValue) Specifies the tag value of the records to fetch.InstancioFeedApi.withTagValue(String tagValue) Specifies the tag value of the records to fetch.BaseApi.withUnique(TargetSelector selector) Specifies that the given selector's target(s) should have unique values.InstancioApi.withUnique(TargetSelector selector) Specifies that the given selector's target(s) should have unique values.InstancioCartesianProductApi.withUnique(TargetSelector selector) Specifies that the given selector's target(s) should have unique values. -
Uses of ExperimentalApi in org.instancio.feed
Classes in org.instancio.feed with annotations of type ExperimentalApiModifier and TypeInterfaceDescriptioninterfaceA data source for specs defined by aFeed.interfaceProvides aDataSourceusing the specifiedDataSourceProvider.DataSourceFactory.static interfaceCreatesDataSourceobjects from various underlying sources.interfaceThis interface provides support for using data from external sources (such as CSV or JSON files) and enables the following use cases: Generating values using methods defined by a feed. Populating values via thegenerate()method. Mapping feed data to an object usingapplyFeed(). Using a feed instance as a parameterized test argument.static @interfaceSpecifies the data access strategy to be used by a feed.static @interfaceAnnotation for specifying the data format type for a feed.static @interfaceAn annotation for specifying data for aFeed.static @interfaceAnnotation for specifying a property to use as a tag key in a data feed.interfaceProvider interface for buildingFeedinstances.static interfaceFactory for building instances of aFeed.interfaceFeedSpec<T>The return type for spec methods declared by aFeed.(package private) interfaceDefines built-in accessors for aFeed.interfaceDefines annotations that can be used withFeedSpecmethods.static @interfaceAllows mapping a property name from an external data source to a spec method in aFeed.static @interfaceA spec that is derived from one or more other specs.static @interfaceA feed spec that is generated by aGenerator.static @interfaceSpecifies that the annotated spec method can generatenullvalues.static @interfaceA template spec is for producing string values based on a string template with inputs provided by other specs.static @interfaceThis annotation allows specifying one or morePostProcessorclasses for processing values returned by the annotated spec method.static @interfaceAnnotation to specify a customFunctionto be used for converting string values to a specified type.interfaceProvides aFormatOptionsProvider.FormatOptionsusing the specifiedFormatOptionsProvider.FormatOptionsFactory.static interfaceMarker interface for supported data formats.static interfaceInterface for configuring CSV data format options.static interfaceCreatesFormatOptionsProvider.FormatOptionsobjects for supported data format types.interfaceA marker interface for classes that provide a method for handlingFeedSpecAnnotations.FunctionSpec.interfaceAn interface for applying additional processing to data returned by a spec method of aFeed.Methods in org.instancio.feed with annotations of type ExperimentalApiModifier and TypeMethodDescriptionFormatOptionsProvider.FormatOptions.CsvFormatOptions.commentPrefix(String commentPrefix) Sets the comment prefix (lines starting with this prefix will be treated as comments); default value is"#".FormatOptionsProvider.FormatOptionsFactory.csv()Allows specifying configuration options for parsing CSV files.FormatOptionsProvider.FormatOptions.CsvFormatOptions.delimiter(char delimiter) Sets the delimiter character; default value is','.DataSourceProvider.get(DataSourceProvider.DataSourceFactory factory) Gets aDataSourcefrom the givenfactory.FeedProvider.get(FeedProvider.FeedBuilderFactory feed) Configures aFeedinstance using the specified builder.FormatOptionsProvider.get(FormatOptionsProvider.FormatOptionsFactory factory) Configures format options using the givenfactory.DataSource.getInputStream()Returns an input stream containing the data for aFeed.default StringDataSource.getName()Returns the name of this data source, if applicable (for example, file name).Creates a feed instance of the specified feed class.default DataSourceCreates a data source for the givenpath.default FeedApiCreates a feed instance for the specified file path.default DataSourceDataSourceProvider.DataSourceFactory.ofInputStream(InputStream inputStream) Creates a data source for the giveninputStream.default FeedApiFeedProvider.FeedBuilderFactory.ofInputStream(InputStream inputStream) Creates a feed instance for the specified input stream.default DataSourceDataSourceProvider.DataSourceFactory.ofResource(String name) Creates a data source for the given resourcename.default FeedApiFeedProvider.FeedBuilderFactory.ofResource(String name) Creates a feed instance for the specified classpath resource.default DataSourceCreates a data source from the givendatastring.default FeedApiCreates a feed instance with the given data.Processes the giveninputvalue.FormatOptionsProvider.FormatOptions.CsvFormatOptions.trim(FeedDataTrim feedDataTrim) Specifies whether values should be trimmed of whitespace. -
Uses of ExperimentalApi in org.instancio.generator
Methods in org.instancio.generator with annotations of type ExperimentalApiModifier and TypeMethodDescriptiondefault voidGenerator.init(GeneratorContext context) An optional method for generators that need to initialise state before generating values. -
Uses of ExperimentalApi in org.instancio.generator.specs
Classes in org.instancio.generator.specs with annotations of type ExperimentalApiModifier and TypeInterfaceDescriptioninterfaceGenerator spec for producing CSV.interfaceSpec for generating CSV.interfaceA generator spec that emits given items to a selector's target.interfaceIntervalSpec<T>Spec for generating intervals of various types, such as numeric and temporal values.interfaceNumericSequenceGeneratorSpec<T extends Number & Comparable<T>>A spec for generating numeric sequences.interfaceNumericSequenceSpec<T extends Number & Comparable<T>>Spec for generating numeric sequences.interfaceShuffleSpec<T>Spec for shuffling elements in a random order, providing the results as aCollection.Methods in org.instancio.generator.specs with annotations of type ExperimentalApiModifier and TypeMethodDescriptionPathGeneratorSpec.createDirectory()Terminal method to indicate that the generated path, including parent directories (if any), should be created as a directory in the file system.PathGeneratorSpec.createFile()Terminal method to indicate that the generated path, including parent directories (if any), should be created as a file in the file system.PathGeneratorSpec.createFile(InputStream content) Terminal method to indicate that the generated path, including parent directories (if any), should be created as a file in the file system and content provided by the input stream written to the file.IntervalSpec.nextEnd(RandomUnaryOperator<T> nextEndFn) Specifies the function for calculating theendvalue of the interval based on thestartvalue of the current interval.IntervalSpec.nextStart(RandomUnaryOperator<T> nextStartFn) Specifies the function for calculating thestartvalue of the next interval based on theendvalue of the current interval.StringGeneratorSpec.numericSequence()Generates a string sequence that starts from"1"and increments by one.BigDecimalGeneratorSpec.precision(int precision) Precision of the generatedBigDecimal.BigDecimalSpec.precision(int precision) Precision of the generatedBigDecimal.ShuffleSpec.shuffle(Collection<T> collection) Creates a copy of the specified collection and shuffles its elements.Creates a copy of the specified array and shuffles its elements.StringGeneratorSpec.unicode(Character.UnicodeBlock... blocks) Generates a Unicode string that consists of random code points excluding the following character types:Character.PRIVATE_USECharacter.SURROGATECharacter.UNASSIGNEDStringSpec.unicode(Character.UnicodeBlock... blocks) Generates a Unicode string that consists of random code points excluding the following character types:Character.PRIVATE_USECharacter.SURROGATECharacter.UNASSIGNED -
Uses of ExperimentalApi in org.instancio.generators
Methods in org.instancio.generators with annotations of type ExperimentalApiModifier and TypeMethodDescriptionTextGenerators.csv()Generates CSV.TextSpecs.csv()Generates CSV.<T> EmitGeneratorSpec<T> Generators.emit()Emits provided items to a selector's target.<T> IntervalSpec<T> ValueSpecs.intervalStarting(T startingValue) A spec for generating intervals of various types, such as numeric and temporal values.<T> ShuffleSpec<T> ValueSpecs.shuffle(Collection<T> collection) Creates a copy of the specified collection and shuffles its elements.<T> ShuffleSpec<T> ValueSpecs.shuffle(T... array) Creates a copy of the specified array and shuffles its elements. -
Uses of ExperimentalApi in org.instancio.settings
Classes in org.instancio.settings with annotations of type ExperimentalApiModifier and TypeClassDescriptionenumA setting that specifies whether objects should be populated via fields or methods.enumA setting that specifies whether Bean Validation annotations are declared on fields or getters.enumSpecifies howFeeddata is accessed.enumThis setting is only applicable ifKeys.FEED_DATA_ACCESSis set toFeedDataAccess.SEQUENTIAL.enumEnumeration representing the options for trimming data in a feed.enumEnumeration of data format types supported by theFeed.Sourceannotation.final classA class containing modifier constants.enumA setting that specifies what should happen if an error occurs when setting a field's value.enumA setting that specifies what should happen if an error occurs during a setter method invocation.enumSpecifies the style of setter to use whenAssignmentType.METHODis enabled.static interfaceA builder for creating custom keys.enumA setting that specifies the case of generated strings.enumA setting that specifies the type ofStringto generate.Fields in org.instancio.settings with annotations of type ExperimentalApiModifier and TypeFieldDescriptionstatic final SettingKey<AssignmentType> Keys.ASSIGNMENT_TYPESpecifies whether to assign values using fields or methods; default isAssignmentType.FIELD; property nameassignment.type.static final SettingKey<Boolean> Specifies whether values should be generated based on Jakarta Bean Validation 3.0 annotations, if present; default isfalse; property namebean.validation.api.enabled.static final SettingKey<BeanValidationTarget> Specifies whether Bean Validation annotations are declared on fields or getters; default isBeanValidationTarget.FIELD; property namebean.validation.target.static final SettingKey<Integer> Keys.BIG_DECIMAL_SCALESpecifies thescalefor generatingBigDecimal; default is2; property namebigdecimal.scale.static final SettingKey<Boolean> Keys.FAIL_ON_ERRORSpecifies whether internal exceptions should be propagated up; default isfalse; property namefail.on.error.static final SettingKey<FeedDataAccess> Keys.FEED_DATA_ACCESSSpecifies whetherFeeddata is retrieved sequentially or randomly; default isFeedDataAccess.SEQUENTIAL; property namefeed.data.access.static final SettingKey<FeedDataEndAction> Keys.FEED_DATA_END_ACTIONSpecifies the behaviour whenFeedend of data has been reached (only applicable ifKeys.FEED_DATA_ACCESSis set toFeedDataAccess.SEQUENTIAL); default isFeedDataEndAction.FAIL; property namefeed.data.end.action.static final SettingKey<FeedDataTrim> Keys.FEED_DATA_TRIMSpecifies the trimming mode for feed data; default isFeedDataTrim.UNQUOTED; property namefeed.data.trim.static final SettingKey<FeedFormatType> Keys.FEED_FORMAT_TYPESpecifies the feed format type; default isFeedFormatType.CSV; property namefeed.format.type.static final SettingKey<String> Keys.FEED_TAG_KEYstatic final SettingKey<String> Keys.FEED_TAG_VALUESpecifies the default tag value for aFeed; default isnull(includes all tags); property namefeed.tag.value.static final SettingKey<Integer> Specifies the number of samples for the@InstancioSourceannotation from theinstancio-junitmodule; default is 100; property nameinstancio.source.samples.static final SettingKey<Boolean> Keys.JPA_ENABLEDSpecifies whether values should be generated based on JPA annotations, such as@Column.length; default isfalse; property namejpa.enabled.static final SettingKey<Integer> The maximum number of attempts to generate an object for a given node; default is1000; property namemax.generation.attempts.static final SettingKey<OnSetFieldError> Keys.ON_SET_FIELD_ERRORSpecifies what should happen if an error occurs setting a field's value; default isOnSetFieldError.IGNORE; property nameon.set.field.error.static final SettingKey<OnSetMethodError> Keys.ON_SET_METHOD_ERRORSpecifies what should happen if an error occurs invoking a setter; default isOnSetMethodError.ASSIGN_FIELD; property nameon.set.method.error.static final SettingKey<OnSetMethodNotFound> Specifies what should happen if a setter method for a field cannot be resolved; default isOnSetMethodNotFound.ASSIGN_FIELD; property nameon.set.method.not.found.static final SettingKey<OnSetMethodUnmatched> Specifies what should happen if a setter without a matching field is encountered; default isOnSetMethodUnmatched.IGNORE; property nameon.set.method.unmatched.static final SettingKey<Boolean> Keys.SET_BACK_REFERENCESSpecifies whether back references should be set for cyclic classes; default isfalse(cycles are terminated withnull); property nameset.back.references.static final SettingKey<Integer> Specifies modifier exclusions for setter-methods; default is0(no exclusions); property namesetter.exclude.modifier.static final SettingKey<SetterStyle> Keys.SETTER_STYLEIndicates the naming convention of setter methods to use; default isSetterStyle.SET; property namesetter.style.static final SettingKey<StringCase> Keys.STRING_CASESpecifies the case of generated strings; default isStringCase.UPPER; property namestring.case.static final SettingKey<StringType> Keys.STRING_TYPESpecifies the String type to generate; default isStringType.ALPHABETIC; property namestring.type.Methods in org.instancio.settings with annotations of type ExperimentalApiModifier and TypeMethodDescriptionstatic <T> SettingKey.SettingKeyBuilder<T> A builder for creating custom setting keys. -
Uses of ExperimentalApi in org.instancio.spi
Classes in org.instancio.spi with annotations of type ExperimentalApiModifier and TypeInterfaceDescriptionstatic interfaceAllows customising generated values based on annotations.static @interfaceDenotes a method for handling annotations.static interfaceResolves setter method based on a given node whenKeys.ASSIGNMENT_TYPEis set toAssignmentType.METHOD.interfaceProvides additional information toInstancioServiceProvider.Methods in org.instancio.spi with annotations of type ExperimentalApiModifier and TypeMethodDescriptionInstancioServiceProvider.getAnnotationProcessor()Returns anAnnotationProcessorimplementation.Returns the setter method for the givennode.InstancioServiceProvider.getSetterMethodResolver()Returns aSetterMethodResolverimplementation.default voidInstancioServiceProvider.init(ServiceProviderContext context) An optional method that can be used by implementations that require access to the context information.