target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void usGovWest1_AwsGovPartition_IsValidRegion() { assertTrue(RegionValidationUtil.validRegion("us-gov-west-1", AWS_GOV_PARTITION_REGEX)); }
public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); static boolean validRegion(String region, String regex); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); static boolean validRegion(String region, String regex); }
@Test public void usGovWest1Fips_AwsGovPartition_IsValidRegion() { assertTrue(RegionValidationUtil.validRegion("us-gov-west-1-fips", AWS_GOV_PARTITION_REGEX)); }
public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); static boolean validRegion(String region, String regex); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); static boolean validRegion(String region, String regex); }
@Test public void fipsUsGovWest1_AwsGovPartition_IsNotValidRegion() { assertTrue(RegionValidationUtil.validRegion("fips-us-gov-west-1", AWS_GOV_PARTITION_REGEX)); }
public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); static boolean validRegion(String region, String regex); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); static boolean validRegion(String region, String regex); }
@Test public void fips_AwsGovPartition_IsNotValidRegion() { assertFalse(RegionValidationUtil.validRegion("fips", AWS_GOV_PARTITION_REGEX)); }
public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); static boolean validRegion(String region, String regex); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); static boolean validRegion(String region, String regex); }
@Test public void nonCreateMultipartRequest_shouldNotModifyHttpRequest() { Context.ModifyHttpRequest modifyHttpRequest = InterceptorTestUtils.modifyHttpRequestContext(GetObjectAclRequest.builder().build()); SdkHttpRequest httpRequest = interceptor.modifyHttpRequest(modifyHttpRequest, new ExecutionAttributes()); assertThat(httpRequest).isEqualTo(modifyHttpRequest.httpRequest()); }
@Override public SdkHttpRequest modifyHttpRequest(Context.ModifyHttpRequest context, ExecutionAttributes executionAttributes) { if (context.request() instanceof CreateMultipartUploadRequest) { SdkHttpRequest.Builder builder = context.httpRequest() .toBuilder() .putHeader(CONTENT_LENGTH, String.valueOf(0)); if (!context.httpRequest().firstMatchingHeader(CONTENT_TYPE).isPresent()) { builder.putHeader(CONTENT_TYPE, "binary/octet-stream"); } return builder.build(); } return context.httpRequest(); }
CreateMultipartUploadRequestInterceptor implements ExecutionInterceptor { @Override public SdkHttpRequest modifyHttpRequest(Context.ModifyHttpRequest context, ExecutionAttributes executionAttributes) { if (context.request() instanceof CreateMultipartUploadRequest) { SdkHttpRequest.Builder builder = context.httpRequest() .toBuilder() .putHeader(CONTENT_LENGTH, String.valueOf(0)); if (!context.httpRequest().firstMatchingHeader(CONTENT_TYPE).isPresent()) { builder.putHeader(CONTENT_TYPE, "binary/octet-stream"); } return builder.build(); } return context.httpRequest(); } }
CreateMultipartUploadRequestInterceptor implements ExecutionInterceptor { @Override public SdkHttpRequest modifyHttpRequest(Context.ModifyHttpRequest context, ExecutionAttributes executionAttributes) { if (context.request() instanceof CreateMultipartUploadRequest) { SdkHttpRequest.Builder builder = context.httpRequest() .toBuilder() .putHeader(CONTENT_LENGTH, String.valueOf(0)); if (!context.httpRequest().firstMatchingHeader(CONTENT_TYPE).isPresent()) { builder.putHeader(CONTENT_TYPE, "binary/octet-stream"); } return builder.build(); } return context.httpRequest(); } }
CreateMultipartUploadRequestInterceptor implements ExecutionInterceptor { @Override public SdkHttpRequest modifyHttpRequest(Context.ModifyHttpRequest context, ExecutionAttributes executionAttributes) { if (context.request() instanceof CreateMultipartUploadRequest) { SdkHttpRequest.Builder builder = context.httpRequest() .toBuilder() .putHeader(CONTENT_LENGTH, String.valueOf(0)); if (!context.httpRequest().firstMatchingHeader(CONTENT_TYPE).isPresent()) { builder.putHeader(CONTENT_TYPE, "binary/octet-stream"); } return builder.build(); } return context.httpRequest(); } @Override Optional<RequestBody> modifyHttpContent(Context.ModifyHttpRequest context, ExecutionAttributes executionAttributes); @Override SdkHttpRequest modifyHttpRequest(Context.ModifyHttpRequest context, ExecutionAttributes executionAttributes); }
CreateMultipartUploadRequestInterceptor implements ExecutionInterceptor { @Override public SdkHttpRequest modifyHttpRequest(Context.ModifyHttpRequest context, ExecutionAttributes executionAttributes) { if (context.request() instanceof CreateMultipartUploadRequest) { SdkHttpRequest.Builder builder = context.httpRequest() .toBuilder() .putHeader(CONTENT_LENGTH, String.valueOf(0)); if (!context.httpRequest().firstMatchingHeader(CONTENT_TYPE).isPresent()) { builder.putHeader(CONTENT_TYPE, "binary/octet-stream"); } return builder.build(); } return context.httpRequest(); } @Override Optional<RequestBody> modifyHttpContent(Context.ModifyHttpRequest context, ExecutionAttributes executionAttributes); @Override SdkHttpRequest modifyHttpRequest(Context.ModifyHttpRequest context, ExecutionAttributes executionAttributes); }
@Test public void prodFips_AwsGovPartition_IsNotValidRegion() { assertFalse(RegionValidationUtil.validRegion("ProdFips", AWS_GOV_PARTITION_REGEX)); }
public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); static boolean validRegion(String region, String regex); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); static boolean validRegion(String region, String regex); }
@Test public void cnNorth1_AwsGovPartition_IsNotValidRegion() { assertFalse(RegionValidationUtil.validRegion("cn-north-1", AWS_GOV_PARTITION_REGEX)); }
public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); static boolean validRegion(String region, String regex); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); static boolean validRegion(String region, String regex); }
@Test public void awsGlobal_AwsPartition_IsValidRegion() { assertTrue(RegionValidationUtil.validRegion("aws-global", AWS_PARTITION_REGEX)); }
public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); static boolean validRegion(String region, String regex); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); static boolean validRegion(String region, String regex); }
@Test public void awsGovGlobal_AwsGovPartition_IsValidRegion() { assertTrue(RegionValidationUtil.validRegion("aws-us-gov-global", AWS_GOV_PARTITION_REGEX)); }
public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); static boolean validRegion(String region, String regex); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); static boolean validRegion(String region, String regex); }
@Test public void awsCnGlobal_AwsCnPartition_IsValidRegion() { assertTrue(RegionValidationUtil.validRegion("aws-cn-global", AWS_CN_PARTITION_REGEX)); }
public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); static boolean validRegion(String region, String regex); }
RegionValidationUtil { public static boolean validRegion(String region, String regex) { return matchesRegex(region, regex) || matchesRegexFipsSuffix(region, regex) || matchesRegexFipsPrefix(region, regex) || isGlobal(region); } private RegionValidationUtil(); static boolean validRegion(String region, String regex); }
@Test public void customTypesWork() { EnhancedType<EnhancedTypeTest> enhancedType = new EnhancedType<EnhancedTypeTest>(){}; assertThat(enhancedType.rawClass()).isEqualTo(EnhancedTypeTest.class); }
public Class<T> rawClass() { Validate.isTrue(!isWildcard, "A wildcard type is not expected here."); return rawClass; }
EnhancedType { public Class<T> rawClass() { Validate.isTrue(!isWildcard, "A wildcard type is not expected here."); return rawClass; } }
EnhancedType { public Class<T> rawClass() { Validate.isTrue(!isWildcard, "A wildcard type is not expected here."); return rawClass; } protected EnhancedType(); private EnhancedType(Type type); private EnhancedType(Class<?> rawClass, List<EnhancedType<?>> rawClassParameters, TableSchema<T> tableSchema); }
EnhancedType { public Class<T> rawClass() { Validate.isTrue(!isWildcard, "A wildcard type is not expected here."); return rawClass; } protected EnhancedType(); private EnhancedType(Type type); private EnhancedType(Class<?> rawClass, List<EnhancedType<?>> rawClassParameters, TableSchema<T> tableSchema); static EnhancedType<T> of(Class<T> type); static EnhancedType<?> of(Type type); static EnhancedType<Optional<T>> optionalOf(Class<T> valueType); static EnhancedType<List<T>> listOf(Class<T> valueType); static EnhancedType<List<T>> listOf(EnhancedType<T> valueType); static EnhancedType<Set<T>> setOf(Class<T> valueType); static EnhancedType<Set<T>> setOf(EnhancedType<T> valueType); static EnhancedType<SortedSet<T>> sortedSetOf(Class<T> valueType); static EnhancedType<SortedSet<T>> sortedSetOf(EnhancedType<T> valueType); static EnhancedType<Deque<T>> dequeOf(Class<T> valueType); static EnhancedType<Deque<T>> dequeOf(EnhancedType<T> valueType); static EnhancedType<NavigableSet<T>> navigableSetOf(Class<T> valueType); static EnhancedType<NavigableSet<T>> navigableSetOf(EnhancedType<T> valueType); static EnhancedType<Collection<T>> collectionOf(Class<T> valueType); static EnhancedType<Collection<T>> collectionOf(EnhancedType<T> valueType); static EnhancedType<Map<T, U>> mapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<Map<T, U>> mapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<SortedMap<T, U>> sortedMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<SortedMap<T, U>> sortedMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<ConcurrentMap<T, U>> concurrentMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<ConcurrentMap<T, U>> concurrentMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<NavigableMap<T, U>> navigableMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<NavigableMap<T, U>> navigableMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<T> documentOf(Class<T> documentClass, TableSchema<T> documentTableSchema); boolean isWildcard(); Class<T> rawClass(); Optional<TableSchema<T>> tableSchema(); List<EnhancedType<?>> rawClassParameters(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
EnhancedType { public Class<T> rawClass() { Validate.isTrue(!isWildcard, "A wildcard type is not expected here."); return rawClass; } protected EnhancedType(); private EnhancedType(Type type); private EnhancedType(Class<?> rawClass, List<EnhancedType<?>> rawClassParameters, TableSchema<T> tableSchema); static EnhancedType<T> of(Class<T> type); static EnhancedType<?> of(Type type); static EnhancedType<Optional<T>> optionalOf(Class<T> valueType); static EnhancedType<List<T>> listOf(Class<T> valueType); static EnhancedType<List<T>> listOf(EnhancedType<T> valueType); static EnhancedType<Set<T>> setOf(Class<T> valueType); static EnhancedType<Set<T>> setOf(EnhancedType<T> valueType); static EnhancedType<SortedSet<T>> sortedSetOf(Class<T> valueType); static EnhancedType<SortedSet<T>> sortedSetOf(EnhancedType<T> valueType); static EnhancedType<Deque<T>> dequeOf(Class<T> valueType); static EnhancedType<Deque<T>> dequeOf(EnhancedType<T> valueType); static EnhancedType<NavigableSet<T>> navigableSetOf(Class<T> valueType); static EnhancedType<NavigableSet<T>> navigableSetOf(EnhancedType<T> valueType); static EnhancedType<Collection<T>> collectionOf(Class<T> valueType); static EnhancedType<Collection<T>> collectionOf(EnhancedType<T> valueType); static EnhancedType<Map<T, U>> mapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<Map<T, U>> mapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<SortedMap<T, U>> sortedMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<SortedMap<T, U>> sortedMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<ConcurrentMap<T, U>> concurrentMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<ConcurrentMap<T, U>> concurrentMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<NavigableMap<T, U>> navigableMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<NavigableMap<T, U>> navigableMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<T> documentOf(Class<T> documentClass, TableSchema<T> documentTableSchema); boolean isWildcard(); Class<T> rawClass(); Optional<TableSchema<T>> tableSchema(); List<EnhancedType<?>> rawClassParameters(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
@Test public void nonStaticInnerTypesWork() { EnhancedType<InnerType> enhancedType = new EnhancedType<InnerType>(){}; assertThat(enhancedType.rawClass()).isEqualTo(InnerType.class); }
public Class<T> rawClass() { Validate.isTrue(!isWildcard, "A wildcard type is not expected here."); return rawClass; }
EnhancedType { public Class<T> rawClass() { Validate.isTrue(!isWildcard, "A wildcard type is not expected here."); return rawClass; } }
EnhancedType { public Class<T> rawClass() { Validate.isTrue(!isWildcard, "A wildcard type is not expected here."); return rawClass; } protected EnhancedType(); private EnhancedType(Type type); private EnhancedType(Class<?> rawClass, List<EnhancedType<?>> rawClassParameters, TableSchema<T> tableSchema); }
EnhancedType { public Class<T> rawClass() { Validate.isTrue(!isWildcard, "A wildcard type is not expected here."); return rawClass; } protected EnhancedType(); private EnhancedType(Type type); private EnhancedType(Class<?> rawClass, List<EnhancedType<?>> rawClassParameters, TableSchema<T> tableSchema); static EnhancedType<T> of(Class<T> type); static EnhancedType<?> of(Type type); static EnhancedType<Optional<T>> optionalOf(Class<T> valueType); static EnhancedType<List<T>> listOf(Class<T> valueType); static EnhancedType<List<T>> listOf(EnhancedType<T> valueType); static EnhancedType<Set<T>> setOf(Class<T> valueType); static EnhancedType<Set<T>> setOf(EnhancedType<T> valueType); static EnhancedType<SortedSet<T>> sortedSetOf(Class<T> valueType); static EnhancedType<SortedSet<T>> sortedSetOf(EnhancedType<T> valueType); static EnhancedType<Deque<T>> dequeOf(Class<T> valueType); static EnhancedType<Deque<T>> dequeOf(EnhancedType<T> valueType); static EnhancedType<NavigableSet<T>> navigableSetOf(Class<T> valueType); static EnhancedType<NavigableSet<T>> navigableSetOf(EnhancedType<T> valueType); static EnhancedType<Collection<T>> collectionOf(Class<T> valueType); static EnhancedType<Collection<T>> collectionOf(EnhancedType<T> valueType); static EnhancedType<Map<T, U>> mapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<Map<T, U>> mapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<SortedMap<T, U>> sortedMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<SortedMap<T, U>> sortedMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<ConcurrentMap<T, U>> concurrentMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<ConcurrentMap<T, U>> concurrentMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<NavigableMap<T, U>> navigableMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<NavigableMap<T, U>> navigableMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<T> documentOf(Class<T> documentClass, TableSchema<T> documentTableSchema); boolean isWildcard(); Class<T> rawClass(); Optional<TableSchema<T>> tableSchema(); List<EnhancedType<?>> rawClassParameters(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
EnhancedType { public Class<T> rawClass() { Validate.isTrue(!isWildcard, "A wildcard type is not expected here."); return rawClass; } protected EnhancedType(); private EnhancedType(Type type); private EnhancedType(Class<?> rawClass, List<EnhancedType<?>> rawClassParameters, TableSchema<T> tableSchema); static EnhancedType<T> of(Class<T> type); static EnhancedType<?> of(Type type); static EnhancedType<Optional<T>> optionalOf(Class<T> valueType); static EnhancedType<List<T>> listOf(Class<T> valueType); static EnhancedType<List<T>> listOf(EnhancedType<T> valueType); static EnhancedType<Set<T>> setOf(Class<T> valueType); static EnhancedType<Set<T>> setOf(EnhancedType<T> valueType); static EnhancedType<SortedSet<T>> sortedSetOf(Class<T> valueType); static EnhancedType<SortedSet<T>> sortedSetOf(EnhancedType<T> valueType); static EnhancedType<Deque<T>> dequeOf(Class<T> valueType); static EnhancedType<Deque<T>> dequeOf(EnhancedType<T> valueType); static EnhancedType<NavigableSet<T>> navigableSetOf(Class<T> valueType); static EnhancedType<NavigableSet<T>> navigableSetOf(EnhancedType<T> valueType); static EnhancedType<Collection<T>> collectionOf(Class<T> valueType); static EnhancedType<Collection<T>> collectionOf(EnhancedType<T> valueType); static EnhancedType<Map<T, U>> mapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<Map<T, U>> mapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<SortedMap<T, U>> sortedMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<SortedMap<T, U>> sortedMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<ConcurrentMap<T, U>> concurrentMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<ConcurrentMap<T, U>> concurrentMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<NavigableMap<T, U>> navigableMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<NavigableMap<T, U>> navigableMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<T> documentOf(Class<T> documentClass, TableSchema<T> documentTableSchema); boolean isWildcard(); Class<T> rawClass(); Optional<TableSchema<T>> tableSchema(); List<EnhancedType<?>> rawClassParameters(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
@Test public void staticInnerTypesWork() { EnhancedType<InnerStaticType> enhancedType = new EnhancedType<InnerStaticType>(){}; assertThat(enhancedType.rawClass()).isEqualTo(InnerStaticType.class); }
public Class<T> rawClass() { Validate.isTrue(!isWildcard, "A wildcard type is not expected here."); return rawClass; }
EnhancedType { public Class<T> rawClass() { Validate.isTrue(!isWildcard, "A wildcard type is not expected here."); return rawClass; } }
EnhancedType { public Class<T> rawClass() { Validate.isTrue(!isWildcard, "A wildcard type is not expected here."); return rawClass; } protected EnhancedType(); private EnhancedType(Type type); private EnhancedType(Class<?> rawClass, List<EnhancedType<?>> rawClassParameters, TableSchema<T> tableSchema); }
EnhancedType { public Class<T> rawClass() { Validate.isTrue(!isWildcard, "A wildcard type is not expected here."); return rawClass; } protected EnhancedType(); private EnhancedType(Type type); private EnhancedType(Class<?> rawClass, List<EnhancedType<?>> rawClassParameters, TableSchema<T> tableSchema); static EnhancedType<T> of(Class<T> type); static EnhancedType<?> of(Type type); static EnhancedType<Optional<T>> optionalOf(Class<T> valueType); static EnhancedType<List<T>> listOf(Class<T> valueType); static EnhancedType<List<T>> listOf(EnhancedType<T> valueType); static EnhancedType<Set<T>> setOf(Class<T> valueType); static EnhancedType<Set<T>> setOf(EnhancedType<T> valueType); static EnhancedType<SortedSet<T>> sortedSetOf(Class<T> valueType); static EnhancedType<SortedSet<T>> sortedSetOf(EnhancedType<T> valueType); static EnhancedType<Deque<T>> dequeOf(Class<T> valueType); static EnhancedType<Deque<T>> dequeOf(EnhancedType<T> valueType); static EnhancedType<NavigableSet<T>> navigableSetOf(Class<T> valueType); static EnhancedType<NavigableSet<T>> navigableSetOf(EnhancedType<T> valueType); static EnhancedType<Collection<T>> collectionOf(Class<T> valueType); static EnhancedType<Collection<T>> collectionOf(EnhancedType<T> valueType); static EnhancedType<Map<T, U>> mapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<Map<T, U>> mapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<SortedMap<T, U>> sortedMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<SortedMap<T, U>> sortedMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<ConcurrentMap<T, U>> concurrentMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<ConcurrentMap<T, U>> concurrentMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<NavigableMap<T, U>> navigableMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<NavigableMap<T, U>> navigableMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<T> documentOf(Class<T> documentClass, TableSchema<T> documentTableSchema); boolean isWildcard(); Class<T> rawClass(); Optional<TableSchema<T>> tableSchema(); List<EnhancedType<?>> rawClassParameters(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
EnhancedType { public Class<T> rawClass() { Validate.isTrue(!isWildcard, "A wildcard type is not expected here."); return rawClass; } protected EnhancedType(); private EnhancedType(Type type); private EnhancedType(Class<?> rawClass, List<EnhancedType<?>> rawClassParameters, TableSchema<T> tableSchema); static EnhancedType<T> of(Class<T> type); static EnhancedType<?> of(Type type); static EnhancedType<Optional<T>> optionalOf(Class<T> valueType); static EnhancedType<List<T>> listOf(Class<T> valueType); static EnhancedType<List<T>> listOf(EnhancedType<T> valueType); static EnhancedType<Set<T>> setOf(Class<T> valueType); static EnhancedType<Set<T>> setOf(EnhancedType<T> valueType); static EnhancedType<SortedSet<T>> sortedSetOf(Class<T> valueType); static EnhancedType<SortedSet<T>> sortedSetOf(EnhancedType<T> valueType); static EnhancedType<Deque<T>> dequeOf(Class<T> valueType); static EnhancedType<Deque<T>> dequeOf(EnhancedType<T> valueType); static EnhancedType<NavigableSet<T>> navigableSetOf(Class<T> valueType); static EnhancedType<NavigableSet<T>> navigableSetOf(EnhancedType<T> valueType); static EnhancedType<Collection<T>> collectionOf(Class<T> valueType); static EnhancedType<Collection<T>> collectionOf(EnhancedType<T> valueType); static EnhancedType<Map<T, U>> mapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<Map<T, U>> mapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<SortedMap<T, U>> sortedMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<SortedMap<T, U>> sortedMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<ConcurrentMap<T, U>> concurrentMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<ConcurrentMap<T, U>> concurrentMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<NavigableMap<T, U>> navigableMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<NavigableMap<T, U>> navigableMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<T> documentOf(Class<T> documentClass, TableSchema<T> documentTableSchema); boolean isWildcard(); Class<T> rawClass(); Optional<TableSchema<T>> tableSchema(); List<EnhancedType<?>> rawClassParameters(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
@Test public void equalityIsBasedOnInnerEquality() { assertThat(EnhancedType.of(String.class)).isEqualTo(EnhancedType.of(String.class)); assertThat(EnhancedType.of(String.class)).isNotEqualTo(EnhancedType.of(Integer.class)); assertThat(new EnhancedType<Map<String, List<String>>>(){}).isEqualTo(new EnhancedType<Map<String, List<String>>>(){}); assertThat(new EnhancedType<Map<String, List<String>>>(){}).isNotEqualTo(new EnhancedType<Map<String, List<Integer>>>(){}); }
public static <T> EnhancedType<T> of(Class<T> type) { return new EnhancedType<>(type); }
EnhancedType { public static <T> EnhancedType<T> of(Class<T> type) { return new EnhancedType<>(type); } }
EnhancedType { public static <T> EnhancedType<T> of(Class<T> type) { return new EnhancedType<>(type); } protected EnhancedType(); private EnhancedType(Type type); private EnhancedType(Class<?> rawClass, List<EnhancedType<?>> rawClassParameters, TableSchema<T> tableSchema); }
EnhancedType { public static <T> EnhancedType<T> of(Class<T> type) { return new EnhancedType<>(type); } protected EnhancedType(); private EnhancedType(Type type); private EnhancedType(Class<?> rawClass, List<EnhancedType<?>> rawClassParameters, TableSchema<T> tableSchema); static EnhancedType<T> of(Class<T> type); static EnhancedType<?> of(Type type); static EnhancedType<Optional<T>> optionalOf(Class<T> valueType); static EnhancedType<List<T>> listOf(Class<T> valueType); static EnhancedType<List<T>> listOf(EnhancedType<T> valueType); static EnhancedType<Set<T>> setOf(Class<T> valueType); static EnhancedType<Set<T>> setOf(EnhancedType<T> valueType); static EnhancedType<SortedSet<T>> sortedSetOf(Class<T> valueType); static EnhancedType<SortedSet<T>> sortedSetOf(EnhancedType<T> valueType); static EnhancedType<Deque<T>> dequeOf(Class<T> valueType); static EnhancedType<Deque<T>> dequeOf(EnhancedType<T> valueType); static EnhancedType<NavigableSet<T>> navigableSetOf(Class<T> valueType); static EnhancedType<NavigableSet<T>> navigableSetOf(EnhancedType<T> valueType); static EnhancedType<Collection<T>> collectionOf(Class<T> valueType); static EnhancedType<Collection<T>> collectionOf(EnhancedType<T> valueType); static EnhancedType<Map<T, U>> mapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<Map<T, U>> mapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<SortedMap<T, U>> sortedMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<SortedMap<T, U>> sortedMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<ConcurrentMap<T, U>> concurrentMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<ConcurrentMap<T, U>> concurrentMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<NavigableMap<T, U>> navigableMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<NavigableMap<T, U>> navigableMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<T> documentOf(Class<T> documentClass, TableSchema<T> documentTableSchema); boolean isWildcard(); Class<T> rawClass(); Optional<TableSchema<T>> tableSchema(); List<EnhancedType<?>> rawClassParameters(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
EnhancedType { public static <T> EnhancedType<T> of(Class<T> type) { return new EnhancedType<>(type); } protected EnhancedType(); private EnhancedType(Type type); private EnhancedType(Class<?> rawClass, List<EnhancedType<?>> rawClassParameters, TableSchema<T> tableSchema); static EnhancedType<T> of(Class<T> type); static EnhancedType<?> of(Type type); static EnhancedType<Optional<T>> optionalOf(Class<T> valueType); static EnhancedType<List<T>> listOf(Class<T> valueType); static EnhancedType<List<T>> listOf(EnhancedType<T> valueType); static EnhancedType<Set<T>> setOf(Class<T> valueType); static EnhancedType<Set<T>> setOf(EnhancedType<T> valueType); static EnhancedType<SortedSet<T>> sortedSetOf(Class<T> valueType); static EnhancedType<SortedSet<T>> sortedSetOf(EnhancedType<T> valueType); static EnhancedType<Deque<T>> dequeOf(Class<T> valueType); static EnhancedType<Deque<T>> dequeOf(EnhancedType<T> valueType); static EnhancedType<NavigableSet<T>> navigableSetOf(Class<T> valueType); static EnhancedType<NavigableSet<T>> navigableSetOf(EnhancedType<T> valueType); static EnhancedType<Collection<T>> collectionOf(Class<T> valueType); static EnhancedType<Collection<T>> collectionOf(EnhancedType<T> valueType); static EnhancedType<Map<T, U>> mapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<Map<T, U>> mapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<SortedMap<T, U>> sortedMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<SortedMap<T, U>> sortedMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<ConcurrentMap<T, U>> concurrentMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<ConcurrentMap<T, U>> concurrentMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<NavigableMap<T, U>> navigableMapOf(Class<T> keyType, Class<U> valueType); static EnhancedType<NavigableMap<T, U>> navigableMapOf(EnhancedType<T> keyType, EnhancedType<U> valueType); static EnhancedType<T> documentOf(Class<T> documentClass, TableSchema<T> documentTableSchema); boolean isWildcard(); Class<T> rawClass(); Optional<TableSchema<T>> tableSchema(); List<EnhancedType<?>> rawClassParameters(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
@Test public void toBuilder() { Key key = Key.builder().partitionValue("key").build(); GetItemEnhancedRequest builtObject = GetItemEnhancedRequest.builder() .key(key) .build(); GetItemEnhancedRequest copiedObject = builtObject.toBuilder().build(); assertThat(copiedObject, is(builtObject)); }
public Builder toBuilder() { return builder().key(key).consistentRead(consistentRead); }
GetItemEnhancedRequest { public Builder toBuilder() { return builder().key(key).consistentRead(consistentRead); } }
GetItemEnhancedRequest { public Builder toBuilder() { return builder().key(key).consistentRead(consistentRead); } private GetItemEnhancedRequest(Builder builder); }
GetItemEnhancedRequest { public Builder toBuilder() { return builder().key(key).consistentRead(consistentRead); } private GetItemEnhancedRequest(Builder builder); static Builder builder(); Builder toBuilder(); Boolean consistentRead(); Key key(); @Override boolean equals(Object o); @Override int hashCode(); }
GetItemEnhancedRequest { public Builder toBuilder() { return builder().key(key).consistentRead(consistentRead); } private GetItemEnhancedRequest(Builder builder); static Builder builder(); Builder toBuilder(); Boolean consistentRead(); Key key(); @Override boolean equals(Object o); @Override int hashCode(); }
@Test public void modifyRequest_EnablesChunckedEncoding_ForPutObectRequest() { ExecutionAttributes executionAttributes = new ExecutionAttributes(); assertThat(executionAttributes.getAttribute(ENABLE_CHUNKED_ENCODING)).isNull(); interceptor.modifyRequest(context(PutObjectRequest.builder().build()), executionAttributes); assertThat(executionAttributes.getAttribute(ENABLE_CHUNKED_ENCODING)).isEqualTo(true); }
@Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } @Override SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes); }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } @Override SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes); }
@Test public void toBuilder() { BatchWriteItemEnhancedRequest builtObject = BatchWriteItemEnhancedRequest.builder().build(); BatchWriteItemEnhancedRequest copiedObject = builtObject.toBuilder().build(); assertThat(copiedObject, is(builtObject)); }
public Builder toBuilder() { return new Builder().writeBatches(writeBatches); }
BatchWriteItemEnhancedRequest { public Builder toBuilder() { return new Builder().writeBatches(writeBatches); } }
BatchWriteItemEnhancedRequest { public Builder toBuilder() { return new Builder().writeBatches(writeBatches); } private BatchWriteItemEnhancedRequest(Builder builder); }
BatchWriteItemEnhancedRequest { public Builder toBuilder() { return new Builder().writeBatches(writeBatches); } private BatchWriteItemEnhancedRequest(Builder builder); static Builder builder(); Builder toBuilder(); Collection<WriteBatch> writeBatches(); @Override boolean equals(Object o); @Override int hashCode(); }
BatchWriteItemEnhancedRequest { public Builder toBuilder() { return new Builder().writeBatches(writeBatches); } private BatchWriteItemEnhancedRequest(Builder builder); static Builder builder(); Builder toBuilder(); Collection<WriteBatch> writeBatches(); @Override boolean equals(Object o); @Override int hashCode(); }
@Test public void toBuilder() { PutItemEnhancedRequest<FakeItem> builtObject = PutItemEnhancedRequest.builder(FakeItem.class).build(); PutItemEnhancedRequest copiedObject = builtObject.toBuilder().build(); assertThat(copiedObject, is(builtObject)); }
public Builder<T> toBuilder() { return new Builder<T>().item(item).conditionExpression(conditionExpression); }
PutItemEnhancedRequest { public Builder<T> toBuilder() { return new Builder<T>().item(item).conditionExpression(conditionExpression); } }
PutItemEnhancedRequest { public Builder<T> toBuilder() { return new Builder<T>().item(item).conditionExpression(conditionExpression); } private PutItemEnhancedRequest(Builder<T> builder); }
PutItemEnhancedRequest { public Builder<T> toBuilder() { return new Builder<T>().item(item).conditionExpression(conditionExpression); } private PutItemEnhancedRequest(Builder<T> builder); static Builder<T> builder(Class<? extends T> itemClass); Builder<T> toBuilder(); T item(); Expression conditionExpression(); @Override boolean equals(Object o); @Override int hashCode(); }
PutItemEnhancedRequest { public Builder<T> toBuilder() { return new Builder<T>().item(item).conditionExpression(conditionExpression); } private PutItemEnhancedRequest(Builder<T> builder); static Builder<T> builder(Class<? extends T> itemClass); Builder<T> toBuilder(); T item(); Expression conditionExpression(); @Override boolean equals(Object o); @Override int hashCode(); }
@Test public void test_nestedAttributesNullNestedAttributeElement() { List<NestedAttributeName> attributeNames = new ArrayList<>(); attributeNames.add(NestedAttributeName.create("foo")); attributeNames.add(null); assertFails(() -> ScanEnhancedRequest.builder() .addNestedAttributesToProject(attributeNames) .build()); assertFails(() -> ScanEnhancedRequest.builder() .addNestedAttributesToProject(NestedAttributeName.create("foo", "bar"), null) .build()); NestedAttributeName nestedAttributeName = null; ScanEnhancedRequest.builder() .addNestedAttributeToProject(nestedAttributeName) .build(); assertFails(() -> ScanEnhancedRequest.builder() .addNestedAttributesToProject(nestedAttributeName) .build()); }
public static Builder builder() { return new Builder(); }
ScanEnhancedRequest { public static Builder builder() { return new Builder(); } }
ScanEnhancedRequest { public static Builder builder() { return new Builder(); } private ScanEnhancedRequest(Builder builder); }
ScanEnhancedRequest { public static Builder builder() { return new Builder(); } private ScanEnhancedRequest(Builder builder); static Builder builder(); Builder toBuilder(); Map<String, AttributeValue> exclusiveStartKey(); Integer limit(); Boolean consistentRead(); Expression filterExpression(); List<String> attributesToProject(); List<NestedAttributeName> nestedAttributesToProject(); @Override boolean equals(Object o); @Override int hashCode(); }
ScanEnhancedRequest { public static Builder builder() { return new Builder(); } private ScanEnhancedRequest(Builder builder); static Builder builder(); Builder toBuilder(); Map<String, AttributeValue> exclusiveStartKey(); Integer limit(); Boolean consistentRead(); Expression filterExpression(); List<String> attributesToProject(); List<NestedAttributeName> nestedAttributesToProject(); @Override boolean equals(Object o); @Override int hashCode(); }
@Test public void toBuilder() { ScanEnhancedRequest builtObject = ScanEnhancedRequest.builder().exclusiveStartKey(null).build(); ScanEnhancedRequest copiedObject = builtObject.toBuilder().build(); assertThat(copiedObject, is(builtObject)); }
public Builder toBuilder() { return builder().exclusiveStartKey(exclusiveStartKey) .limit(limit) .consistentRead(consistentRead) .filterExpression(filterExpression) .addNestedAttributesToProject(attributesToProject); }
ScanEnhancedRequest { public Builder toBuilder() { return builder().exclusiveStartKey(exclusiveStartKey) .limit(limit) .consistentRead(consistentRead) .filterExpression(filterExpression) .addNestedAttributesToProject(attributesToProject); } }
ScanEnhancedRequest { public Builder toBuilder() { return builder().exclusiveStartKey(exclusiveStartKey) .limit(limit) .consistentRead(consistentRead) .filterExpression(filterExpression) .addNestedAttributesToProject(attributesToProject); } private ScanEnhancedRequest(Builder builder); }
ScanEnhancedRequest { public Builder toBuilder() { return builder().exclusiveStartKey(exclusiveStartKey) .limit(limit) .consistentRead(consistentRead) .filterExpression(filterExpression) .addNestedAttributesToProject(attributesToProject); } private ScanEnhancedRequest(Builder builder); static Builder builder(); Builder toBuilder(); Map<String, AttributeValue> exclusiveStartKey(); Integer limit(); Boolean consistentRead(); Expression filterExpression(); List<String> attributesToProject(); List<NestedAttributeName> nestedAttributesToProject(); @Override boolean equals(Object o); @Override int hashCode(); }
ScanEnhancedRequest { public Builder toBuilder() { return builder().exclusiveStartKey(exclusiveStartKey) .limit(limit) .consistentRead(consistentRead) .filterExpression(filterExpression) .addNestedAttributesToProject(attributesToProject); } private ScanEnhancedRequest(Builder builder); static Builder builder(); Builder toBuilder(); Map<String, AttributeValue> exclusiveStartKey(); Integer limit(); Boolean consistentRead(); Expression filterExpression(); List<String> attributesToProject(); List<NestedAttributeName> nestedAttributesToProject(); @Override boolean equals(Object o); @Override int hashCode(); }
@Test public void toBuilder() { CreateTableEnhancedRequest builtObject = CreateTableEnhancedRequest.builder() .provisionedThroughput(getDefaultProvisionedThroughput()) .build(); CreateTableEnhancedRequest copiedObject = builtObject.toBuilder().build(); assertThat(copiedObject, is(builtObject)); }
public Builder toBuilder() { return builder().provisionedThroughput(provisionedThroughput) .localSecondaryIndices(localSecondaryIndices) .globalSecondaryIndices(globalSecondaryIndices); }
CreateTableEnhancedRequest { public Builder toBuilder() { return builder().provisionedThroughput(provisionedThroughput) .localSecondaryIndices(localSecondaryIndices) .globalSecondaryIndices(globalSecondaryIndices); } }
CreateTableEnhancedRequest { public Builder toBuilder() { return builder().provisionedThroughput(provisionedThroughput) .localSecondaryIndices(localSecondaryIndices) .globalSecondaryIndices(globalSecondaryIndices); } private CreateTableEnhancedRequest(Builder builder); }
CreateTableEnhancedRequest { public Builder toBuilder() { return builder().provisionedThroughput(provisionedThroughput) .localSecondaryIndices(localSecondaryIndices) .globalSecondaryIndices(globalSecondaryIndices); } private CreateTableEnhancedRequest(Builder builder); static Builder builder(); Builder toBuilder(); ProvisionedThroughput provisionedThroughput(); Collection<EnhancedLocalSecondaryIndex> localSecondaryIndices(); Collection<EnhancedGlobalSecondaryIndex> globalSecondaryIndices(); @Override boolean equals(Object o); @Override int hashCode(); }
CreateTableEnhancedRequest { public Builder toBuilder() { return builder().provisionedThroughput(provisionedThroughput) .localSecondaryIndices(localSecondaryIndices) .globalSecondaryIndices(globalSecondaryIndices); } private CreateTableEnhancedRequest(Builder builder); static Builder builder(); Builder toBuilder(); ProvisionedThroughput provisionedThroughput(); Collection<EnhancedLocalSecondaryIndex> localSecondaryIndices(); Collection<EnhancedGlobalSecondaryIndex> globalSecondaryIndices(); @Override boolean equals(Object o); @Override int hashCode(); }
@Test public void toBuilder() { Key key = Key.builder().partitionValue("key").build(); DeleteItemEnhancedRequest builtObject = DeleteItemEnhancedRequest.builder().key(key).build(); DeleteItemEnhancedRequest copiedObject = builtObject.toBuilder().build(); assertThat(copiedObject, is(builtObject)); }
public Builder toBuilder() { return builder().key(key).conditionExpression(conditionExpression); }
DeleteItemEnhancedRequest { public Builder toBuilder() { return builder().key(key).conditionExpression(conditionExpression); } }
DeleteItemEnhancedRequest { public Builder toBuilder() { return builder().key(key).conditionExpression(conditionExpression); } private DeleteItemEnhancedRequest(Builder builder); }
DeleteItemEnhancedRequest { public Builder toBuilder() { return builder().key(key).conditionExpression(conditionExpression); } private DeleteItemEnhancedRequest(Builder builder); static Builder builder(); Builder toBuilder(); Key key(); Expression conditionExpression(); @Override boolean equals(Object o); @Override int hashCode(); }
DeleteItemEnhancedRequest { public Builder toBuilder() { return builder().key(key).conditionExpression(conditionExpression); } private DeleteItemEnhancedRequest(Builder builder); static Builder builder(); Builder toBuilder(); Key key(); Expression conditionExpression(); @Override boolean equals(Object o); @Override int hashCode(); }
@Test public void test_nestedAttributesNullNestedAttributeElement() { List<NestedAttributeName> attributeNames = new ArrayList<>(); attributeNames.add(NestedAttributeName.create("foo")); attributeNames.add(null); assertFails(() -> QueryEnhancedRequest.builder() .addNestedAttributesToProject(attributeNames) .build()); assertFails(() -> QueryEnhancedRequest.builder() .addNestedAttributesToProject(NestedAttributeName.create("foo", "bar"), null) .build()); NestedAttributeName nestedAttributeName = null; QueryEnhancedRequest.builder() .addNestedAttributeToProject(nestedAttributeName) .build(); assertFails(() -> QueryEnhancedRequest.builder() .addNestedAttributesToProject(nestedAttributeName) .build()); }
public static Builder builder() { return new Builder(); }
QueryEnhancedRequest { public static Builder builder() { return new Builder(); } }
QueryEnhancedRequest { public static Builder builder() { return new Builder(); } private QueryEnhancedRequest(Builder builder); }
QueryEnhancedRequest { public static Builder builder() { return new Builder(); } private QueryEnhancedRequest(Builder builder); static Builder builder(); Builder toBuilder(); QueryConditional queryConditional(); Map<String, AttributeValue> exclusiveStartKey(); Boolean scanIndexForward(); Integer limit(); Boolean consistentRead(); Expression filterExpression(); List<String> attributesToProject(); List<NestedAttributeName> nestedAttributesToProject(); @Override boolean equals(Object o); @Override int hashCode(); }
QueryEnhancedRequest { public static Builder builder() { return new Builder(); } private QueryEnhancedRequest(Builder builder); static Builder builder(); Builder toBuilder(); QueryConditional queryConditional(); Map<String, AttributeValue> exclusiveStartKey(); Boolean scanIndexForward(); Integer limit(); Boolean consistentRead(); Expression filterExpression(); List<String> attributesToProject(); List<NestedAttributeName> nestedAttributesToProject(); @Override boolean equals(Object o); @Override int hashCode(); }
@Test public void toBuilder() { QueryEnhancedRequest builtObject = QueryEnhancedRequest.builder().build(); QueryEnhancedRequest copiedObject = builtObject.toBuilder().build(); assertThat(copiedObject, is(builtObject)); }
public Builder toBuilder() { return builder().queryConditional(queryConditional) .exclusiveStartKey(exclusiveStartKey) .scanIndexForward(scanIndexForward) .limit(limit) .consistentRead(consistentRead) .filterExpression(filterExpression) .addNestedAttributesToProject(attributesToProject); }
QueryEnhancedRequest { public Builder toBuilder() { return builder().queryConditional(queryConditional) .exclusiveStartKey(exclusiveStartKey) .scanIndexForward(scanIndexForward) .limit(limit) .consistentRead(consistentRead) .filterExpression(filterExpression) .addNestedAttributesToProject(attributesToProject); } }
QueryEnhancedRequest { public Builder toBuilder() { return builder().queryConditional(queryConditional) .exclusiveStartKey(exclusiveStartKey) .scanIndexForward(scanIndexForward) .limit(limit) .consistentRead(consistentRead) .filterExpression(filterExpression) .addNestedAttributesToProject(attributesToProject); } private QueryEnhancedRequest(Builder builder); }
QueryEnhancedRequest { public Builder toBuilder() { return builder().queryConditional(queryConditional) .exclusiveStartKey(exclusiveStartKey) .scanIndexForward(scanIndexForward) .limit(limit) .consistentRead(consistentRead) .filterExpression(filterExpression) .addNestedAttributesToProject(attributesToProject); } private QueryEnhancedRequest(Builder builder); static Builder builder(); Builder toBuilder(); QueryConditional queryConditional(); Map<String, AttributeValue> exclusiveStartKey(); Boolean scanIndexForward(); Integer limit(); Boolean consistentRead(); Expression filterExpression(); List<String> attributesToProject(); List<NestedAttributeName> nestedAttributesToProject(); @Override boolean equals(Object o); @Override int hashCode(); }
QueryEnhancedRequest { public Builder toBuilder() { return builder().queryConditional(queryConditional) .exclusiveStartKey(exclusiveStartKey) .scanIndexForward(scanIndexForward) .limit(limit) .consistentRead(consistentRead) .filterExpression(filterExpression) .addNestedAttributesToProject(attributesToProject); } private QueryEnhancedRequest(Builder builder); static Builder builder(); Builder toBuilder(); QueryConditional queryConditional(); Map<String, AttributeValue> exclusiveStartKey(); Boolean scanIndexForward(); Integer limit(); Boolean consistentRead(); Expression filterExpression(); List<String> attributesToProject(); List<NestedAttributeName> nestedAttributesToProject(); @Override boolean equals(Object o); @Override int hashCode(); }
@Test public void toBuilder() { UpdateItemEnhancedRequest<FakeItem> builtObject = UpdateItemEnhancedRequest.builder(FakeItem.class).build(); UpdateItemEnhancedRequest copiedObject = builtObject.toBuilder().build(); assertThat(copiedObject, is(builtObject)); }
public Builder<T> toBuilder() { return new Builder<T>().item(item).ignoreNulls(ignoreNulls); }
UpdateItemEnhancedRequest { public Builder<T> toBuilder() { return new Builder<T>().item(item).ignoreNulls(ignoreNulls); } }
UpdateItemEnhancedRequest { public Builder<T> toBuilder() { return new Builder<T>().item(item).ignoreNulls(ignoreNulls); } private UpdateItemEnhancedRequest(Builder<T> builder); }
UpdateItemEnhancedRequest { public Builder<T> toBuilder() { return new Builder<T>().item(item).ignoreNulls(ignoreNulls); } private UpdateItemEnhancedRequest(Builder<T> builder); static Builder<T> builder(Class<? extends T> itemClass); Builder<T> toBuilder(); T item(); Boolean ignoreNulls(); Expression conditionExpression(); @Override boolean equals(Object o); @Override int hashCode(); }
UpdateItemEnhancedRequest { public Builder<T> toBuilder() { return new Builder<T>().item(item).ignoreNulls(ignoreNulls); } private UpdateItemEnhancedRequest(Builder<T> builder); static Builder<T> builder(Class<? extends T> itemClass); Builder<T> toBuilder(); T item(); Boolean ignoreNulls(); Expression conditionExpression(); @Override boolean equals(Object o); @Override int hashCode(); }
@Test public void toBuilder() { BatchGetItemEnhancedRequest builtObject = BatchGetItemEnhancedRequest.builder().build(); BatchGetItemEnhancedRequest copiedObject = builtObject.toBuilder().build(); assertThat(copiedObject, is(builtObject)); }
public Builder toBuilder() { return new Builder().readBatches(readBatches); }
BatchGetItemEnhancedRequest { public Builder toBuilder() { return new Builder().readBatches(readBatches); } }
BatchGetItemEnhancedRequest { public Builder toBuilder() { return new Builder().readBatches(readBatches); } private BatchGetItemEnhancedRequest(Builder builder); }
BatchGetItemEnhancedRequest { public Builder toBuilder() { return new Builder().readBatches(readBatches); } private BatchGetItemEnhancedRequest(Builder builder); static Builder builder(); Builder toBuilder(); Collection<ReadBatch> readBatches(); @Override boolean equals(Object o); @Override int hashCode(); }
BatchGetItemEnhancedRequest { public Builder toBuilder() { return new Builder().readBatches(readBatches); } private BatchGetItemEnhancedRequest(Builder builder); static Builder builder(); Builder toBuilder(); Collection<ReadBatch> readBatches(); @Override boolean equals(Object o); @Override int hashCode(); }
@Test public void modifyRequest_EnablesChunckedEncoding_ForUploadPartRequest() { ExecutionAttributes executionAttributes = new ExecutionAttributes(); assertThat(executionAttributes.getAttribute(ENABLE_CHUNKED_ENCODING)).isNull(); interceptor.modifyRequest(context(UploadPartRequest.builder().build()), executionAttributes); assertThat(executionAttributes.getAttribute(ENABLE_CHUNKED_ENCODING)).isEqualTo(true); }
@Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } @Override SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes); }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } @Override SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes); }
@Test public void simpleBean_correctlyAssignsPrimaryPartitionKey() { BeanTableSchema<SimpleBean> beanTableSchema = BeanTableSchema.create(SimpleBean.class); assertThat(beanTableSchema.tableMetadata().primaryPartitionKey(), is("id")); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void sortKeyBean_correctlyAssignsSortKey() { BeanTableSchema<SortKeyBean> beanTableSchema = BeanTableSchema.create(SortKeyBean.class); assertThat(beanTableSchema.tableMetadata().primarySortKey(), is(Optional.of("sort"))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void simpleBean_hasNoSortKey() { BeanTableSchema<SimpleBean> beanTableSchema = BeanTableSchema.create(SimpleBean.class); assertThat(beanTableSchema.tableMetadata().primarySortKey(), is(Optional.empty())); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void simpleBean_hasNoAdditionalKeys() { BeanTableSchema<SimpleBean> beanTableSchema = BeanTableSchema.create(SimpleBean.class); assertThat(beanTableSchema.tableMetadata().allKeys(), contains("id")); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void sortKeyBean_hasNoAdditionalKeys() { BeanTableSchema<SortKeyBean> beanTableSchema = BeanTableSchema.create(SortKeyBean.class); assertThat(beanTableSchema.tableMetadata().allKeys(), containsInAnyOrder("id", "sort")); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void secondaryIndexBean_definesGsiCorrectly() { BeanTableSchema<SecondaryIndexBean> beanTableSchema = BeanTableSchema.create(SecondaryIndexBean.class); assertThat(beanTableSchema.tableMetadata().indexPartitionKey("gsi"), is("sort")); assertThat(beanTableSchema.tableMetadata().indexSortKey("gsi"), is(Optional.of("attribute"))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void secondaryIndexBean_definesLsiCorrectly() { BeanTableSchema<SecondaryIndexBean> beanTableSchema = BeanTableSchema.create(SecondaryIndexBean.class); assertThat(beanTableSchema.tableMetadata().indexPartitionKey("lsi"), is("id")); assertThat(beanTableSchema.tableMetadata().indexSortKey("lsi"), is(Optional.of("attribute"))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void dynamoDbIgnore_propertyIsIgnored() { BeanTableSchema<IgnoredAttributeBean> beanTableSchema = BeanTableSchema.create(IgnoredAttributeBean.class); IgnoredAttributeBean ignoredAttributeBean = new IgnoredAttributeBean(); ignoredAttributeBean.setId("id-value"); ignoredAttributeBean.setIntegerAttribute(123); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(ignoredAttributeBean, false); assertThat(itemMap.size(), is(1)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void setterAnnotations_alsoWork() { BeanTableSchema<SetterAnnotatedBean> beanTableSchema = BeanTableSchema.create(SetterAnnotatedBean.class); SetterAnnotatedBean setterAnnotatedBean = new SetterAnnotatedBean(); setterAnnotatedBean.setId("id-value"); setterAnnotatedBean.setIntegerAttribute(123); assertThat(beanTableSchema.tableMetadata().primaryPartitionKey(), is("id")); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(setterAnnotatedBean, false); assertThat(itemMap.size(), is(1)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void dynamoDbAttribute_remapsAttributeName() { BeanTableSchema<RemappedAttributeBean> beanTableSchema = BeanTableSchema.create(RemappedAttributeBean.class); assertThat(beanTableSchema.tableMetadata().primaryPartitionKey(), is("remappedAttribute")); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void modifyRequest_DoesNotEnableChunckedEncoding_ForGetObjectRequest() { ExecutionAttributes executionAttributes = new ExecutionAttributes(); assertThat(executionAttributes.getAttribute(ENABLE_CHUNKED_ENCODING)).isNull(); interceptor.modifyRequest(context(GetObjectRequest.builder().build()), executionAttributes); assertThat(executionAttributes.getAttribute(ENABLE_CHUNKED_ENCODING)).isNull(); }
@Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } @Override SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes); }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } @Override SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes); }
@Test public void dynamoDbFlatten_correctlyFlattensBeanAttributes() { BeanTableSchema<FlattenedBeanBean> beanTableSchema = BeanTableSchema.create(FlattenedBeanBean.class); AbstractBean abstractBean = new AbstractBean(); abstractBean.setAttribute2("two"); FlattenedBeanBean flattenedBeanBean = new FlattenedBeanBean(); flattenedBeanBean.setId("id-value"); flattenedBeanBean.setAttribute1("one"); flattenedBeanBean.setAbstractBean(abstractBean); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(flattenedBeanBean, false); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("attribute2", stringValue("two"))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void dynamoDbFlatten_correctlyFlattensImmutableAttributes() { BeanTableSchema<FlattenedImmutableBean> beanTableSchema = BeanTableSchema.create(FlattenedImmutableBean.class); AbstractImmutable abstractImmutable = AbstractImmutable.builder().attribute2("two").build(); FlattenedImmutableBean flattenedImmutableBean = new FlattenedImmutableBean(); flattenedImmutableBean.setId("id-value"); flattenedImmutableBean.setAttribute1("one"); flattenedImmutableBean.setAbstractImmutable(abstractImmutable); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(flattenedImmutableBean, false); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("attribute2", stringValue("two"))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void documentBean_correctlyMapsBeanAttributes() { BeanTableSchema<DocumentBean> beanTableSchema = BeanTableSchema.create(DocumentBean.class); AbstractBean abstractBean = new AbstractBean(); abstractBean.setAttribute2("two"); DocumentBean documentBean = new DocumentBean(); documentBean.setId("id-value"); documentBean.setAttribute1("one"); documentBean.setAbstractBean(abstractBean); AttributeValue expectedDocument = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("two"))) .build(); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(documentBean, true); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("abstractBean", expectedDocument)); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void documentBean_list_correctlyMapsBeanAttributes() { BeanTableSchema<DocumentBean> beanTableSchema = BeanTableSchema.create(DocumentBean.class); AbstractBean abstractBean1 = new AbstractBean(); abstractBean1.setAttribute2("two"); AbstractBean abstractBean2 = new AbstractBean(); abstractBean2.setAttribute2("three"); DocumentBean documentBean = new DocumentBean(); documentBean.setId("id-value"); documentBean.setAttribute1("one"); documentBean.setAbstractBeanList(Arrays.asList(abstractBean1, abstractBean2)); AttributeValue expectedDocument1 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("two"))) .build(); AttributeValue expectedDocument2 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("three"))) .build(); AttributeValue expectedList = AttributeValue.builder().l(expectedDocument1, expectedDocument2).build(); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(documentBean, true); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("abstractBeanList", expectedList)); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void documentBean_map_correctlyMapsBeanAttributes() { BeanTableSchema<DocumentBean> beanTableSchema = BeanTableSchema.create(DocumentBean.class); AbstractBean abstractBean1 = new AbstractBean(); abstractBean1.setAttribute2("two"); AbstractBean abstractBean2 = new AbstractBean(); abstractBean2.setAttribute2("three"); DocumentBean documentBean = new DocumentBean(); documentBean.setId("id-value"); documentBean.setAttribute1("one"); Map<String, AbstractBean> abstractBeanMap = new HashMap<>(); abstractBeanMap.put("key1", abstractBean1); abstractBeanMap.put("key2", abstractBean2); documentBean.setAbstractBeanMap(abstractBeanMap); AttributeValue expectedDocument1 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("two"))) .build(); AttributeValue expectedDocument2 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("three"))) .build(); Map<String, AttributeValue> expectedAttributeValueMap = new HashMap<>(); expectedAttributeValueMap.put("key1", expectedDocument1); expectedAttributeValueMap.put("key2", expectedDocument2); AttributeValue expectedMap = AttributeValue.builder().m(expectedAttributeValueMap).build(); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(documentBean, true); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("abstractBeanMap", expectedMap)); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void documentBean_correctlyMapsImmutableAttributes() { BeanTableSchema<DocumentBean> beanTableSchema = BeanTableSchema.create(DocumentBean.class); AbstractImmutable abstractImmutable = AbstractImmutable.builder().attribute2("two").build(); DocumentBean documentBean = new DocumentBean(); documentBean.setId("id-value"); documentBean.setAttribute1("one"); documentBean.setAbstractImmutable(abstractImmutable); AttributeValue expectedDocument = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("two"))) .build(); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(documentBean, true); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("abstractImmutable", expectedDocument)); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void documentBean_list_correctlyMapsImmutableAttributes() { BeanTableSchema<DocumentBean> beanTableSchema = BeanTableSchema.create(DocumentBean.class); AbstractImmutable abstractImmutable1 = AbstractImmutable.builder().attribute2("two").build(); AbstractImmutable abstractImmutable2 = AbstractImmutable.builder().attribute2("three").build(); DocumentBean documentBean = new DocumentBean(); documentBean.setId("id-value"); documentBean.setAttribute1("one"); documentBean.setAbstractImmutableList(Arrays.asList(abstractImmutable1, abstractImmutable2)); AttributeValue expectedDocument1 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("two"))) .build(); AttributeValue expectedDocument2 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("three"))) .build(); AttributeValue expectedList = AttributeValue.builder().l(expectedDocument1, expectedDocument2).build(); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(documentBean, true); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("abstractImmutableList", expectedList)); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void documentBean_map_correctlyMapsImmutableAttributes() { BeanTableSchema<DocumentBean> beanTableSchema = BeanTableSchema.create(DocumentBean.class); AbstractImmutable abstractImmutable1 = AbstractImmutable.builder().attribute2("two").build(); AbstractImmutable abstractImmutable2 = AbstractImmutable.builder().attribute2("three").build(); DocumentBean documentBean = new DocumentBean(); documentBean.setId("id-value"); documentBean.setAttribute1("one"); Map<String, AbstractImmutable> abstractImmutableMap = new HashMap<>(); abstractImmutableMap.put("key1", abstractImmutable1); abstractImmutableMap.put("key2", abstractImmutable2); documentBean.setAbstractImmutableMap(abstractImmutableMap); AttributeValue expectedDocument1 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("two"))) .build(); AttributeValue expectedDocument2 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("three"))) .build(); Map<String, AttributeValue> expectedAttributeValueMap = new HashMap<>(); expectedAttributeValueMap.put("key1", expectedDocument1); expectedAttributeValueMap.put("key2", expectedDocument2); AttributeValue expectedMap = AttributeValue.builder().m(expectedAttributeValueMap).build(); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(documentBean, true); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("abstractImmutableMap", expectedMap)); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void parameterizedDocumentBean_correctlyMapsAttributes() { BeanTableSchema<ParameterizedDocumentBean> beanTableSchema = BeanTableSchema.create(ParameterizedDocumentBean.class); ParameterizedAbstractBean<String> abstractBean = new ParameterizedAbstractBean<>(); abstractBean.setAttribute2("two"); ParameterizedDocumentBean documentBean = new ParameterizedDocumentBean(); documentBean.setId("id-value"); documentBean.setAttribute1("one"); documentBean.setAbstractBean(abstractBean); AttributeValue expectedDocument = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("two"))) .build(); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(documentBean, true); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("abstractBean", expectedDocument)); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void parameterizedDocumentBean_list_correctlyMapsAttributes() { BeanTableSchema<ParameterizedDocumentBean> beanTableSchema = BeanTableSchema.create(ParameterizedDocumentBean.class); ParameterizedAbstractBean<String> abstractBean1 = new ParameterizedAbstractBean<>(); abstractBean1.setAttribute2("two"); ParameterizedAbstractBean<String> abstractBean2 = new ParameterizedAbstractBean<>(); abstractBean2.setAttribute2("three"); ParameterizedDocumentBean documentBean = new ParameterizedDocumentBean(); documentBean.setId("id-value"); documentBean.setAttribute1("one"); documentBean.setAbstractBeanList(Arrays.asList(abstractBean1, abstractBean2)); AttributeValue expectedDocument1 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("two"))) .build(); AttributeValue expectedDocument2 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("three"))) .build(); AttributeValue expectedList = AttributeValue.builder().l(expectedDocument1, expectedDocument2).build(); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(documentBean, true); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("abstractBeanList", expectedList)); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void modifyRequest_DoesNotOverwriteExistingAttributeValue() { ExecutionAttributes executionAttributes = new ExecutionAttributes(); interceptor.modifyRequest(context(PutObjectRequest.builder().build()), executionAttributes); boolean newValue = !executionAttributes.getAttribute(ENABLE_CHUNKED_ENCODING); executionAttributes.putAttribute(ENABLE_CHUNKED_ENCODING, newValue); interceptor.modifyRequest(context(PutObjectRequest.builder().build()), executionAttributes); assertThat(executionAttributes.getAttribute(ENABLE_CHUNKED_ENCODING)).isEqualTo(newValue); }
@Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } @Override SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes); }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } @Override SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes); }
@Test public void testAsync() throws MalformedURLException { assertThat(utilitiesFromAsyncClient.getUrl(requestWithoutSpaces()) .toExternalForm()) .isEqualTo("https: assertThat(utilitiesFromAsyncClient.getUrl(requestWithSpecialCharacters()) .toExternalForm()) .isEqualTo("https: }
public URL getUrl(Consumer<GetUrlRequest.Builder> getUrlRequest) { return getUrl(GetUrlRequest.builder().applyMutation(getUrlRequest).build()); }
S3Utilities { public URL getUrl(Consumer<GetUrlRequest.Builder> getUrlRequest) { return getUrl(GetUrlRequest.builder().applyMutation(getUrlRequest).build()); } }
S3Utilities { public URL getUrl(Consumer<GetUrlRequest.Builder> getUrlRequest) { return getUrl(GetUrlRequest.builder().applyMutation(getUrlRequest).build()); } private S3Utilities(Builder builder); }
S3Utilities { public URL getUrl(Consumer<GetUrlRequest.Builder> getUrlRequest) { return getUrl(GetUrlRequest.builder().applyMutation(getUrlRequest).build()); } private S3Utilities(Builder builder); static Builder builder(); URL getUrl(Consumer<GetUrlRequest.Builder> getUrlRequest); URL getUrl(GetUrlRequest getUrlRequest); }
S3Utilities { public URL getUrl(Consumer<GetUrlRequest.Builder> getUrlRequest) { return getUrl(GetUrlRequest.builder().applyMutation(getUrlRequest).build()); } private S3Utilities(Builder builder); static Builder builder(); URL getUrl(Consumer<GetUrlRequest.Builder> getUrlRequest); URL getUrl(GetUrlRequest getUrlRequest); }
@Test public void parameterizedDocumentBean_map_correctlyMapsAttributes() { BeanTableSchema<ParameterizedDocumentBean> beanTableSchema = BeanTableSchema.create(ParameterizedDocumentBean.class); ParameterizedAbstractBean<String> abstractBean1 = new ParameterizedAbstractBean<>(); abstractBean1.setAttribute2("two"); ParameterizedAbstractBean<String> abstractBean2 = new ParameterizedAbstractBean<>(); abstractBean2.setAttribute2("three"); ParameterizedDocumentBean documentBean = new ParameterizedDocumentBean(); documentBean.setId("id-value"); documentBean.setAttribute1("one"); Map<String, ParameterizedAbstractBean<String>> abstractBeanMap = new HashMap<>(); abstractBeanMap.put("key1", abstractBean1); abstractBeanMap.put("key2", abstractBean2); documentBean.setAbstractBeanMap(abstractBeanMap); AttributeValue expectedDocument1 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("two"))) .build(); AttributeValue expectedDocument2 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("three"))) .build(); Map<String, AttributeValue> expectedAttributeValueMap = new HashMap<>(); expectedAttributeValueMap.put("key1", expectedDocument1); expectedAttributeValueMap.put("key2", expectedDocument2); AttributeValue expectedMap = AttributeValue.builder().m(expectedAttributeValueMap).build(); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(documentBean, true); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("abstractBeanMap", expectedMap)); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void extendedBean_correctlyExtendsAttributes() { BeanTableSchema<ExtendedBean> beanTableSchema = BeanTableSchema.create(ExtendedBean.class); ExtendedBean extendedBean = new ExtendedBean(); extendedBean.setId("id-value"); extendedBean.setAttribute1("one"); extendedBean.setAttribute2("two"); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(extendedBean, false); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("attribute2", stringValue("two"))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test(expected = IllegalArgumentException.class) public void invalidBean_throwsIllegalArgumentException() { BeanTableSchema.create(InvalidBean.class); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void itemToMap_nullAttribute_ignoreNullsTrue() { BeanTableSchema<SimpleBean> beanTableSchema = BeanTableSchema.create(SimpleBean.class); SimpleBean simpleBean = new SimpleBean(); simpleBean.setId("id-value"); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(simpleBean, true); assertThat(itemMap.size(), is(1)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void itemToMap_nullAttribute_ignoreNullsFalse() { BeanTableSchema<SimpleBean> beanTableSchema = BeanTableSchema.create(SimpleBean.class); SimpleBean simpleBean = new SimpleBean(); simpleBean.setId("id-value"); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(simpleBean, false); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("integerAttribute", AttributeValues.nullAttributeValue())); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void itemToMap_nonNullAttribute() { BeanTableSchema<SimpleBean> beanTableSchema = BeanTableSchema.create(SimpleBean.class); SimpleBean simpleBean = new SimpleBean(); simpleBean.setId("id-value"); simpleBean.setIntegerAttribute(123); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(simpleBean, false); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("integerAttribute", numberValue(123))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void mapToItem_createsItem() { BeanTableSchema<SimpleBean> beanTableSchema = BeanTableSchema.create(SimpleBean.class); Map<String, AttributeValue> itemMap = new HashMap<>(); itemMap.put("id", stringValue("id-value")); itemMap.put("integerAttribute", numberValue(123)); SimpleBean expectedBean = new SimpleBean(); expectedBean.setId("id-value"); expectedBean.setIntegerAttribute(123); SimpleBean result = beanTableSchema.mapToItem(itemMap); assertThat(result, is(expectedBean)); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void attributeValue_returnsValue() { BeanTableSchema<SimpleBean> beanTableSchema = BeanTableSchema.create(SimpleBean.class); SimpleBean simpleBean = new SimpleBean(); simpleBean.setId("id-value"); simpleBean.setIntegerAttribute(123); assertThat(beanTableSchema.attributeValue(simpleBean, "integerAttribute"), is(numberValue(123))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void enumBean_invalidEnum() { BeanTableSchema<EnumBean> beanTableSchema = BeanTableSchema.create(EnumBean.class); Map<String, AttributeValue> itemMap = new HashMap<>(); itemMap.put("id", stringValue("id-value")); itemMap.put("testEnum", stringValue("invalid-value")); exception.expect(IllegalArgumentException.class); exception.expectMessage("invalid-value"); exception.expectMessage("TestEnum"); beanTableSchema.mapToItem(itemMap); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void enumBean_singleEnum() { BeanTableSchema<EnumBean> beanTableSchema = BeanTableSchema.create(EnumBean.class); EnumBean enumBean = new EnumBean(); enumBean.setId("id-value"); enumBean.setTestEnum(EnumBean.TestEnum.ONE); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(enumBean, true); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("testEnum", stringValue("ONE"))); EnumBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse, is(equalTo(enumBean))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void modifyRequest_valueOnServiceConfig_TakesPrecedenceOverDefaultEnabled() { S3Configuration config = S3Configuration.builder() .chunkedEncodingEnabled(false) .build(); ExecutionAttributes executionAttributes = new ExecutionAttributes() .putAttribute(SERVICE_CONFIG, config); interceptor.modifyRequest(context(PutObjectRequest.builder().build()), executionAttributes); assertThat(executionAttributes.getAttribute(ENABLE_CHUNKED_ENCODING)).isEqualTo(false); }
@Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } @Override SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes); }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } @Override SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes); }
@Test public void enumBean_listEnum() { BeanTableSchema<EnumBean> beanTableSchema = BeanTableSchema.create(EnumBean.class); EnumBean enumBean = new EnumBean(); enumBean.setId("id-value"); enumBean.setTestEnumList(Arrays.asList(EnumBean.TestEnum.ONE, EnumBean.TestEnum.TWO)); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(enumBean, true); AttributeValue expectedAttributeValue = AttributeValue.builder() .l(stringValue("ONE"), stringValue("TWO")) .build(); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("testEnumList", expectedAttributeValue)); EnumBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse, is(equalTo(enumBean))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void listBean_stringList() { BeanTableSchema<ListBean> beanTableSchema = BeanTableSchema.create(ListBean.class); ListBean listBean = new ListBean(); listBean.setId("id-value"); listBean.setStringList(Arrays.asList("one", "two", "three")); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(listBean, true); AttributeValue expectedAttributeValue = AttributeValue.builder() .l(stringValue("one"), stringValue("two"), stringValue("three")) .build(); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("stringList", expectedAttributeValue)); ListBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse, is(equalTo(listBean))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void listBean_stringListList() { BeanTableSchema<ListBean> beanTableSchema = BeanTableSchema.create(ListBean.class); ListBean listBean = new ListBean(); listBean.setId("id-value"); listBean.setStringListList(Arrays.asList(Arrays.asList("one", "two"), Arrays.asList("three", "four"))); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(listBean, true); AttributeValue list1 = AttributeValue.builder().l(stringValue("one"), stringValue("two")).build(); AttributeValue list2 = AttributeValue.builder().l(stringValue("three"), stringValue("four")).build(); AttributeValue expectedAttributeValue = AttributeValue.builder() .l(list1, list2) .build(); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("stringListList", expectedAttributeValue)); ListBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse, is(equalTo(listBean))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void setBean_stringSet() { BeanTableSchema<SetBean> beanTableSchema = BeanTableSchema.create(SetBean.class); SetBean setBean = new SetBean(); setBean.setId("id-value"); LinkedHashSet<String> stringSet = new LinkedHashSet<>(); stringSet.add("one"); stringSet.add("two"); stringSet.add("three"); setBean.setStringSet(stringSet); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(setBean, true); AttributeValue expectedAttributeValue = AttributeValue.builder() .ss("one", "two", "three") .build(); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("stringSet", expectedAttributeValue)); SetBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse, is(equalTo(setBean))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void setBean_integerSet() { BeanTableSchema<SetBean> beanTableSchema = BeanTableSchema.create(SetBean.class); SetBean setBean = new SetBean(); setBean.setId("id-value"); LinkedHashSet<Integer> integerSet = new LinkedHashSet<>(); integerSet.add(1); integerSet.add(2); integerSet.add(3); setBean.setIntegerSet(integerSet); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(setBean, true); AttributeValue expectedAttributeValue = AttributeValue.builder() .ns("1", "2", "3") .build(); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("integerSet", expectedAttributeValue)); SetBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse, is(equalTo(setBean))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void setBean_longSet() { BeanTableSchema<SetBean> beanTableSchema = BeanTableSchema.create(SetBean.class); SetBean setBean = new SetBean(); setBean.setId("id-value"); LinkedHashSet<Long> longSet = new LinkedHashSet<>(); longSet.add(1L); longSet.add(2L); longSet.add(3L); setBean.setLongSet(longSet); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(setBean, true); AttributeValue expectedAttributeValue = AttributeValue.builder() .ns("1", "2", "3") .build(); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("longSet", expectedAttributeValue)); SetBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse, is(equalTo(setBean))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void setBean_shortSet() { BeanTableSchema<SetBean> beanTableSchema = BeanTableSchema.create(SetBean.class); SetBean setBean = new SetBean(); setBean.setId("id-value"); LinkedHashSet<Short> shortSet = new LinkedHashSet<>(); shortSet.add((short)1); shortSet.add((short)2); shortSet.add((short)3); setBean.setShortSet(shortSet); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(setBean, true); AttributeValue expectedAttributeValue = AttributeValue.builder() .ns("1", "2", "3") .build(); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("shortSet", expectedAttributeValue)); SetBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse, is(equalTo(setBean))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void setBean_byteSet() { BeanTableSchema<SetBean> beanTableSchema = BeanTableSchema.create(SetBean.class); SetBean setBean = new SetBean(); setBean.setId("id-value"); LinkedHashSet<Byte> byteSet = new LinkedHashSet<>(); byteSet.add((byte)1); byteSet.add((byte)2); byteSet.add((byte)3); setBean.setByteSet(byteSet); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(setBean, true); AttributeValue expectedAttributeValue = AttributeValue.builder() .ns("1", "2", "3") .build(); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("byteSet", expectedAttributeValue)); SetBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse, is(equalTo(setBean))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void setBean_doubleSet() { BeanTableSchema<SetBean> beanTableSchema = BeanTableSchema.create(SetBean.class); SetBean setBean = new SetBean(); setBean.setId("id-value"); LinkedHashSet<Double> doubleSet = new LinkedHashSet<>(); doubleSet.add(1.1); doubleSet.add(2.2); doubleSet.add(3.3); setBean.setDoubleSet(doubleSet); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(setBean, true); AttributeValue expectedAttributeValue = AttributeValue.builder() .ns("1.1", "2.2", "3.3") .build(); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("doubleSet", expectedAttributeValue)); SetBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse, is(equalTo(setBean))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void setBean_floatSet() { BeanTableSchema<SetBean> beanTableSchema = BeanTableSchema.create(SetBean.class); SetBean setBean = new SetBean(); setBean.setId("id-value"); LinkedHashSet<Float> floatSet = new LinkedHashSet<>(); floatSet.add(1.1f); floatSet.add(2.2f); floatSet.add(3.3f); setBean.setFloatSet(floatSet); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(setBean, true); AttributeValue expectedAttributeValue = AttributeValue.builder() .ns("1.1", "2.2", "3.3") .build(); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("floatSet", expectedAttributeValue)); SetBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse, is(equalTo(setBean))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void modifyRequest_existingValueInExecutionAttributes_TakesPrecedenceOverClientConfig() { boolean configValue = false; S3Configuration config = S3Configuration.builder() .chunkedEncodingEnabled(configValue) .build(); ExecutionAttributes executionAttributes = new ExecutionAttributes() .putAttribute(SERVICE_CONFIG, config) .putAttribute(ENABLE_CHUNKED_ENCODING, !configValue); interceptor.modifyRequest(context(PutObjectRequest.builder().build()), executionAttributes); assertThat(executionAttributes.getAttribute(ENABLE_CHUNKED_ENCODING)).isEqualTo(!configValue); }
@Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } @Override SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes); }
EnableChunkedEncodingInterceptor implements ExecutionInterceptor { @Override public SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes) { SdkRequest sdkRequest = context.request(); if (sdkRequest instanceof PutObjectRequest || sdkRequest instanceof UploadPartRequest) { S3Configuration serviceConfiguration = (S3Configuration) executionAttributes.getAttribute(AwsSignerExecutionAttribute.SERVICE_CONFIG); boolean enableChunkedEncoding; if (serviceConfiguration != null) { enableChunkedEncoding = serviceConfiguration.chunkedEncodingEnabled(); } else { enableChunkedEncoding = true; } executionAttributes.putAttributeIfAbsent(S3SignerExecutionAttribute.ENABLE_CHUNKED_ENCODING, enableChunkedEncoding); } return sdkRequest; } @Override SdkRequest modifyRequest(Context.ModifyRequest context, ExecutionAttributes executionAttributes); }
@Test public void setBean_binarySet() { SdkBytes buffer1 = SdkBytes.fromString("one", StandardCharsets.UTF_8); SdkBytes buffer2 = SdkBytes.fromString("two", StandardCharsets.UTF_8); SdkBytes buffer3 = SdkBytes.fromString("three", StandardCharsets.UTF_8); BeanTableSchema<SetBean> beanTableSchema = BeanTableSchema.create(SetBean.class); SetBean setBean = new SetBean(); setBean.setId("id-value"); LinkedHashSet<SdkBytes> binarySet = new LinkedHashSet<>(); binarySet.add(buffer1); binarySet.add(buffer2); binarySet.add(buffer3); setBean.setBinarySet(binarySet); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(setBean, true); AttributeValue expectedAttributeValue = AttributeValue.builder() .bs(buffer1, buffer2, buffer3) .build(); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("binarySet", expectedAttributeValue)); SetBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse, is(equalTo(setBean))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void mapBean_stringStringMap() { BeanTableSchema<MapBean> beanTableSchema = BeanTableSchema.create(MapBean.class); MapBean mapBean = new MapBean(); mapBean.setId("id-value"); Map<String, String> testMap = new HashMap<>(); testMap.put("one", "two"); testMap.put("three", "four"); mapBean.setStringMap(testMap); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(mapBean, true); Map<String, AttributeValue> expectedMap = new HashMap<>(); expectedMap.put("one", stringValue("two")); expectedMap.put("three", stringValue("four")); AttributeValue expectedMapValue = AttributeValue.builder() .m(expectedMap) .build(); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("stringMap", expectedMapValue)); MapBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse, is(equalTo(mapBean))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void mapBean_nestedStringMap() { BeanTableSchema<MapBean> beanTableSchema = BeanTableSchema.create(MapBean.class); MapBean mapBean = new MapBean(); mapBean.setId("id-value"); Map<String, Map<String, String>> testMap = new HashMap<>(); testMap.put("five", singletonMap("one", "two")); testMap.put("six", singletonMap("three", "four")); mapBean.setNestedStringMap(testMap); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(mapBean, true); Map<String, AttributeValue> expectedMap = new HashMap<>(); expectedMap.put("five", AttributeValue.builder().m(singletonMap("one", stringValue("two"))).build()); expectedMap.put("six", AttributeValue.builder().m(singletonMap("three", stringValue("four"))).build()); AttributeValue expectedMapValue = AttributeValue.builder() .m(expectedMap) .build(); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("nestedStringMap", expectedMapValue)); MapBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse, is(equalTo(mapBean))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void commonTypesBean() { BeanTableSchema<CommonTypesBean> beanTableSchema = BeanTableSchema.create(CommonTypesBean.class); CommonTypesBean commonTypesBean = new CommonTypesBean(); SdkBytes binaryLiteral = SdkBytes.fromString("test-string", StandardCharsets.UTF_8); commonTypesBean.setId("id-value"); commonTypesBean.setBooleanAttribute(true); commonTypesBean.setIntegerAttribute(123); commonTypesBean.setLongAttribute(234L); commonTypesBean.setShortAttribute((short) 345); commonTypesBean.setByteAttribute((byte) 45); commonTypesBean.setDoubleAttribute(56.7); commonTypesBean.setFloatAttribute((float) 67.8); commonTypesBean.setBinaryAttribute(binaryLiteral); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(commonTypesBean, true); assertThat(itemMap.size(), is(9)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("booleanAttribute", AttributeValue.builder().bool(true).build())); assertThat(itemMap, hasEntry("integerAttribute", numberValue(123))); assertThat(itemMap, hasEntry("longAttribute", numberValue(234))); assertThat(itemMap, hasEntry("shortAttribute", numberValue(345))); assertThat(itemMap, hasEntry("byteAttribute", numberValue(45))); assertThat(itemMap, hasEntry("doubleAttribute", numberValue(56.7))); assertThat(itemMap, hasEntry("floatAttribute", numberValue(67.8))); assertThat(itemMap, hasEntry("binaryAttribute", binaryValue(binaryLiteral))); CommonTypesBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse, is(equalTo(commonTypesBean))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void primitiveTypesBean() { BeanTableSchema<PrimitiveTypesBean> beanTableSchema = BeanTableSchema.create(PrimitiveTypesBean.class); PrimitiveTypesBean primitiveTypesBean = new PrimitiveTypesBean(); primitiveTypesBean.setId("id-value"); primitiveTypesBean.setBooleanAttribute(true); primitiveTypesBean.setIntegerAttribute(123); primitiveTypesBean.setLongAttribute(234L); primitiveTypesBean.setShortAttribute((short) 345); primitiveTypesBean.setByteAttribute((byte) 45); primitiveTypesBean.setDoubleAttribute(56.7); primitiveTypesBean.setFloatAttribute((float) 67.8); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(primitiveTypesBean, true); assertThat(itemMap.size(), is(8)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("booleanAttribute", AttributeValue.builder().bool(true).build())); assertThat(itemMap, hasEntry("integerAttribute", numberValue(123))); assertThat(itemMap, hasEntry("longAttribute", numberValue(234))); assertThat(itemMap, hasEntry("shortAttribute", numberValue(345))); assertThat(itemMap, hasEntry("byteAttribute", numberValue(45))); assertThat(itemMap, hasEntry("doubleAttribute", numberValue(56.7))); assertThat(itemMap, hasEntry("floatAttribute", numberValue(67.8))); PrimitiveTypesBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse, is(equalTo(primitiveTypesBean))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void itemToMap_specificAttributes() { BeanTableSchema<CommonTypesBean> beanTableSchema = BeanTableSchema.create(CommonTypesBean.class); CommonTypesBean commonTypesBean = new CommonTypesBean(); commonTypesBean.setId("id-value"); commonTypesBean.setIntegerAttribute(123); commonTypesBean.setLongAttribute(234L); commonTypesBean.setFloatAttribute((float) 67.8); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(commonTypesBean, Arrays.asList("longAttribute", "floatAttribute")); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("longAttribute", numberValue(234))); assertThat(itemMap, hasEntry("floatAttribute", numberValue(67.8))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void itemType_returnsCorrectClass() { BeanTableSchema<SimpleBean> beanTableSchema = BeanTableSchema.create(SimpleBean.class); assertThat(beanTableSchema.itemType(), is(equalTo(EnhancedType.of(SimpleBean.class)))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void attributeConverterWithoutConstructor_throwsIllegalArgumentException() { exception.expect(IllegalArgumentException.class); exception.expectMessage("default constructor"); BeanTableSchema.create(AttributeConverterNoConstructorBean.class); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void usesCustomAttributeConverter() { BeanTableSchema<AttributeConverterBean> beanTableSchema = BeanTableSchema.create(AttributeConverterBean.class); AttributeConverterBean.AttributeItem attributeItem = new AttributeConverterBean.AttributeItem(); attributeItem.setInnerValue("inner-value"); AttributeConverterBean converterBean = new AttributeConverterBean(); converterBean.setId("id-value"); converterBean.setIntegerAttribute(123); converterBean.setAttributeItem(attributeItem); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(converterBean, false); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("integerAttribute", numberValue(123))); assertThat(itemMap, hasEntry("attributeItem", stringValue("inner-value"))); AttributeConverterBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse, is(equalTo(converterBean))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void converterProviderWithoutConstructor_throwsIllegalArgumentException() { exception.expect(IllegalArgumentException.class); exception.expectMessage("default constructor"); BeanTableSchema.create(NoConstructorConverterProvidersBean.class); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void headBucket404_shouldTranslateException() { S3Exception s3Exception = create404S3Exception(); Context.FailedExecution failedExecution = getFailedExecution(s3Exception, HeadBucketRequest.builder().build()); assertThat(interceptor.modifyException(failedExecution, new ExecutionAttributes())) .isExactlyInstanceOf(NoSuchBucketException.class); }
@Override public Throwable modifyException(Context.FailedExecution context, ExecutionAttributes executionAttributes) { if (!isS3Exception404(context.exception()) || !isHeadRequest(context.request())) { return context.exception(); } String message = context.exception().getMessage(); S3Exception exception = (S3Exception) (context.exception()); String requestIdFromHeader = exception.awsErrorDetails() .sdkHttpResponse() .firstMatchingHeader("x-amz-request-id") .orElse(null); String requestId = Optional.ofNullable(exception.requestId()).orElse(requestIdFromHeader); AwsErrorDetails errorDetails = exception.awsErrorDetails(); if (context.request() instanceof HeadObjectRequest) { return NoSuchKeyException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchKey", "The specified key does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } if (context.request() instanceof HeadBucketRequest) { return NoSuchBucketException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchBucket", "The specified bucket does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } return context.exception(); }
ExceptionTranslationInterceptor implements ExecutionInterceptor { @Override public Throwable modifyException(Context.FailedExecution context, ExecutionAttributes executionAttributes) { if (!isS3Exception404(context.exception()) || !isHeadRequest(context.request())) { return context.exception(); } String message = context.exception().getMessage(); S3Exception exception = (S3Exception) (context.exception()); String requestIdFromHeader = exception.awsErrorDetails() .sdkHttpResponse() .firstMatchingHeader("x-amz-request-id") .orElse(null); String requestId = Optional.ofNullable(exception.requestId()).orElse(requestIdFromHeader); AwsErrorDetails errorDetails = exception.awsErrorDetails(); if (context.request() instanceof HeadObjectRequest) { return NoSuchKeyException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchKey", "The specified key does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } if (context.request() instanceof HeadBucketRequest) { return NoSuchBucketException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchBucket", "The specified bucket does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } return context.exception(); } }
ExceptionTranslationInterceptor implements ExecutionInterceptor { @Override public Throwable modifyException(Context.FailedExecution context, ExecutionAttributes executionAttributes) { if (!isS3Exception404(context.exception()) || !isHeadRequest(context.request())) { return context.exception(); } String message = context.exception().getMessage(); S3Exception exception = (S3Exception) (context.exception()); String requestIdFromHeader = exception.awsErrorDetails() .sdkHttpResponse() .firstMatchingHeader("x-amz-request-id") .orElse(null); String requestId = Optional.ofNullable(exception.requestId()).orElse(requestIdFromHeader); AwsErrorDetails errorDetails = exception.awsErrorDetails(); if (context.request() instanceof HeadObjectRequest) { return NoSuchKeyException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchKey", "The specified key does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } if (context.request() instanceof HeadBucketRequest) { return NoSuchBucketException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchBucket", "The specified bucket does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } return context.exception(); } }
ExceptionTranslationInterceptor implements ExecutionInterceptor { @Override public Throwable modifyException(Context.FailedExecution context, ExecutionAttributes executionAttributes) { if (!isS3Exception404(context.exception()) || !isHeadRequest(context.request())) { return context.exception(); } String message = context.exception().getMessage(); S3Exception exception = (S3Exception) (context.exception()); String requestIdFromHeader = exception.awsErrorDetails() .sdkHttpResponse() .firstMatchingHeader("x-amz-request-id") .orElse(null); String requestId = Optional.ofNullable(exception.requestId()).orElse(requestIdFromHeader); AwsErrorDetails errorDetails = exception.awsErrorDetails(); if (context.request() instanceof HeadObjectRequest) { return NoSuchKeyException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchKey", "The specified key does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } if (context.request() instanceof HeadBucketRequest) { return NoSuchBucketException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchBucket", "The specified bucket does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } return context.exception(); } @Override Throwable modifyException(Context.FailedExecution context, ExecutionAttributes executionAttributes); }
ExceptionTranslationInterceptor implements ExecutionInterceptor { @Override public Throwable modifyException(Context.FailedExecution context, ExecutionAttributes executionAttributes) { if (!isS3Exception404(context.exception()) || !isHeadRequest(context.request())) { return context.exception(); } String message = context.exception().getMessage(); S3Exception exception = (S3Exception) (context.exception()); String requestIdFromHeader = exception.awsErrorDetails() .sdkHttpResponse() .firstMatchingHeader("x-amz-request-id") .orElse(null); String requestId = Optional.ofNullable(exception.requestId()).orElse(requestIdFromHeader); AwsErrorDetails errorDetails = exception.awsErrorDetails(); if (context.request() instanceof HeadObjectRequest) { return NoSuchKeyException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchKey", "The specified key does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } if (context.request() instanceof HeadBucketRequest) { return NoSuchBucketException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchBucket", "The specified bucket does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } return context.exception(); } @Override Throwable modifyException(Context.FailedExecution context, ExecutionAttributes executionAttributes); }
@Test public void usesCustomAttributeConverterProvider() { BeanTableSchema<SingleConverterProvidersBean> beanTableSchema = BeanTableSchema.create(SingleConverterProvidersBean.class); SingleConverterProvidersBean converterBean = new SingleConverterProvidersBean(); converterBean.setId("id-value"); converterBean.setIntegerAttribute(123); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(converterBean, false); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("id", stringValue("id-value-custom"))); assertThat(itemMap, hasEntry("integerAttribute", numberValue(133))); SingleConverterProvidersBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse.getId(), is(equalTo("id-value-custom"))); assertThat(reverse.getIntegerAttribute(), is(equalTo(133))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void usesCustomAttributeConverterProviders() { BeanTableSchema<MultipleConverterProvidersBean> beanTableSchema = BeanTableSchema.create(MultipleConverterProvidersBean.class); MultipleConverterProvidersBean converterBean = new MultipleConverterProvidersBean(); converterBean.setId("id-value"); converterBean.setIntegerAttribute(123); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(converterBean, false); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("id", stringValue("id-value-custom"))); assertThat(itemMap, hasEntry("integerAttribute", numberValue(133))); MultipleConverterProvidersBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse.getId(), is(equalTo("id-value-custom"))); assertThat(reverse.getIntegerAttribute(), is(equalTo(133))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void emptyConverterProviderList_fails_whenAttributeConvertersAreMissing() { exception.expect(NullPointerException.class); BeanTableSchema.create(EmptyConverterProvidersInvalidBean.class); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void emptyConverterProviderList_correct_whenAttributeConvertersAreSupplied() { BeanTableSchema<EmptyConverterProvidersValidBean> beanTableSchema = BeanTableSchema.create(EmptyConverterProvidersValidBean.class); EmptyConverterProvidersValidBean converterBean = new EmptyConverterProvidersValidBean(); converterBean.setId("id-value"); converterBean.setIntegerAttribute(123); Map<String, AttributeValue> itemMap = beanTableSchema.itemToMap(converterBean, false); assertThat(itemMap.size(), is(2)); assertThat(itemMap, hasEntry("id", stringValue("id-value-custom"))); assertThat(itemMap, hasEntry("integerAttribute", numberValue(133))); EmptyConverterProvidersValidBean reverse = beanTableSchema.mapToItem(itemMap); assertThat(reverse.getId(), is(equalTo("id-value-custom"))); assertThat(reverse.getIntegerAttribute(), is(equalTo(133))); }
public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
BeanTableSchema extends WrappedTableSchema<T, StaticTableSchema<T>> { public static <T> BeanTableSchema<T> create(Class<T> beanClass) { return create(beanClass, new MetaTableSchemaCache()); } private BeanTableSchema(StaticTableSchema<T> staticTableSchema); static BeanTableSchema<T> create(Class<T> beanClass); }
@Test public void toBuilder() { ImmutableAttribute<Object, Object, String> immutableAttribute = ImmutableAttribute.builder(Object.class, Object.class, String.class) .name("test-attribute") .getter(TEST_GETTER) .setter(TEST_SETTER) .tags(mockTag, mockTag2) .attributeConverter(attributeConverter) .build(); ImmutableAttribute<Object, Object, String> clonedAttribute = immutableAttribute.toBuilder().build(); assertThat(clonedAttribute.name()).isEqualTo("test-attribute"); assertThat(clonedAttribute.getter()).isSameAs(TEST_GETTER); assertThat(clonedAttribute.setter()).isSameAs(TEST_SETTER); assertThat(clonedAttribute.tags()).containsExactly(mockTag, mockTag2); assertThat(clonedAttribute.type()).isEqualTo(EnhancedType.of(String.class)); assertThat(clonedAttribute.attributeConverter()).isSameAs(attributeConverter); }
public Builder<T, B, R> toBuilder() { return new Builder<T, B, R>(this.type).name(this.name) .getter(this.getter) .setter(this.setter) .tags(this.tags) .attributeConverter(this.attributeConverter); }
ImmutableAttribute { public Builder<T, B, R> toBuilder() { return new Builder<T, B, R>(this.type).name(this.name) .getter(this.getter) .setter(this.setter) .tags(this.tags) .attributeConverter(this.attributeConverter); } }
ImmutableAttribute { public Builder<T, B, R> toBuilder() { return new Builder<T, B, R>(this.type).name(this.name) .getter(this.getter) .setter(this.setter) .tags(this.tags) .attributeConverter(this.attributeConverter); } private ImmutableAttribute(Builder<T, B, R> builder); }
ImmutableAttribute { public Builder<T, B, R> toBuilder() { return new Builder<T, B, R>(this.type).name(this.name) .getter(this.getter) .setter(this.setter) .tags(this.tags) .attributeConverter(this.attributeConverter); } private ImmutableAttribute(Builder<T, B, R> builder); static Builder<T, B, R> builder(Class<T> itemClass, Class<B> builderClass, EnhancedType<R> attributeType); static Builder<T, B, R> builder(Class<T> itemClass, Class<B> builderClass, Class<R> attributeClass); String name(); Function<T, R> getter(); BiConsumer<B, R> setter(); Collection<StaticAttributeTag> tags(); EnhancedType<R> type(); AttributeConverter<R> attributeConverter(); Builder<T, B, R> toBuilder(); }
ImmutableAttribute { public Builder<T, B, R> toBuilder() { return new Builder<T, B, R>(this.type).name(this.name) .getter(this.getter) .setter(this.setter) .tags(this.tags) .attributeConverter(this.attributeConverter); } private ImmutableAttribute(Builder<T, B, R> builder); static Builder<T, B, R> builder(Class<T> itemClass, Class<B> builderClass, EnhancedType<R> attributeType); static Builder<T, B, R> builder(Class<T> itemClass, Class<B> builderClass, Class<R> attributeClass); String name(); Function<T, R> getter(); BiConsumer<B, R> setter(); Collection<StaticAttributeTag> tags(); EnhancedType<R> type(); AttributeConverter<R> attributeConverter(); Builder<T, B, R> toBuilder(); }
@Test public void documentImmutable_correctlyMapsBeanAttributes() { ImmutableTableSchema<DocumentImmutable> documentImmutableTableSchema = ImmutableTableSchema.create(DocumentImmutable.class); AbstractBean abstractBean = new AbstractBean(); abstractBean.setAttribute2("two"); DocumentImmutable documentImmutable = DocumentImmutable.builder().id("id-value") .attribute1("one") .abstractBean(abstractBean) .build(); AttributeValue expectedDocument = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("two"))) .build(); Map<String, AttributeValue> itemMap = documentImmutableTableSchema.itemToMap(documentImmutable, true); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("abstractBean", expectedDocument)); }
public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); static ImmutableTableSchema<T> create(Class<T> immutableClass); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); static ImmutableTableSchema<T> create(Class<T> immutableClass); }
@Test public void documentImmutable_list_correctlyMapsBeanAttributes() { ImmutableTableSchema<DocumentImmutable> documentImmutableTableSchema = ImmutableTableSchema.create(DocumentImmutable.class); AbstractBean abstractBean1 = new AbstractBean(); abstractBean1.setAttribute2("two"); AbstractBean abstractBean2 = new AbstractBean(); abstractBean2.setAttribute2("three"); DocumentImmutable documentImmutable = DocumentImmutable.builder() .id("id-value") .attribute1("one") .abstractBeanList(Arrays.asList(abstractBean1, abstractBean2)) .build(); AttributeValue expectedDocument1 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("two"))) .build(); AttributeValue expectedDocument2 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("three"))) .build(); AttributeValue expectedList = AttributeValue.builder().l(expectedDocument1, expectedDocument2).build(); Map<String, AttributeValue> itemMap = documentImmutableTableSchema.itemToMap(documentImmutable, true); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("abstractBeanList", expectedList)); }
public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); static ImmutableTableSchema<T> create(Class<T> immutableClass); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); static ImmutableTableSchema<T> create(Class<T> immutableClass); }
@Test public void documentImmutable_map_correctlyMapsBeanAttributes() { ImmutableTableSchema<DocumentImmutable> documentImmutableTableSchema = ImmutableTableSchema.create(DocumentImmutable.class); AbstractBean abstractBean1 = new AbstractBean(); abstractBean1.setAttribute2("two"); AbstractBean abstractBean2 = new AbstractBean(); abstractBean2.setAttribute2("three"); Map<String, AbstractBean> abstractBeanMap = new HashMap<>(); abstractBeanMap.put("key1", abstractBean1); abstractBeanMap.put("key2", abstractBean2); DocumentImmutable documentImmutable = DocumentImmutable.builder() .id("id-value") .attribute1("one") .abstractBeanMap(abstractBeanMap) .build(); AttributeValue expectedDocument1 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("two"))) .build(); AttributeValue expectedDocument2 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("three"))) .build(); Map<String, AttributeValue> expectedAttributeValueMap = new HashMap<>(); expectedAttributeValueMap.put("key1", expectedDocument1); expectedAttributeValueMap.put("key2", expectedDocument2); AttributeValue expectedMap = AttributeValue.builder().m(expectedAttributeValueMap).build(); Map<String, AttributeValue> itemMap = documentImmutableTableSchema.itemToMap(documentImmutable, true); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("abstractBeanMap", expectedMap)); }
public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); static ImmutableTableSchema<T> create(Class<T> immutableClass); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); static ImmutableTableSchema<T> create(Class<T> immutableClass); }
@Test public void documentImmutable_correctlyMapsImmutableAttributes() { ImmutableTableSchema<DocumentImmutable> documentImmutableTableSchema = ImmutableTableSchema.create(DocumentImmutable.class); AbstractImmutable abstractImmutable = AbstractImmutable.builder().attribute2("two").build(); DocumentImmutable documentImmutable = DocumentImmutable.builder().id("id-value") .attribute1("one") .abstractImmutable(abstractImmutable) .build(); AttributeValue expectedDocument = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("two"))) .build(); Map<String, AttributeValue> itemMap = documentImmutableTableSchema.itemToMap(documentImmutable, true); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("abstractImmutable", expectedDocument)); }
public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); static ImmutableTableSchema<T> create(Class<T> immutableClass); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); static ImmutableTableSchema<T> create(Class<T> immutableClass); }
@Test public void documentImmutable_list_correctlyMapsImmutableAttributes() { ImmutableTableSchema<DocumentImmutable> documentImmutableTableSchema = ImmutableTableSchema.create(DocumentImmutable.class); AbstractImmutable abstractImmutable1 = AbstractImmutable.builder().attribute2("two").build(); AbstractImmutable abstractImmutable2 = AbstractImmutable.builder().attribute2("three").build(); DocumentImmutable documentImmutable = DocumentImmutable.builder() .id("id-value") .attribute1("one") .abstractImmutableList(Arrays.asList(abstractImmutable1, abstractImmutable2)) .build(); AttributeValue expectedDocument1 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("two"))) .build(); AttributeValue expectedDocument2 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("three"))) .build(); AttributeValue expectedList = AttributeValue.builder().l(expectedDocument1, expectedDocument2).build(); Map<String, AttributeValue> itemMap = documentImmutableTableSchema.itemToMap(documentImmutable, true); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("abstractImmutableList", expectedList)); }
public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); static ImmutableTableSchema<T> create(Class<T> immutableClass); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); static ImmutableTableSchema<T> create(Class<T> immutableClass); }
@Test public void headObject404_shouldTranslateException() { S3Exception s3Exception = create404S3Exception(); Context.FailedExecution failedExecution = getFailedExecution(s3Exception, HeadObjectRequest.builder().build()); assertThat(interceptor.modifyException(failedExecution, new ExecutionAttributes())) .isExactlyInstanceOf(NoSuchKeyException.class); }
@Override public Throwable modifyException(Context.FailedExecution context, ExecutionAttributes executionAttributes) { if (!isS3Exception404(context.exception()) || !isHeadRequest(context.request())) { return context.exception(); } String message = context.exception().getMessage(); S3Exception exception = (S3Exception) (context.exception()); String requestIdFromHeader = exception.awsErrorDetails() .sdkHttpResponse() .firstMatchingHeader("x-amz-request-id") .orElse(null); String requestId = Optional.ofNullable(exception.requestId()).orElse(requestIdFromHeader); AwsErrorDetails errorDetails = exception.awsErrorDetails(); if (context.request() instanceof HeadObjectRequest) { return NoSuchKeyException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchKey", "The specified key does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } if (context.request() instanceof HeadBucketRequest) { return NoSuchBucketException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchBucket", "The specified bucket does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } return context.exception(); }
ExceptionTranslationInterceptor implements ExecutionInterceptor { @Override public Throwable modifyException(Context.FailedExecution context, ExecutionAttributes executionAttributes) { if (!isS3Exception404(context.exception()) || !isHeadRequest(context.request())) { return context.exception(); } String message = context.exception().getMessage(); S3Exception exception = (S3Exception) (context.exception()); String requestIdFromHeader = exception.awsErrorDetails() .sdkHttpResponse() .firstMatchingHeader("x-amz-request-id") .orElse(null); String requestId = Optional.ofNullable(exception.requestId()).orElse(requestIdFromHeader); AwsErrorDetails errorDetails = exception.awsErrorDetails(); if (context.request() instanceof HeadObjectRequest) { return NoSuchKeyException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchKey", "The specified key does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } if (context.request() instanceof HeadBucketRequest) { return NoSuchBucketException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchBucket", "The specified bucket does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } return context.exception(); } }
ExceptionTranslationInterceptor implements ExecutionInterceptor { @Override public Throwable modifyException(Context.FailedExecution context, ExecutionAttributes executionAttributes) { if (!isS3Exception404(context.exception()) || !isHeadRequest(context.request())) { return context.exception(); } String message = context.exception().getMessage(); S3Exception exception = (S3Exception) (context.exception()); String requestIdFromHeader = exception.awsErrorDetails() .sdkHttpResponse() .firstMatchingHeader("x-amz-request-id") .orElse(null); String requestId = Optional.ofNullable(exception.requestId()).orElse(requestIdFromHeader); AwsErrorDetails errorDetails = exception.awsErrorDetails(); if (context.request() instanceof HeadObjectRequest) { return NoSuchKeyException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchKey", "The specified key does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } if (context.request() instanceof HeadBucketRequest) { return NoSuchBucketException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchBucket", "The specified bucket does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } return context.exception(); } }
ExceptionTranslationInterceptor implements ExecutionInterceptor { @Override public Throwable modifyException(Context.FailedExecution context, ExecutionAttributes executionAttributes) { if (!isS3Exception404(context.exception()) || !isHeadRequest(context.request())) { return context.exception(); } String message = context.exception().getMessage(); S3Exception exception = (S3Exception) (context.exception()); String requestIdFromHeader = exception.awsErrorDetails() .sdkHttpResponse() .firstMatchingHeader("x-amz-request-id") .orElse(null); String requestId = Optional.ofNullable(exception.requestId()).orElse(requestIdFromHeader); AwsErrorDetails errorDetails = exception.awsErrorDetails(); if (context.request() instanceof HeadObjectRequest) { return NoSuchKeyException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchKey", "The specified key does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } if (context.request() instanceof HeadBucketRequest) { return NoSuchBucketException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchBucket", "The specified bucket does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } return context.exception(); } @Override Throwable modifyException(Context.FailedExecution context, ExecutionAttributes executionAttributes); }
ExceptionTranslationInterceptor implements ExecutionInterceptor { @Override public Throwable modifyException(Context.FailedExecution context, ExecutionAttributes executionAttributes) { if (!isS3Exception404(context.exception()) || !isHeadRequest(context.request())) { return context.exception(); } String message = context.exception().getMessage(); S3Exception exception = (S3Exception) (context.exception()); String requestIdFromHeader = exception.awsErrorDetails() .sdkHttpResponse() .firstMatchingHeader("x-amz-request-id") .orElse(null); String requestId = Optional.ofNullable(exception.requestId()).orElse(requestIdFromHeader); AwsErrorDetails errorDetails = exception.awsErrorDetails(); if (context.request() instanceof HeadObjectRequest) { return NoSuchKeyException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchKey", "The specified key does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } if (context.request() instanceof HeadBucketRequest) { return NoSuchBucketException.builder() .awsErrorDetails(fillErrorDetails(errorDetails, "NoSuchBucket", "The specified bucket does not exist.")) .statusCode(404) .requestId(requestId) .message(message) .build(); } return context.exception(); } @Override Throwable modifyException(Context.FailedExecution context, ExecutionAttributes executionAttributes); }
@Test public void documentImmutable_map_correctlyMapsImmutableAttributes() { ImmutableTableSchema<DocumentImmutable> documentImmutableTableSchema = ImmutableTableSchema.create(DocumentImmutable.class); AbstractImmutable abstractImmutable1 = AbstractImmutable.builder().attribute2("two").build(); AbstractImmutable abstractImmutable2 = AbstractImmutable.builder().attribute2("three").build(); Map<String, AbstractImmutable> abstractImmutableMap = new HashMap<>(); abstractImmutableMap.put("key1", abstractImmutable1); abstractImmutableMap.put("key2", abstractImmutable2); DocumentImmutable documentImmutable = DocumentImmutable.builder() .id("id-value") .attribute1("one") .abstractImmutableMap(abstractImmutableMap) .build(); AttributeValue expectedDocument1 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("two"))) .build(); AttributeValue expectedDocument2 = AttributeValue.builder() .m(singletonMap("attribute2", stringValue("three"))) .build(); Map<String, AttributeValue> expectedAttributeValueMap = new HashMap<>(); expectedAttributeValueMap.put("key1", expectedDocument1); expectedAttributeValueMap.put("key2", expectedDocument2); AttributeValue expectedMap = AttributeValue.builder().m(expectedAttributeValueMap).build(); Map<String, AttributeValue> itemMap = documentImmutableTableSchema.itemToMap(documentImmutable, true); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("abstractImmutableMap", expectedMap)); }
public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); static ImmutableTableSchema<T> create(Class<T> immutableClass); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); static ImmutableTableSchema<T> create(Class<T> immutableClass); }
@Test public void dynamoDbFlatten_correctlyFlattensBeanAttributes() { ImmutableTableSchema<FlattenedBeanImmutable> tableSchema = ImmutableTableSchema.create(FlattenedBeanImmutable.class); AbstractBean abstractBean = new AbstractBean(); abstractBean.setAttribute2("two"); FlattenedBeanImmutable flattenedBeanImmutable = new FlattenedBeanImmutable.Builder().setId("id-value") .setAttribute1("one") .setAbstractBean(abstractBean) .build(); Map<String, AttributeValue> itemMap = tableSchema.itemToMap(flattenedBeanImmutable, false); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("attribute2", stringValue("two"))); }
public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); static ImmutableTableSchema<T> create(Class<T> immutableClass); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); static ImmutableTableSchema<T> create(Class<T> immutableClass); }
@Test public void dynamoDbFlatten_correctlyFlattensImmutableAttributes() { ImmutableTableSchema<FlattenedImmutableImmutable> tableSchema = ImmutableTableSchema.create(FlattenedImmutableImmutable.class); AbstractImmutable abstractImmutable = AbstractImmutable.builder().attribute2("two").build(); FlattenedImmutableImmutable FlattenedImmutableImmutable = new FlattenedImmutableImmutable.Builder().setId("id-value") .setAttribute1("one") .setAbstractImmutable(abstractImmutable) .build(); Map<String, AttributeValue> itemMap = tableSchema.itemToMap(FlattenedImmutableImmutable, false); assertThat(itemMap.size(), is(3)); assertThat(itemMap, hasEntry("id", stringValue("id-value"))); assertThat(itemMap, hasEntry("attribute1", stringValue("one"))); assertThat(itemMap, hasEntry("attribute2", stringValue("two"))); }
public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); static ImmutableTableSchema<T> create(Class<T> immutableClass); }
ImmutableTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, ?>> { public static <T> ImmutableTableSchema<T> create(Class<T> immutableClass) { return create(immutableClass, new MetaTableSchemaCache()); } private ImmutableTableSchema(StaticImmutableTableSchema<T, ?> wrappedTableSchema); static ImmutableTableSchema<T> create(Class<T> immutableClass); }
@Test public void itemToMap_omitsNullAttributes() { FakeMappedItem fakeMappedItemWithNulls = FakeMappedItem.builder().aPrimitiveBoolean(true).build(); Map<String, AttributeValue> attributeMap = createSimpleTableSchema().itemToMap(fakeMappedItemWithNulls, true); assertThat(attributeMap.size(), is(1)); assertThat(attributeMap, hasEntry("a_primitive_boolean", ATTRIBUTE_VALUE_B)); }
public static <T> Builder<T> builder(Class<T> itemClass) { return new Builder<>(itemClass); }
StaticTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, T>> { public static <T> Builder<T> builder(Class<T> itemClass) { return new Builder<>(itemClass); } }
StaticTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, T>> { public static <T> Builder<T> builder(Class<T> itemClass) { return new Builder<>(itemClass); } private StaticTableSchema(Builder<T> builder); }
StaticTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, T>> { public static <T> Builder<T> builder(Class<T> itemClass) { return new Builder<>(itemClass); } private StaticTableSchema(Builder<T> builder); static Builder<T> builder(Class<T> itemClass); AttributeConverterProvider attributeConverterProvider(); }
StaticTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, T>> { public static <T> Builder<T> builder(Class<T> itemClass) { return new Builder<>(itemClass); } private StaticTableSchema(Builder<T> builder); static Builder<T> builder(Class<T> itemClass); AttributeConverterProvider attributeConverterProvider(); }
@Test public void mapperCanHandleEnum() { verifyNullableAttribute(EnhancedType.of(FakeMappedItem.TestEnum.class), a -> a.name("value") .getter(FakeMappedItem::getTestEnum) .setter(FakeMappedItem::setTestEnum), FakeMappedItem.builder().testEnum(FakeMappedItem.TestEnum.ONE).build(), AttributeValue.builder().s("ONE").build()); }
public static <T> Builder<T> builder(Class<T> itemClass) { return new Builder<>(itemClass); }
StaticTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, T>> { public static <T> Builder<T> builder(Class<T> itemClass) { return new Builder<>(itemClass); } }
StaticTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, T>> { public static <T> Builder<T> builder(Class<T> itemClass) { return new Builder<>(itemClass); } private StaticTableSchema(Builder<T> builder); }
StaticTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, T>> { public static <T> Builder<T> builder(Class<T> itemClass) { return new Builder<>(itemClass); } private StaticTableSchema(Builder<T> builder); static Builder<T> builder(Class<T> itemClass); AttributeConverterProvider attributeConverterProvider(); }
StaticTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, T>> { public static <T> Builder<T> builder(Class<T> itemClass) { return new Builder<>(itemClass); } private StaticTableSchema(Builder<T> builder); static Builder<T> builder(Class<T> itemClass); AttributeConverterProvider attributeConverterProvider(); }
@Test public void mapperCanHandleDocument() { FakeDocument fakeDocument = FakeDocument.of("test-123", 123); Map<String, AttributeValue> expectedMap = new HashMap<>(); expectedMap.put("documentInteger", AttributeValue.builder().n("123").build()); expectedMap.put("documentString", AttributeValue.builder().s("test-123").build()); verifyNullableAttribute(EnhancedType.documentOf(FakeDocument.class, FAKE_DOCUMENT_TABLE_SCHEMA), a -> a.name("value") .getter(FakeMappedItem::getAFakeDocument) .setter(FakeMappedItem::setAFakeDocument), FakeMappedItem.builder().aFakeDocument(fakeDocument).build(), AttributeValue.builder().m(expectedMap).build()); }
public static <T> Builder<T> builder(Class<T> itemClass) { return new Builder<>(itemClass); }
StaticTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, T>> { public static <T> Builder<T> builder(Class<T> itemClass) { return new Builder<>(itemClass); } }
StaticTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, T>> { public static <T> Builder<T> builder(Class<T> itemClass) { return new Builder<>(itemClass); } private StaticTableSchema(Builder<T> builder); }
StaticTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, T>> { public static <T> Builder<T> builder(Class<T> itemClass) { return new Builder<>(itemClass); } private StaticTableSchema(Builder<T> builder); static Builder<T> builder(Class<T> itemClass); AttributeConverterProvider attributeConverterProvider(); }
StaticTableSchema extends WrappedTableSchema<T, StaticImmutableTableSchema<T, T>> { public static <T> Builder<T> builder(Class<T> itemClass) { return new Builder<>(itemClass); } private StaticTableSchema(Builder<T> builder); static Builder<T> builder(Class<T> itemClass); AttributeConverterProvider attributeConverterProvider(); }