1 package edu.memphis.iis.demosurvey;
2
3 import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAttribute;
4 import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey;
5 import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBIgnore;
6 import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable;
7
8
9
10
11 @DynamoDBTable(tableName="Survey")
12 public class Survey {
13 protected String participantCode;
14 protected String favoriteDogBreed;
15 protected boolean catLover;
16 protected int favoriteNumber;
17
18 public Survey() {
19
20 }
21
22
23
24
25
26
27 @DynamoDBIgnore
28 public boolean isValid() {
29 if (Utils.isBlankString(participantCode)) {
30 return false;
31 }
32 return true;
33 }
34
35 @DynamoDBHashKey(attributeName="participantCode")
36 public String getParticipantCode() {
37 return participantCode;
38 }
39 public void setParticipantCode(String participantCode) {
40 this.participantCode = participantCode;
41 }
42
43 @DynamoDBAttribute(attributeName="favoriteDogBreed")
44 public String getFavoriteDogBreed() {
45 return favoriteDogBreed;
46 }
47 public void setFavoriteDogBreed(String favoriteDogBreed) {
48 this.favoriteDogBreed = favoriteDogBreed;
49 }
50
51 @DynamoDBAttribute(attributeName="catLover")
52 public boolean isCatLover() {
53 return catLover;
54 }
55 public void setCatLover(boolean catLover) {
56 this.catLover = catLover;
57 }
58
59 @DynamoDBAttribute(attributeName="favoriteNumber")
60 public int getFavoriteNumber() {
61 return favoriteNumber;
62 }
63 public void setFavoriteNumber(int favoriteNumber) {
64 this.favoriteNumber = favoriteNumber;
65 }
66 }