Skip to content

Commit 91788e2

Browse files
committed
Dynamodb-enhanced [preview]: small fix to a misnaming of a couple of Attributes made during a recent naming refactor
1 parent c6aa961 commit 91788e2

File tree

2 files changed

+50
-51
lines changed
  • services-custom/dynamodb-enhanced/src

2 files changed

+50
-51
lines changed

services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/extensions/dynamodb/mappingclient/staticmapper/Attributes.java

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ private Attributes() {
3333
}
3434

3535
public static <T> AttributeSupplier<T> binaryAttribute(String attributeName,
36-
Function<T, ByteBuffer> getAttributeMethod,
37-
BiConsumer<T, ByteBuffer> updateItemMethod) {
36+
Function<T, ByteBuffer> getAttributeMethod,
37+
BiConsumer<T, ByteBuffer> updateItemMethod) {
3838
return Attribute.create(
3939
attributeName,
4040
getAttributeMethod,
4141
updateItemMethod,
4242
AttributeTypes.binaryType());
4343
}
4444

45-
public static <T> AttributeSupplier<T> binaryAttributeSet(String attributeName,
46-
Function<T, Set<ByteBuffer>> getAttributeMethod,
47-
BiConsumer<T, Set<ByteBuffer>> updateItemMethod) {
45+
public static <T> AttributeSupplier<T> binarySetAttribute(String attributeName,
46+
Function<T, Set<ByteBuffer>> getAttributeMethod,
47+
BiConsumer<T, Set<ByteBuffer>> updateItemMethod) {
4848
return Attribute.create(
4949
attributeName,
5050
getAttributeMethod,
@@ -53,8 +53,8 @@ public static <T> AttributeSupplier<T> binaryAttributeSet(String attributeName,
5353
}
5454

5555
public static <T> AttributeSupplier<T> boolAttribute(String attributeName,
56-
Function<T, Boolean> getAttributeMethod,
57-
BiConsumer<T, Boolean> updateItemMethod) {
56+
Function<T, Boolean> getAttributeMethod,
57+
BiConsumer<T, Boolean> updateItemMethod) {
5858
return Attribute.create(
5959
attributeName,
6060
getAttributeMethod,
@@ -63,18 +63,18 @@ public static <T> AttributeSupplier<T> boolAttribute(String attributeName,
6363
}
6464

6565
public static <T> AttributeSupplier<T> stringAttribute(String attributeName,
66-
Function<T, String> getAttributeMethod,
67-
BiConsumer<T, String> updateItemMethod) {
66+
Function<T, String> getAttributeMethod,
67+
BiConsumer<T, String> updateItemMethod) {
6868
return Attribute.create(
6969
attributeName,
7070
getAttributeMethod,
7171
updateItemMethod,
7272
AttributeTypes.stringType());
7373
}
7474

75-
public static <T> AttributeSupplier<T> stringAttributeSet(String attributeName,
76-
Function<T, Set<String>> getAttributeMethod,
77-
BiConsumer<T, Set<String>> updateItemMethod) {
75+
public static <T> AttributeSupplier<T> stringSetAttribute(String attributeName,
76+
Function<T, Set<String>> getAttributeMethod,
77+
BiConsumer<T, Set<String>> updateItemMethod) {
7878
return Attribute.create(
7979
attributeName,
8080
getAttributeMethod,
@@ -83,8 +83,8 @@ public static <T> AttributeSupplier<T> stringAttributeSet(String attributeName,
8383
}
8484

8585
public static <T> AttributeSupplier<T> integerNumberAttribute(String attributeName,
86-
Function<T, Integer> getAttributeMethod,
87-
BiConsumer<T, Integer> updateItemMethod) {
86+
Function<T, Integer> getAttributeMethod,
87+
BiConsumer<T, Integer> updateItemMethod) {
8888
return Attribute.create(
8989
attributeName,
9090
getAttributeMethod,
@@ -93,8 +93,8 @@ public static <T> AttributeSupplier<T> integerNumberAttribute(String attributeNa
9393
}
9494

9595
public static <T> AttributeSupplier<T> longNumberAttribute(String attributeName,
96-
Function<T, Long> getAttributeMethod,
97-
BiConsumer<T, Long> updateItemMethod) {
96+
Function<T, Long> getAttributeMethod,
97+
BiConsumer<T, Long> updateItemMethod) {
9898
return Attribute.create(
9999
attributeName,
100100
getAttributeMethod,
@@ -103,8 +103,8 @@ public static <T> AttributeSupplier<T> longNumberAttribute(String attributeName,
103103
}
104104

105105
public static <T> AttributeSupplier<T> shortNumberAttribute(String attributeName,
106-
Function<T, Short> getAttributeMethod,
107-
BiConsumer<T, Short> updateItemMethod) {
106+
Function<T, Short> getAttributeMethod,
107+
BiConsumer<T, Short> updateItemMethod) {
108108
return Attribute.create(
109109
attributeName,
110110
getAttributeMethod,
@@ -113,8 +113,8 @@ public static <T> AttributeSupplier<T> shortNumberAttribute(String attributeName
113113
}
114114

115115
public static <T> AttributeSupplier<T> doubleNumberAttribute(String attributeName,
116-
Function<T, Double> getAttributeMethod,
117-
BiConsumer<T, Double> updateItemMethod) {
116+
Function<T, Double> getAttributeMethod,
117+
BiConsumer<T, Double> updateItemMethod) {
118118
return Attribute.create(
119119
attributeName,
120120
getAttributeMethod,
@@ -123,8 +123,8 @@ public static <T> AttributeSupplier<T> doubleNumberAttribute(String attributeNam
123123
}
124124

125125
public static <T> AttributeSupplier<T> floatNumberAttribute(String attributeName,
126-
Function<T, Float> getAttributeMethod,
127-
BiConsumer<T, Float> updateItemMethod) {
126+
Function<T, Float> getAttributeMethod,
127+
BiConsumer<T, Float> updateItemMethod) {
128128
return Attribute.create(
129129
attributeName,
130130
getAttributeMethod,
@@ -133,8 +133,8 @@ public static <T> AttributeSupplier<T> floatNumberAttribute(String attributeName
133133
}
134134

135135
public static <T> AttributeSupplier<T> byteNumberAttribute(String attributeName,
136-
Function<T, Byte> getAttributeMethod,
137-
BiConsumer<T, Byte> updateItemMethod) {
136+
Function<T, Byte> getAttributeMethod,
137+
BiConsumer<T, Byte> updateItemMethod) {
138138
return Attribute.create(
139139
attributeName,
140140
getAttributeMethod,
@@ -143,8 +143,8 @@ public static <T> AttributeSupplier<T> byteNumberAttribute(String attributeName,
143143
}
144144

145145
public static <T> AttributeSupplier<T> integerSetAttribute(String attributeName,
146-
Function<T, Set<Integer>> getAttributeMethod,
147-
BiConsumer<T, Set<Integer>> updateItemMethod) {
146+
Function<T, Set<Integer>> getAttributeMethod,
147+
BiConsumer<T, Set<Integer>> updateItemMethod) {
148148
return Attribute.create(
149149
attributeName,
150150
getAttributeMethod,
@@ -153,8 +153,8 @@ public static <T> AttributeSupplier<T> integerSetAttribute(String attributeName,
153153
}
154154

155155
public static <T> AttributeSupplier<T> longSetAttribute(String attributeName,
156-
Function<T, Set<Long>> getAttributeMethod,
157-
BiConsumer<T, Set<Long>> updateItemMethod) {
156+
Function<T, Set<Long>> getAttributeMethod,
157+
BiConsumer<T, Set<Long>> updateItemMethod) {
158158
return Attribute.create(
159159
attributeName,
160160
getAttributeMethod,
@@ -163,8 +163,8 @@ public static <T> AttributeSupplier<T> longSetAttribute(String attributeName,
163163
}
164164

165165
public static <T> AttributeSupplier<T> shortSetAttribute(String attributeName,
166-
Function<T, Set<Short>> getAttributeMethod,
167-
BiConsumer<T, Set<Short>> updateItemMethod) {
166+
Function<T, Set<Short>> getAttributeMethod,
167+
BiConsumer<T, Set<Short>> updateItemMethod) {
168168
return Attribute.create(
169169
attributeName,
170170
getAttributeMethod,
@@ -173,8 +173,8 @@ public static <T> AttributeSupplier<T> shortSetAttribute(String attributeName,
173173
}
174174

175175
public static <T> AttributeSupplier<T> doubleSetAttribute(String attributeName,
176-
Function<T, Set<Double>> getAttributeMethod,
177-
BiConsumer<T, Set<Double>> updateItemMethod) {
176+
Function<T, Set<Double>> getAttributeMethod,
177+
BiConsumer<T, Set<Double>> updateItemMethod) {
178178
return Attribute.create(
179179
attributeName,
180180
getAttributeMethod,
@@ -183,8 +183,8 @@ public static <T> AttributeSupplier<T> doubleSetAttribute(String attributeName,
183183
}
184184

185185
public static <T> AttributeSupplier<T> floatSetAttribute(String attributeName,
186-
Function<T, Set<Float>> getAttributeMethod,
187-
BiConsumer<T, Set<Float>> updateItemMethod) {
186+
Function<T, Set<Float>> getAttributeMethod,
187+
BiConsumer<T, Set<Float>> updateItemMethod) {
188188
return Attribute.create(
189189
attributeName,
190190
getAttributeMethod,
@@ -193,8 +193,8 @@ public static <T> AttributeSupplier<T> floatSetAttribute(String attributeName,
193193
}
194194

195195
public static <T> AttributeSupplier<T> byteSetAttribute(String attributeName,
196-
Function<T, Set<Byte>> getAttributeMethod,
197-
BiConsumer<T, Set<Byte>> updateItemMethod) {
196+
Function<T, Set<Byte>> getAttributeMethod,
197+
BiConsumer<T, Set<Byte>> updateItemMethod) {
198198
return Attribute.create(
199199
attributeName,
200200
getAttributeMethod,
@@ -203,9 +203,9 @@ public static <T> AttributeSupplier<T> byteSetAttribute(String attributeName,
203203
}
204204

205205
public static <T, K> AttributeSupplier<T> documentMapAttribute(String attributeName,
206-
Function<T, K> getAttributeMethod,
207-
BiConsumer<T, K> updateItemMethod,
208-
TableSchema<K> documentSchema) {
206+
Function<T, K> getAttributeMethod,
207+
BiConsumer<T, K> updateItemMethod,
208+
TableSchema<K> documentSchema) {
209209
return Attribute.create(
210210
attributeName,
211211
getAttributeMethod,
@@ -214,9 +214,9 @@ public static <T, K> AttributeSupplier<T> documentMapAttribute(String attributeN
214214
}
215215

216216
public static <T, K> AttributeSupplier<T> mapAttribute(String attributeName,
217-
Function<T, Map<String, K>> getAttributeMethod,
218-
BiConsumer<T, Map<String, K>> updateItemMethod,
219-
AttributeType<K> mappedValueType) {
217+
Function<T, Map<String, K>> getAttributeMethod,
218+
BiConsumer<T, Map<String, K>> updateItemMethod,
219+
AttributeType<K> mappedValueType) {
220220
return Attribute.create(
221221
attributeName,
222222
getAttributeMethod,
@@ -225,9 +225,9 @@ public static <T, K> AttributeSupplier<T> mapAttribute(String attributeName,
225225
}
226226

227227
public static <T, K> AttributeSupplier<T> listAttribute(String attributeName,
228-
Function<T, List<K>> getAttributeMethod,
229-
BiConsumer<T, List<K>> updateItemMethod,
230-
AttributeType<K> listElementsType) {
228+
Function<T, List<K>> getAttributeMethod,
229+
BiConsumer<T, List<K>> updateItemMethod,
230+
AttributeType<K> listElementsType) {
231231
return Attribute.create(
232232
attributeName,
233233
getAttributeMethod,

services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/extensions/dynamodb/mappingclient/staticmapper/StaticTableSchemaTest.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848

4949
import software.amazon.awssdk.core.SdkBytes;
5050
import software.amazon.awssdk.extensions.dynamodb.mappingclient.TableMetadata;
51-
import software.amazon.awssdk.extensions.dynamodb.mappingclient.TableSchema;
5251
import software.amazon.awssdk.extensions.dynamodb.mappingclient.staticmapper.Attribute.AttributeSupplier;
5352
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
5453
import software.amazon.awssdk.extensions.dynamodb.mappingclient.functionaltests.models.FakeItem;
@@ -980,8 +979,8 @@ public void mapperCanHandleStringSet() {
980979
Set<String> valueSet = new HashSet<>(asList("one", "two", "three"));
981980
List<String> expectedList = valueSet.stream().map(Objects::toString).collect(toList());
982981

983-
verifyNullableAttribute(Attributes.stringAttributeSet("value", FakeMappedItem::getAStringSet,
984-
FakeMappedItem::setAStringSet),
982+
verifyNullableAttribute(Attributes.stringSetAttribute("value", FakeMappedItem::getAStringSet,
983+
FakeMappedItem::setAStringSet),
985984
FakeMappedItem.builder().aStringSet(valueSet).build(),
986985
AttributeValue.builder().ss(expectedList).build());
987986
}
@@ -1047,9 +1046,9 @@ public void mapperCanHandleByteBufferSet() {
10471046
Set<ByteBuffer> byteBuffer = new HashSet<>(asList(byteBuffer1, byteBuffer2, byteBuffer3));
10481047
List<SdkBytes> sdkBytes = byteBuffer.stream().map(SdkBytes::fromByteBuffer).collect(toList());
10491048

1050-
verifyNullableAttribute(Attributes.binaryAttributeSet("value",
1051-
FakeMappedItem::getAByteBufferSet,
1052-
FakeMappedItem::setAByteBufferSet),
1049+
verifyNullableAttribute(Attributes.binarySetAttribute("value",
1050+
FakeMappedItem::getAByteBufferSet,
1051+
FakeMappedItem::setAByteBufferSet),
10531052
FakeMappedItem.builder().aByteBufferSet(byteBuffer).build(),
10541053
AttributeValue.builder().bs(sdkBytes).build());
10551054
}

0 commit comments

Comments
 (0)