Package org.instancio.generator.util
Interface CollectionGeneratorSpec<T>
-
- Type Parameters:
T
- element type
- All Superinterfaces:
GeneratorSpec<Collection<T>>
- All Known Implementing Classes:
CollectionGenerator
,CollectionGeneratorSpecImpl
,HashSetGenerator
,TreeSetGenerator
public interface CollectionGeneratorSpec<T> extends GeneratorSpec<Collection<T>>
Generator spec for collections.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CollectionGeneratorSpec<T>
maxSize(int size)
Maximum size of collection to generate.CollectionGeneratorSpec<T>
minSize(int size)
Minimum size of collection to generate.CollectionGeneratorSpec<T>
nullable()
Indicates thatnull
value can be generated for the collection.CollectionGeneratorSpec<T>
nullableElements()
Indicates thatnull
values can be generated for collection elements.CollectionGeneratorSpec<T>
size(int size)
Size of collection to generate.CollectionGeneratorSpec<T>
type(Class<?> type)
Specifies the type of collection that should be generated.
-
-
-
Method Detail
-
size
CollectionGeneratorSpec<T> size(int size)
Size of collection to generate.- Parameters:
size
- of collection- Returns:
- spec builder
-
minSize
CollectionGeneratorSpec<T> minSize(int size)
Minimum size of collection to generate.- Parameters:
size
- minimum size (inclusive)- Returns:
- spec builder
-
maxSize
CollectionGeneratorSpec<T> maxSize(int size)
Maximum size of collection to generate.- Parameters:
size
- maximum size (inclusive)- Returns:
- spec builder
-
nullable
CollectionGeneratorSpec<T> nullable()
Indicates thatnull
value can be generated for the collection.- Returns:
- spec builder
-
nullableElements
CollectionGeneratorSpec<T> nullableElements()
Indicates thatnull
values can be generated for collection elements.- Returns:
- spec builder
-
type
CollectionGeneratorSpec<T> type(Class<?> type)
Specifies the type of collection that should be generated.- Parameters:
type
- of collection to generate- Returns:
- spec builder
-
-