1212 */
1313package com .ibm .watson .developer_cloud .assistant .v1 .model ;
1414
15- import java .lang .reflect .Type ;
16-
17- import com .google .gson .reflect .TypeToken ;
18- import com .ibm .watson .developer_cloud .service .model .DynamicModel ;
19- import com .ibm .watson .developer_cloud .util .GsonSerializationHelper ;
15+ import com .ibm .watson .developer_cloud .service .model .GenericModel ;
2016import com .ibm .watson .developer_cloud .util .Validator ;
2117
2218/**
2319 * An input object that includes the input text.
2420 */
25- public class InputData extends DynamicModel {
26- private Type textType = new TypeToken <String >() {
27- }.getType ();
28-
29- /**
30- * Gets the text.
31- *
32- * @return the text
33- */
34- public String text () {
35- return GsonSerializationHelper .serializeDynamicModelProperty (this .get ("text" ), textType );
36- }
21+ public class InputData extends GenericModel {
3722
38- /**
39- * Sets the text.
40- *
41- * @param text the new text
42- */
43- public void setText (final String text ) {
44- this .put ("text" , text );
45- }
23+ private String text ;
4624
4725 /**
4826 * Builder.
@@ -51,7 +29,7 @@ public static class Builder {
5129 private String text ;
5230
5331 private Builder (InputData inputData ) {
54- text = inputData .text () ;
32+ text = inputData .text ;
5533 }
5634
5735 /**
@@ -92,6 +70,27 @@ public Builder text(String text) {
9270
9371 private InputData (Builder builder ) {
9472 Validator .notNull (builder .text , "text cannot be null" );
95- setText (builder .text );
73+ text = builder .text ;
74+ }
75+
76+ /**
77+ * New builder.
78+ *
79+ * @return a InputData builder
80+ */
81+ public Builder newBuilder () {
82+ return new Builder (this );
83+ }
84+
85+ /**
86+ * Gets the text.
87+ *
88+ * The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be
89+ * no longer than 2048 characters.
90+ *
91+ * @return the text
92+ */
93+ public String text () {
94+ return text ;
9695 }
9796}
0 commit comments