Skip to content

Commit 95a3408

Browse files
committed
update
1 parent 7220c5a commit 95a3408

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

aws-dynamodb/src/main/java/com/formkiq/aws/dynamodb/AttributeValueToMap.java

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
import java.util.function.Function;
2929
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
3030

31-
import static com.formkiq.aws.dynamodb.objects.Strings.isEmpty;
32-
3331
/**
3432
* Convert {@link Map} {@link AttributeValue} to {@link Map}.
3533
*
@@ -54,25 +52,15 @@ public Map<String, Object> apply(final Map<String, AttributeValue> map) {
5452
}
5553

5654
private Object convert(final AttributeValue val) {
57-
Object obj = null;
55+
Object obj;
5856

5957
switch (val.type()) {
60-
case S -> {
61-
obj = val.s();
62-
}
63-
case N -> {
64-
obj = val.n();
65-
}
66-
case BOOL -> {
67-
obj = val.b();
68-
}
69-
case L -> {
70-
obj = val.l().stream().map(this::convert).toList();
71-
}
72-
default -> {
73-
throw new IllegalArgumentException(
74-
"Unsupported attribute value map conversion " + val.type());
75-
}
58+
case S -> obj = val.s();
59+
case N -> obj = val.n();
60+
case BOOL -> obj = val.b();
61+
case L -> obj = val.l().stream().map(this::convert).toList();
62+
default -> throw new IllegalArgumentException(
63+
"Unsupported attribute value map conversion " + val.type());
7664
}
7765

7866
return obj;

0 commit comments

Comments
 (0)