public PagingSpec(Map<String, Integer> pagingIdentifiers, int threshold) { this(pagingIdentifiers, threshold, null, new SelectQueryConfig(true)); }
@JsonCreator public PagingSpec( @JsonProperty("pagingIdentifiers") Map<String, Integer> pagingIdentifiers, @JsonProperty("threshold") int threshold, @JsonProperty("fromNext") Boolean fromNext, @JacksonInject SelectQueryConfig config ) { this.pagingIdentifiers = pagingIdentifiers == null ? new HashMap<>() : pagingIdentifiers; this.threshold = threshold; boolean defaultFromNext = config.getEnableFromNextDefault(); this.fromNext = fromNext == null ? defaultFromNext : fromNext; }
public PagingSpec(Map<String, Integer> pagingIdentifiers, int threshold, Boolean fromNext) { this(pagingIdentifiers, threshold, fromNext, new SelectQueryConfig(true)); }
@Test public void testSerde() { final SelectQueryConfig config = MAPPER.convertValue(CONFIG_MAP, SelectQueryConfig.class); Assert.assertEquals(false, config.getEnableFromNextDefault()); final SelectQueryConfig config2 = MAPPER.convertValue(CONFIG_MAP2, SelectQueryConfig.class); Assert.assertEquals(true, config2.getEnableFromNextDefault()); final SelectQueryConfig configEmpty = MAPPER.convertValue(CONFIG_MAP_EMPTY, SelectQueryConfig.class); Assert.assertEquals(true, configEmpty.getEnableFromNextDefault()); } }
final Supplier<SelectQueryConfig> selectConfigSupplier = Suppliers.ofInstance(new SelectQueryConfig(true));
@JsonCreator public PagingSpec( @JsonProperty("pagingIdentifiers") Map<String, Integer> pagingIdentifiers, @JsonProperty("threshold") int threshold, @JsonProperty("fromNext") Boolean fromNext, @JacksonInject SelectQueryConfig config ) { this.pagingIdentifiers = pagingIdentifiers == null ? Maps.newHashMap() : pagingIdentifiers; this.threshold = threshold; boolean defaultFromNext = config.getEnableFromNextDefault(); this.fromNext = fromNext == null ? defaultFromNext : fromNext; }
new InjectableValues.Std().addValue( SelectQueryConfig.class, new SelectQueryConfig(true) Supplier<SelectQueryConfig> configSupplier = Suppliers.ofInstance(new SelectQueryConfig(true));
public PagingSpec(Map<String, Integer> pagingIdentifiers, int threshold, Boolean fromNext) { this(pagingIdentifiers, threshold, fromNext, new SelectQueryConfig(true)); }
public PagingSpec(Map<String, Integer> pagingIdentifiers, int threshold) { this(pagingIdentifiers, threshold, null, new SelectQueryConfig(true)); }