AttributeValue attributeValue = AttributeValue.builder()
.ss("John", "Doe")
.build();
Set stringSet = attributeValue.toStringSet();
String[] stringArray = stringSet.toArray(new String[0]);
System.out.println(Arrays.toString(stringArray)); // [John, Doe]
String[] stringArray = {"John", "Doe"};
Set stringSet = new HashSet<>(Arrays.asList(stringArray));
AttributeValue attributeValue = AttributeValue.builder()
.ss(stringSet)
.build();
System.out.println(attributeValue); // {"SS": ["John", "Doe"]}
上一篇:AWSDynamoDB:为什么“KeysOnly”投影不包括表的排序键?
下一篇:AWSDynamo数据类型:AttributeValue.wrap()将类型转换为SS(StringSet)而不是String[]。