/** * Creates an instance of {@link ObjectGenerator} based on provided configuration. * * @param <T> Type of object {@link ObjectGenerator} will generate. * @return An instance of {@link ObjectGenerator}. */ @SuppressWarnings({ "unchecked" }) public <T> ObjectGenerator<T> build() { buildModel(); return new ObjectGenerator<>((Value<T>) parseSimpleValue("", outputExpression)); }
/** * Creates an instance of {@link ObjectGenerator} based on provided configuration. * * @param <T> Type of object {@link ObjectGenerator} will generate. * @return An instance of {@link ObjectGenerator}. */ @SuppressWarnings({ "unchecked" }) public <T> ObjectGenerator<T> build() { buildModel(); return new ObjectGenerator<>((Value<T>) parseSimpleValue("", outputExpression)); }
/** * Creates an instance of {@link ObjectGenerator} based on provided configuration.. Resulting * {@link ObjectGenerator} will try to convert configured output to specified <code>objectType</code>. * * @param objectType Type of object to which conversion will be attempted. * @param <T> Type of object {@link ObjectGenerator} will generate. * @return Instance of {@link ObjectGenerator}. */ public <T> ObjectGenerator<T> build(Class<T> objectType) { buildModel(); return new ObjectGenerator<>(new TypeConverterValue<>(objectType, parseSimpleValue("", outputExpression))); }
/** * Creates an instance of {@link ObjectGenerator} based on provided configuration.. Resulting * {@link ObjectGenerator} will try to convert configured output to specified <code>objectType</code>. * * @param objectType Type of object to which conversion will be attempted. * @param <T> Type of object {@link ObjectGenerator} will generate. * @return Instance of {@link ObjectGenerator}. */ public <T> ObjectGenerator<T> build(Class<T> objectType) { buildModel(); return new ObjectGenerator<>(new TypeConverterValue<>(objectType, parseSimpleValue("", outputExpression))); }