Package org.instancio.internal.selectors
Class PrimitiveAndWrapperSelectorImpl
java.lang.Object
org.instancio.internal.selectors.PrimitiveAndWrapperSelectorImpl
- All Implemented Interfaces:
ConvertibleToScope,GroupableSelector,Flattener,Selector,TargetSelector
-
Constructor Summary
ConstructorsConstructorDescriptionPrimitiveAndWrapperSelectorImpl(Class<?> primitiveType, Class<?> wrapperType) PrimitiveAndWrapperSelectorImpl(SelectorImpl primitive, SelectorImpl wrapper) -
Method Summary
-
Constructor Details
-
PrimitiveAndWrapperSelectorImpl
-
PrimitiveAndWrapperSelectorImpl
-
-
Method Details
-
isScoped
public boolean isScoped() -
getPrimitive
-
getWrapper
-
flatten
Description copied from interface:FlattenerFlattens selectors into a list. -
within
Description copied from interface:SelectorSpecifies the scope for this selector in order to narrow down its target.For example, if the
Personclass has twoPhonefields:class Person { private Phone home; private Phone cell; // snip... }and we want to set only the
cellphone to a specific value, we can narrow down the selector as follows:// Scope can be created using: Scope cellPhone = scope(Person.class, "cell"); // or selector toScope() method Scope cellPhone = field(Person::getCell).toScope(); Person person = Instancio.of(Person.class) .set(field(Phone.class, "number").within(cellPhone), "123-45-67") .create();See Selector Scopes section of the user guide for details.
-
toScope
Description copied from interface:ConvertibleToScopeScope representation of a selector.- Specified by:
toScopein interfaceConvertibleToScope- Returns:
- scope
-
equals
-
hashCode
public int hashCode() -
toString
-