Skip to content

Commit b2da66d

Browse files
committed
feat(Compare and Comply): Add Contexts and TableTitle models
1 parent b3675fd commit b2da66d

File tree

3 files changed

+134
-13
lines changed

3 files changed

+134
-13
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright 2018 IBM Corp. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
package com.ibm.watson.compare_comply.v1.model;
14+
15+
import com.ibm.cloud.sdk.core.service.model.GenericModel;
16+
17+
/**
18+
* Text that is related to the contents of the table and that precedes or follows the current table.
19+
*/
20+
public class Contexts extends GenericModel {
21+
22+
private String text;
23+
private Location location;
24+
25+
/**
26+
* Gets the text.
27+
*
28+
* The related text.
29+
*
30+
* @return the text
31+
*/
32+
public String getText() {
33+
return text;
34+
}
35+
36+
/**
37+
* Gets the location.
38+
*
39+
* The numeric location of the identified element in the document, represented with two integers labeled `begin` and
40+
* `end`.
41+
*
42+
* @return the location
43+
*/
44+
public Location getLocation() {
45+
return location;
46+
}
47+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Copyright 2018 IBM Corp. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
package com.ibm.watson.compare_comply.v1.model;
14+
15+
import com.ibm.cloud.sdk.core.service.model.GenericModel;
16+
17+
/**
18+
* If identified, the title or caption of the current table of the form `Table x.: ...`. Empty when no title is
19+
* identified. When exposed, the `title` is also excluded from the `contexts` array of the same table.
20+
*/
21+
public class TableTitle extends GenericModel {
22+
23+
private Location location;
24+
private String text;
25+
26+
/**
27+
* Gets the location.
28+
*
29+
* The numeric location of the identified element in the document, represented with two integers labeled `begin` and
30+
* `end`.
31+
*
32+
* @return the location
33+
*/
34+
public Location getLocation() {
35+
return location;
36+
}
37+
38+
/**
39+
* Gets the text.
40+
*
41+
* The text of the identified table title or caption.
42+
*
43+
* @return the text
44+
*/
45+
public String getText() {
46+
return text;
47+
}
48+
}

compare-comply/src/main/java/com/ibm/watson/compare_comply/v1/model/Tables.java

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,18 @@ public class Tables extends GenericModel {
2626
private String text;
2727
@SerializedName("section_title")
2828
private SectionTitle sectionTitle;
29+
private TableTitle title;
2930
@SerializedName("table_headers")
3031
private List<TableHeaders> tableHeaders;
3132
@SerializedName("row_headers")
3233
private List<RowHeaders> rowHeaders;
3334
@SerializedName("column_headers")
3435
private List<ColumnHeaders> columnHeaders;
35-
@SerializedName("key_value_pairs")
36-
private List<KeyValuePair> keyValuePairs;
3736
@SerializedName("body_cells")
3837
private List<BodyCells> bodyCells;
38+
private List<Contexts> contexts;
39+
@SerializedName("key_value_pairs")
40+
private List<KeyValuePair> keyValuePairs;
3941

4042
/**
4143
* Gets the location.
@@ -71,6 +73,18 @@ public SectionTitle getSectionTitle() {
7173
return sectionTitle;
7274
}
7375

76+
/**
77+
* Gets the title.
78+
*
79+
* If identified, the title or caption of the current table of the form `Table x.: ...`. Empty when no title is
80+
* identified. When exposed, the `title` is also excluded from the `contexts` array of the same table.
81+
*
82+
* @return the title
83+
*/
84+
public TableTitle getTitle() {
85+
return title;
86+
}
87+
7488
/**
7589
* Gets the tableHeaders.
7690
*
@@ -106,17 +120,6 @@ public List<ColumnHeaders> getColumnHeaders() {
106120
return columnHeaders;
107121
}
108122

109-
/**
110-
* Gets the keyValuePairs.
111-
*
112-
* An array of key-value pairs identified in the current table.
113-
*
114-
* @return the keyValuePairs
115-
*/
116-
public List<KeyValuePair> getKeyValuePairs() {
117-
return keyValuePairs;
118-
}
119-
120123
/**
121124
* Gets the bodyCells.
122125
*
@@ -128,4 +131,27 @@ public List<KeyValuePair> getKeyValuePairs() {
128131
public List<BodyCells> getBodyCells() {
129132
return bodyCells;
130133
}
134+
135+
/**
136+
* Gets the contexts.
137+
*
138+
* An array of objects that list text that is related to the table contents and that precedes or follows the current
139+
* table.
140+
*
141+
* @return the contexts
142+
*/
143+
public List<Contexts> getContexts() {
144+
return contexts;
145+
}
146+
147+
/**
148+
* Gets the keyValuePairs.
149+
*
150+
* An array of key-value pairs identified in the current table.
151+
*
152+
* @return the keyValuePairs
153+
*/
154+
public List<KeyValuePair> getKeyValuePairs() {
155+
return keyValuePairs;
156+
}
131157
}

0 commit comments

Comments
 (0)