Skip to content

Commit 1c07daf

Browse files
author
Ben McLean
committed
Added documentation to Entry
1 parent ea151f7 commit 1c07daf

File tree

2 files changed

+50
-6
lines changed

2 files changed

+50
-6
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ public List<Entry> getEntries() {
2525
return entries;
2626
}
2727

28+
/**
29+
* Builds a Context
30+
*
31+
* @author Ben McLean &lt;ben@origma.com.au&gt;
32+
*
33+
*/
2834
public static class Builder {
2935
private List<Entry> entries;
3036

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

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,88 @@
66
*/
77
package au.com.origma.perspectiveapi.v1alpha1.models;
88

9+
/**
10+
* A representation of some content or context as a String
11+
*
12+
* @author Ben McLean &lt;ben@origma.com.au&gt;
13+
*
14+
*/
915
public class Entry {
1016

1117
String text;
1218
ContentType type;
1319

20+
/**
21+
* Create an empty instance
22+
*/
1423
public Entry() {
1524
}
1625

17-
public Entry(String text, ContentType type) {
18-
super();
19-
this.text = text;
20-
this.type = type;
21-
}
22-
26+
/**
27+
* Returns the text of the entry
28+
* @return the text of the entry
29+
*/
2330
public String getText() {
2431
return text;
2532
}
2633

34+
/**
35+
* Sets the text of the entry
36+
* @param text the text of the entry
37+
*/
2738
public void setText(String text) {
2839
this.text = text;
2940
}
3041

42+
/**
43+
* Returns the type of the entry
44+
* @return the type of the entry
45+
*/
3146
public ContentType getType() {
3247
return type;
3348
}
3449

50+
/**
51+
* Sets the type of the entry
52+
* @param type the type of the entry
53+
*/
3554
public void setType(ContentType type) {
3655
this.type = type;
3756
}
3857

58+
/**
59+
* Builds an entry
60+
*
61+
* @author Ben McLean &lt;ben@origma.com.au&gt;
62+
*/
3963
public static class Builder {
4064
private String text;
4165
private ContentType type;
4266

67+
/**
68+
* Sets the text of the entry
69+
* @param text the text of the entry
70+
* @return The builder
71+
*/
4372
public Builder text(String text) {
4473
this.text = text;
4574
return this;
4675
}
4776

77+
/**
78+
* Sets the type of the entry
79+
* @param type the type of the entry
80+
* @return The builder
81+
*/
4882
public Builder type(ContentType type) {
4983
this.type = type;
5084
return this;
5185
}
5286

87+
/**
88+
* Returns a new instance of Entry
89+
* @return a new instance of Entry
90+
*/
5391
public Entry build() {
5492
return new Entry(this);
5593
}

0 commit comments

Comments
 (0)