Skip to content

Commit

Permalink
feat(Compare and Comply): Add Contexts and TableTitle models
Browse files Browse the repository at this point in the history
  • Loading branch information
lpatino10 committed Jul 23, 2019
1 parent b3675fd commit b2da66d
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright 2018 IBM Corp. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.ibm.watson.compare_comply.v1.model;

import com.ibm.cloud.sdk.core.service.model.GenericModel;

/**
* Text that is related to the contents of the table and that precedes or follows the current table.
*/
public class Contexts extends GenericModel {

private String text;
private Location location;

/**
* Gets the text.
*
* The related text.
*
* @return the text
*/
public String getText() {
return text;
}

/**
* Gets the location.
*
* The numeric location of the identified element in the document, represented with two integers labeled `begin` and
* `end`.
*
* @return the location
*/
public Location getLocation() {
return location;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright 2018 IBM Corp. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.ibm.watson.compare_comply.v1.model;

import com.ibm.cloud.sdk.core.service.model.GenericModel;

/**
* If identified, the title or caption of the current table of the form `Table x.: ...`. Empty when no title is
* identified. When exposed, the `title` is also excluded from the `contexts` array of the same table.
*/
public class TableTitle extends GenericModel {

private Location location;
private String text;

/**
* Gets the location.
*
* The numeric location of the identified element in the document, represented with two integers labeled `begin` and
* `end`.
*
* @return the location
*/
public Location getLocation() {
return location;
}

/**
* Gets the text.
*
* The text of the identified table title or caption.
*
* @return the text
*/
public String getText() {
return text;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@ public class Tables extends GenericModel {
private String text;
@SerializedName("section_title")
private SectionTitle sectionTitle;
private TableTitle title;
@SerializedName("table_headers")
private List<TableHeaders> tableHeaders;
@SerializedName("row_headers")
private List<RowHeaders> rowHeaders;
@SerializedName("column_headers")
private List<ColumnHeaders> columnHeaders;
@SerializedName("key_value_pairs")
private List<KeyValuePair> keyValuePairs;
@SerializedName("body_cells")
private List<BodyCells> bodyCells;
private List<Contexts> contexts;
@SerializedName("key_value_pairs")
private List<KeyValuePair> keyValuePairs;

/**
* Gets the location.
Expand Down Expand Up @@ -71,6 +73,18 @@ public SectionTitle getSectionTitle() {
return sectionTitle;
}

/**
* Gets the title.
*
* If identified, the title or caption of the current table of the form `Table x.: ...`. Empty when no title is
* identified. When exposed, the `title` is also excluded from the `contexts` array of the same table.
*
* @return the title
*/
public TableTitle getTitle() {
return title;
}

/**
* Gets the tableHeaders.
*
Expand Down Expand Up @@ -106,17 +120,6 @@ public List<ColumnHeaders> getColumnHeaders() {
return columnHeaders;
}

/**
* Gets the keyValuePairs.
*
* An array of key-value pairs identified in the current table.
*
* @return the keyValuePairs
*/
public List<KeyValuePair> getKeyValuePairs() {
return keyValuePairs;
}

/**
* Gets the bodyCells.
*
Expand All @@ -128,4 +131,27 @@ public List<KeyValuePair> getKeyValuePairs() {
public List<BodyCells> getBodyCells() {
return bodyCells;
}

/**
* Gets the contexts.
*
* An array of objects that list text that is related to the table contents and that precedes or follows the current
* table.
*
* @return the contexts
*/
public List<Contexts> getContexts() {
return contexts;
}

/**
* Gets the keyValuePairs.
*
* An array of key-value pairs identified in the current table.
*
* @return the keyValuePairs
*/
public List<KeyValuePair> getKeyValuePairs() {
return keyValuePairs;
}
}

0 comments on commit b2da66d

Please sign in to comment.