Java용 SDK 버전 1과 버전 2의 Fluent setter 차이점 - AWS SDK for Java 2.x

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

Java용 SDK 버전 1과 버전 2의 Fluent setter 차이점

V1용 DynamoDB 매핑 API에서 유창한 설정자와 버전 2.30.29 이후 V2에서 POJOs를 사용할 수 있습니다.

예를 들어 다음 POJO는 setName 메서드에서 Customer 인스턴스를 반환합니다.

// V1 @DynamoDBTable(tableName ="Customer") public class Customer{ private String name; // Other attributes and methods not shown. public Customer setName(String name){ this.name = name; return this; } }

그러나 2.30.29 이전의 V2 버전을 사용하는 경우는 name 값이 인 Customer 인스턴스를 setName 반환합니다null.

// V2 prior to version 2.30.29. @DynamoDbBean public class Customer{ private String name; // Other attributes and methods not shown. public Customer setName(String name){ this.name = name; return this; // Bug: returns this instance with a `name` value of `null`. } }
// Available in V2 since version 2.30.29. @DynamoDbBean public class Customer{ private String name; // Other attributes and methods not shown. public Customer setName(String name){ this.name = name; return this; // Returns this instance for method chaining with the `name` value set. } }