AmazonDynamoDBClient client = . . .; mapperConfig = new DynamoDBMapperConfig.Builder().withTableNameOverride(TableNameOverride.withTableNameReplacement(tableName)) .build(); mapper = new DynamoDBMapper(client, mapperConfig);
private final DynamoDBMapperConfig config = builder().withBatchWriteRetryStrategy(this).build(); public final DynamoDBMapperConfig config() { return this.config;
/** * @param value the new BatchLoadRetryStrategy * @return this builder */ public Builder withBatchLoadRetryStrategy( BatchLoadRetryStrategy value) { //set the no retry strategy if the user overrides the default with null if (value == null) { value = NoRetryBatchLoadRetryStrategy.INSTANCE; } setBatchLoadRetryStrategy(value); return this; }
/** * @param value the new BatchWriteRetryStrategy * @return this builder */ public Builder withBatchWriteRetryStrategy( BatchWriteRetryStrategy value) { setBatchWriteRetryStrategy(value); return this; }
/** * Merges these configuration values with the specified overrides; may * simply return this instance if overrides are the same or null. * @param overrides The overrides to merge. * @return This if the overrides are same or null, or a new merged config. */ final DynamoDBMapperConfig merge(final DynamoDBMapperConfig overrides) { return overrides == null || this == overrides ? this : builder().merge(this).merge(overrides).build(); }
/** * @param value the new pagination loading strategy * @return this builder */ public Builder withPaginationLoadingStrategy( PaginationLoadingStrategy value) { setPaginationLoadingStrategy(value); return this; }
/** * Sets the consistent read behavior. Currently * this value is applied only in load and batch load operations of the * DynamoDBMapper. * @param value the new consistent read behavior * @return this builder. * */ public Builder withConsistentReads(ConsistentReads value) { setConsistentReads(value); return this; }
@SuppressWarnings("deprecation") private DynamoDBMapperConfig createDynamoDBMapperConfig(DynamoDBMapperConfig dynamoDBMapperConfig, DynamoDBMapperConfig.Builder emptyBuilder) { // Deprecated but the only way how DynamoDBMapperConfig#merge is exposed return new DynamoDBMapperConfig(dynamoDBMapperConfig, emptyBuilder.build()); } }
/** * Creates a new empty builder. */ public static final Builder builder() { return new Builder(false); }
/** * @param value the new conversion schema * @return this builder */ public Builder withConversionSchema(ConversionSchema value) { setConversionSchema(value); return this; }
/** * @param value the new request metric collector * @return this builder */ public Builder withRequestMetricCollector(RequestMetricCollector value) { setRequestMetricCollector(value); return this; }
/** * @param value the new object table name resolver * @return this builder */ public Builder withObjectTableNameResolver(ObjectTableNameResolver value) { setObjectTableNameResolver(value); return this; }
private final DynamoDBMapperConfig config = builder().withBatchWriteRetryStrategy(this).build(); public final DynamoDBMapperConfig config() { return this.config;
private DynamoDBMapperConfig dynamoDbMapperConfig() { return new DynamoDBMapperConfig.Builder() .withSaveBehavior(DynamoDBMapperConfig.SaveBehavior.UPDATE) .withConsistentReads(DynamoDBMapperConfig.ConsistentReads.CONSISTENT) .build(); }
/** * @param value the new BatchLoadRetryStrategy * @return this builder */ public Builder withBatchLoadRetryStrategy( BatchLoadRetryStrategy value) { //set the no retry strategy if the user overrides the default with null if (value == null) { value = NoRetryBatchLoadRetryStrategy.INSTANCE; } setBatchLoadRetryStrategy(value); return this; }
/** * Merges these configuration values with the specified overrides; may * simply return this instance if overrides are the same or null. * @param overrides The overrides to merge. * @return This if the overrides are same or null, or a new merged config. */ final DynamoDBMapperConfig merge(final DynamoDBMapperConfig overrides) { return overrides == null || this == overrides ? this : builder().merge(this).merge(overrides).build(); }
/** * @param value the new BatchWriteRetryStrategy * @return this builder */ public Builder withBatchWriteRetryStrategy( BatchWriteRetryStrategy value) { setBatchWriteRetryStrategy(value); return this; }
/** * Creates a new empty builder. */ public static final Builder builder() { return new Builder(false); }
/** * @param value the new pagination loading strategy * @return this builder */ public Builder withPaginationLoadingStrategy( PaginationLoadingStrategy value) { setPaginationLoadingStrategy(value); return this; }
/** * @param value the new object table name resolver * @return this builder */ public Builder withObjectTableNameResolver(ObjectTableNameResolver value) { setObjectTableNameResolver(value); return this; }