Skip to content

Commit b2c63c9

Browse files
author
Ben McLean
committed
Added documentation to response
1 parent b3c8f1c commit b2c63c9

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

src/au/com/origma/perspectiveapi/v1alpha1/models/AnalyzeCommentResponse.java

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,28 @@
99
import java.util.List;
1010
import java.util.Map;
1111

12+
/**
13+
* The response of an analysis
14+
*
15+
* @author Ben McLean <ben@origma.com.au>
16+
*
17+
*/
1218
public class AnalyzeCommentResponse {
1319

1420
Map<AttributeType, AttributeScore> attributeScores;
1521
List<String> languages;
1622
String clientToken;
1723

24+
/**
25+
* Create a new empty instance
26+
*/
1827
public AnalyzeCommentResponse() {
1928
super();
2029
}
2130

31+
/**
32+
* Create a new instance
33+
*/
2234
public AnalyzeCommentResponse(Map<AttributeType, AttributeScore> attributeScores, List<String> languages,
2335
String clientToken) {
2436
super();
@@ -27,30 +39,59 @@ public AnalyzeCommentResponse(Map<AttributeType, AttributeScore> attributeScores
2739
this.clientToken = clientToken;
2840
}
2941

42+
/**
43+
* Returns the scores of the requested attributes
44+
* @return the scores of the requested attributes
45+
*/
3046
public Map<AttributeType, AttributeScore> getAttributeScores() {
3147
return attributeScores;
3248
}
3349

50+
/**
51+
* Returns a specific attribute score
52+
* @param type The attribute for which a score should be returned
53+
* @return a specific attribute score
54+
*/
3455
public AttributeScore getAttributeScore(AttributeType type){
3556
return attributeScores.get(type);
3657
}
3758

59+
/**
60+
* Sets the attribute scores
61+
* @param attributeScores the attribute scores
62+
*/
3863
public void setAttributeScores(Map<AttributeType, AttributeScore> attributeScores) {
3964
this.attributeScores = attributeScores;
4065
}
4166

67+
/**
68+
* Gets the languages the request was in
69+
* @return the languages the request was in
70+
*/
4271
public List<String> getLanguages() {
4372
return languages;
4473
}
4574

75+
/**
76+
* Sets the languages the request was in
77+
* @param languages the languages the request was in
78+
*/
4679
public void setLanguages(List<String> languages) {
4780
this.languages = languages;
4881
}
4982

83+
/**
84+
* Gets the client token
85+
* @return the client token
86+
*/
5087
public String getClientToken() {
5188
return clientToken;
5289
}
5390

91+
/**
92+
* Sets the client token
93+
* @param clientToken the client token
94+
*/
5495
public void setClientToken(String clientToken) {
5596
this.clientToken = clientToken;
5697
}

0 commit comments

Comments
 (0)