GeezerVison is showing github.com — Merge branch 'master' of git://github.com/GrapeBaBa/java-sdk into pr245 · einsnull/java-sdk@c026c3a
File treeExpand file treeCollapse file tree Open diff view settings main/java/com/ibm/watson/developer_cloud natural_language_classifier/v1 relationship_extraction/v1 tradeoff_analytics/v1/model/column
test/java/com/ibm/watson/developer_cloud
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: src/main/java/com/ibm/watson/developer_cloud/alchemy/v1/AlchemyDataNews.java +8-8Lines changed: 8 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 19 | 19 | import com.ibm.watson.developer_cloud.alchemy.v1.model.VolumeResult; | 20 | 20 | import com.ibm.watson.developer_cloud.http.RequestBuilder; | 21 | 21 | import com.ibm.watson.developer_cloud.service.AlchemyService; | 22 | | -import com.ibm.watson.developer_cloud.util.Validate; | | 22 | +import com.ibm.watson.developer_cloud.util.Validator; | 23 | 23 |
| 24 | 24 | /** | 25 | 25 | * AlchemyData News indexes 250k to 300k English language news and blog articles every day with | @@ -36,12 +36,12 @@ public class AlchemyDataNews extends AlchemyService { | 36 | 36 | /** | 37 | 37 | * The TimeFormat Enumeration. | 38 | 38 | */ | 39 | | - public static enum TimeFormat { | | 39 | + public enum TimeFormat { | 40 | 40 |
| 41 | 41 | /** The Time format d. */ | 42 | 42 | d, /** The Time format h. */ | 43 | 43 | h, /** The Time format m. */ | 44 | | - m, /** The Time format m. */ | | 44 | + m, /** The Time format M. */ | 45 | 45 | M, /** The Time format now. */ | 46 | 46 | NOW, /** The Time format s. */ | 47 | 47 | s, /** The Time format y. */ | @@ -80,9 +80,9 @@ public static enum TimeFormat { | 80 | 80 | * @return the news documents | 81 | 81 | */ | 82 | 82 | public DocumentsResult getNewsDocuments(Map<String, Object> parameters) { | 83 | | - Validate.notNull(parameters.get(START), "start time cannot be null"); | 84 | | - Validate.notNull(parameters.get(END), "end time cannot be null"); | 85 | | - Validate.notNull(parameters.get(RETURN), "return cannot be null"); | | 83 | + Validator.notNull(parameters.get(START), "start time cannot be null"); | | 84 | + Validator.notNull(parameters.get(END), "end time cannot be null"); | | 85 | + Validator.notNull(parameters.get(RETURN), "return cannot be null"); | 86 | 86 |
| 87 | 87 | // Return json | 88 | 88 | parameters.put(OUTPUT_MODE, JSON); | @@ -107,8 +107,8 @@ public DocumentsResult getNewsDocuments(Map<String, Object> parameters) { | 107 | 107 | * @return {@link VolumeResult} | 108 | 108 | */ | 109 | 109 | public VolumeResult getVolume(final String start, final String end, final String timeSlice) { | 110 | | - Validate.notNull(start, "start time cannot be null"); | 111 | | - Validate.notNull(end, "end time cannot be null"); | | 110 | + Validator.notNull(start, "start time cannot be null"); | | 111 | + Validator.notNull(end, "end time cannot be null"); | 112 | 112 |
| 113 | 113 | final RequestBuilder requestBuilder = RequestBuilder.get(NEWS_END_POINT); | 114 | 114 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/main/java/com/ibm/watson/developer_cloud/alchemy/v1/AlchemyVision.java +12-12Lines changed: 12 additions & 12 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 30 | 30 | import com.ibm.watson.developer_cloud.http.HttpMediaType; | 31 | 31 | import com.ibm.watson.developer_cloud.http.RequestBuilder; | 32 | 32 | import com.ibm.watson.developer_cloud.service.AlchemyService; | 33 | | -import com.ibm.watson.developer_cloud.util.Validate; | | 33 | +import com.ibm.watson.developer_cloud.util.Validator; | 34 | 34 | import com.squareup.okhttp.RequestBody; | 35 | 35 |
| 36 | 36 | /** | @@ -130,8 +130,8 @@ private <T extends AlchemyGenericModel> T executeRequest(Map<String, Object> par | 130 | 130 | * @return {@link ImageSceneText} | 131 | 131 | */ | 132 | 132 | public ImageSceneText getImageSceneText(File image) { | 133 | | - Validate.notNull(image, "image cannot be null"); | 134 | | - Validate.isTrue(image.exists(), "image file: " + image.getAbsolutePath() + " not found"); | | 133 | + Validator.notNull(image, "image cannot be null"); | | 134 | + Validator.isTrue(image.exists(), "image file: " + image.getAbsolutePath() + " not found"); | 135 | 135 |
| 136 | 136 | final Map<String, Object> params = new HashMap<String, Object>(); | 137 | 137 | params.put(IMAGE, image); | @@ -147,7 +147,7 @@ public ImageSceneText getImageSceneText(File image) { | 147 | 147 | * @return {@link ImageSceneText} | 148 | 148 | */ | 149 | 149 | public ImageSceneText getImageSceneText(URL url) { | 150 | | - Validate.notNull(url, "url cannot be null"); | | 150 | + Validator.notNull(url, "url cannot be null"); | 151 | 151 |
| 152 | 152 | final Map<String, Object> params = new HashMap<String, Object>(); | 153 | 153 | params.put(URL, url); | @@ -164,8 +164,8 @@ public ImageSceneText getImageSceneText(URL url) { | 164 | 164 | * @return {@link ImageKeywords} | 165 | 165 | */ | 166 | 166 | public ImageKeywords getImageKeywords(File image, Boolean forceShowAll, Boolean knowledgeGraph) { | 167 | | - Validate.notNull(image, "image cannot be null"); | 168 | | - Validate.isTrue(image.exists(), "image file: " + image.getAbsolutePath() + " not found"); | | 167 | + Validator.notNull(image, "image cannot be null"); | | 168 | + Validator.isTrue(image.exists(), "image file: " + image.getAbsolutePath() + " not found"); | 169 | 169 |
| 170 | 170 | final Map<String, Object> params = new HashMap<String, Object>(); | 171 | 171 | params.put(IMAGE, image); | @@ -198,7 +198,7 @@ public ImageKeywords getImageKeywords(File image, Boolean forceShowAll, Boolean | 198 | 198 | * @return {@link ImageKeywords} | 199 | 199 | */ | 200 | 200 | public ImageKeywords getImageKeywords(URL url, Boolean forceShowAll, Boolean knowledgeGraph) { | 201 | | - Validate.notNull(url, "url cannot be null"); | | 201 | + Validator.notNull(url, "url cannot be null"); | 202 | 202 |
| 203 | 203 | final Map<String, Object> params = new HashMap<String, Object>(); | 204 | 204 | params.put(URL, url); | @@ -219,7 +219,7 @@ public ImageKeywords getImageKeywords(URL url, Boolean forceShowAll, Boolean kno | 219 | 219 | * @return {@link ImageLink} | 220 | 220 | */ | 221 | 221 | public ImageLink getImageLink(URL url) { | 222 | | - Validate.notNull(url, "url cannot be null"); | | 222 | + Validator.notNull(url, "url cannot be null"); | 223 | 223 |
| 224 | 224 | final Map<String, Object> params = new HashMap<String, Object>(); | 225 | 225 | params.put(URL, url); | @@ -234,7 +234,7 @@ public ImageLink getImageLink(URL url) { | 234 | 234 | * @return {@link ImageLink} | 235 | 235 | */ | 236 | 236 | public ImageLink getImageLink(String html) { | 237 | | - Validate.notNull(html, "html cannot be null"); | | 237 | + Validator.notNull(html, "html cannot be null"); | 238 | 238 |
| 239 | 239 | final Map<String, Object> params = new HashMap<String, Object>(); | 240 | 240 | params.put(HTML, html); | @@ -269,8 +269,8 @@ public ImageLink getImageLink(String html) { | 269 | 269 | * @return {@link ImageFaces} | 270 | 270 | */ | 271 | 271 | public ImageFaces recognizeFaces(File image, Boolean knowledgeGraph) { | 272 | | - Validate.notNull(image, "image cannot be null"); | 273 | | - Validate.isTrue(image.exists(), "image file: " + image.getAbsolutePath() + " not found"); | | 272 | + Validator.notNull(image, "image cannot be null"); | | 273 | + Validator.isTrue(image.exists(), "image file: " + image.getAbsolutePath() + " not found"); | 274 | 274 |
| 275 | 275 | final Map<String, Object> params = new HashMap<String, Object>(); | 276 | 276 | params.put(IMAGE, image); | @@ -309,7 +309,7 @@ public ImageFaces recognizeFaces(File image, Boolean knowledgeGraph) { | 309 | 309 | * @return {@link ImageFaces} | 310 | 310 | */ | 311 | 311 | public ImageFaces recognizeFaces(URL url, Boolean knowledgeGraph) { | 312 | | - Validate.notNull(url, "url cannot be null"); | | 312 | + Validator.notNull(url, "url cannot be null"); | 313 | 313 |
| 314 | 314 | final Map<String, Object> params = new HashMap<String, Object>(); | 315 | 315 | params.put(URL, url); | |
Collapse file Copy file name to clipboardExpand all lines: src/main/java/com/ibm/watson/developer_cloud/alchemy/v1/model/ImageSceneText.java +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -61,9 +61,9 @@ public String getSceneText() { | 61 | 61 | } | 62 | 62 |
| 63 | 63 | /** | 64 | | - * Sets the image faces. | | 64 | + * Sets the image texts. | 65 | 65 | * | 66 | | - * @param imageFaces The imageFaces | | 66 | + * @param imageTexts The imageTexts | 67 | 67 | */ | 68 | 68 | public void setSceneTextLines(List<ImageSceneTextLine> imageTexts) { | 69 | 69 | this.sceneTextLines = imageTexts; | |
Collapse file Copy file name to clipboard +20-1Lines changed: 20 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +/** | | 2 | + * Copyright 2015 IBM Corp. All Rights Reserved. | | 3 | + * | | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | | 5 | + * in compliance with 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 | | 10 | + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | | 11 | + * or implied. See the License for the specific language governing permissions and limitations under | | 12 | + * the License. | | 13 | + */ | 1 | 14 | package com.ibm.watson.developer_cloud.alchemy.v1.model; | 2 | 15 |
| | 16 | +import com.ibm.watson.developer_cloud.alchemy.v1.AlchemyLanguage; | | 17 | + | | 18 | +/** | | 19 | + * Supported Language by the {@link AlchemyLanguage} service. | | 20 | + * | | 21 | + */ | 3 | 22 | public enum LanguageSelection { | 4 | | - ENGLISH, FRENCH, GERMAN, ITALIAN, PORTUGESE, RUSSIAN, SPANISH, SWEDISH, DETECT | | 23 | + ENGLISH, FRENCH, GERMAN, ITALIAN, PORTUGUESE, RUSSIAN, SPANISH, SWEDISH, DETECT | 5 | 24 | } |
Collapse file Copy file name to clipboardExpand all lines: src/main/java/com/ibm/watson/developer_cloud/concept_insights/v2/ConceptInsights.java +12-12Lines changed: 12 additions & 12 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 47 | 47 | import com.ibm.watson.developer_cloud.service.WatsonService; | 48 | 48 | import com.ibm.watson.developer_cloud.service.model.GenericModel; | 49 | 49 | import com.ibm.watson.developer_cloud.util.GsonSingleton; | 50 | | -import com.ibm.watson.developer_cloud.util.ResponseUtil; | 51 | | -import com.ibm.watson.developer_cloud.util.Validate; | | 50 | +import com.ibm.watson.developer_cloud.util.ResponseUtils; | | 51 | +import com.ibm.watson.developer_cloud.util.Validator; | 52 | 52 | import com.squareup.okhttp.Request; | 53 | 53 | import com.squareup.okhttp.Response; | 54 | 54 |
| @@ -214,14 +214,14 @@ public ConceptInsights() { | 214 | 214 | */ | 215 | 215 | public Annotations annotateText(final Graph graph, final String text) { | 216 | 216 | final String graphId = IDHelper.getGraphId(graph, getFirstAccountId()); | 217 | | - Validate.notEmpty(text, "text cannot be empty"); | | 217 | + Validator.notEmpty(text, "text cannot be empty"); | 218 | 218 |
| 219 | 219 | final Request request = RequestBuilder.post(API_VERSION + graphId + ANNOTATE_TEXT_PATH) | 220 | 220 | .withBodyContent(text, HttpMediaType.TEXT_PLAIN) | 221 | 221 | .withHeader(HttpHeaders.ACCEPT, HttpMediaType.APPLICATION_JSON).build(); | 222 | 222 |
| 223 | 223 | final Response response = execute(request); | 224 | | - return ResponseUtil.getObject(response, Annotations.class); | | 224 | + return ResponseUtils.getObject(response, Annotations.class); | 225 | 225 | } | 226 | 226 |
| 227 | 227 | /** | @@ -241,7 +241,7 @@ public Annotations annotateText(final Graph graph, final String text) { | 241 | 241 | * @return {@link QueryConcepts} | 242 | 242 | */ | 243 | 243 | public QueryConcepts conceptualSearch(Corpus corpus, Map<String, Object> parameters) { | 244 | | - Validate.notNull(parameters.get(IDS), "ids cannot be null"); | | 244 | + Validator.notNull(parameters.get(IDS), "ids cannot be null"); | 245 | 245 | final String corpusId = IDHelper.getCorpusId(corpus, getFirstAccountId()); | 246 | 246 |
| 247 | 247 | final Map<String, Object> queryParams = new HashMap<String, Object>(); | @@ -482,7 +482,7 @@ public Concepts getCorpusRelatedConcepts(final Corpus corpus, | 482 | 482 | */ | 483 | 483 | public Scores getCorpusRelationScores(final Corpus corpus, final List<Concept> concepts) { | 484 | 484 | final String corpusId = IDHelper.getCorpusId(corpus, getFirstAccountId()); | 485 | | - Validate.notEmpty(concepts, "concepts cannot be empty"); | | 485 | + Validator.notEmpty(concepts, "concepts cannot be empty"); | 486 | 486 |
| 487 | 487 | final Map<String, Object> queryParameters = new HashMap<String, Object>(); | 488 | 488 | final JsonObject contentJson = new JsonObject(); | @@ -583,7 +583,7 @@ public Concepts getDocumentRelatedConcepts(final Document document, | 583 | 583 | */ | 584 | 584 | public Scores getDocumentRelationScores(final Document document, final List<Concept> concepts) { | 585 | 585 | final String documentId = IDHelper.getDocumentId(document); | 586 | | - Validate.notEmpty(concepts, "concepts cannot be empty"); | | 586 | + Validator.notEmpty(concepts, "concepts cannot be empty"); | 587 | 587 |
| 588 | 588 | final Map<String, Object> queryParams = new HashMap<String, Object>(); | 589 | 589 | final JsonObject contentJson = new JsonObject(); | @@ -617,7 +617,7 @@ public Scores getDocumentRelationScores(final Document document, final List<Conc | 617 | 617 | public Concepts getGraphRelatedConcepts(final Graph graph, final List<Concept> concepts, | 618 | 618 | final Map<String, Object> parameters) { | 619 | 619 | final String graphId = IDHelper.getGraphId(graph, getFirstAccountId()); | 620 | | - Validate.notEmpty(concepts, "concepts cannot be empty"); | | 620 | + Validator.notEmpty(concepts, "concepts cannot be empty"); | 621 | 621 |
| 622 | 622 | final Map<String, Object> queryParameters = new HashMap<String, Object>(); | 623 | 623 | final String[] queryParms = new String[] {LEVEL, LIMIT}; | @@ -663,7 +663,7 @@ private String toJson(Object object) { | 663 | 663 | */ | 664 | 664 | public Scores getGraphRelationScores(final Concept concept, final List<String> concepts) { | 665 | 665 | final String conceptId = IDHelper.getConceptId(concept); | 666 | | - Validate.notEmpty(concepts, "concepts cannot be empty"); | | 666 | + Validator.notEmpty(concepts, "concepts cannot be empty"); | 667 | 667 |
| 668 | 668 | final Map<String, Object> queryParameters = new HashMap<String, Object>(); | 669 | 669 | final JsonObject contentJson = new JsonObject(); | @@ -695,7 +695,7 @@ public Corpora listCorpora() { | 695 | 695 | * @return {@link Corpora} | 696 | 696 | */ | 697 | 697 | public Corpora listCorpora(final String accountId) { | 698 | | - Validate.notEmpty(accountId, "account_id cannot be empty"); | | 698 | + Validator.notEmpty(accountId, "account_id cannot be empty"); | 699 | 699 | return executeRequest(CORPORA_PATH + FORWARD_SLASH + accountId, null, Corpora.class); | 700 | 700 | } | 701 | 701 |
| @@ -778,7 +778,7 @@ public Graphs listGraphs() { | 778 | 778 | */ | 779 | 779 | public Matches searchCorpusByLabel(final Corpus corpus, final Map<String, Object> parameters) { | 780 | 780 | final String corpusId = IDHelper.getCorpusId(corpus, getFirstAccountId()); | 781 | | - Validate.notEmpty((String) parameters.get(QUERY), "query cannot be empty"); | | 781 | + Validator.notEmpty((String) parameters.get(QUERY), "query cannot be empty"); | 782 | 782 |
| 783 | 783 | final Map<String, Object> queryParameters = new HashMap<String, Object>(); | 784 | 784 | final String[] queryParams = new String[] {QUERY, PREFIX, LIMIT, CONCEPTS}; | @@ -822,7 +822,7 @@ public Matches searchCorpusByLabel(final Corpus corpus, final Map<String, Object | 822 | 822 | public Matches searchGraphsConceptByLabel(final Graph graph, | 823 | 823 | final Map<String, Object> parameters) { | 824 | 824 | final String graphId = IDHelper.getGraphId(graph, getFirstAccountId()); | 825 | | - Validate.notEmpty((String) parameters.get(QUERY), "query cannot be empty"); | | 825 | + Validator.notEmpty((String) parameters.get(QUERY), "query cannot be empty"); | 826 | 826 |
| 827 | 827 | final Map<String, Object> queryParameters = new HashMap<String, Object>(); | 828 | 828 | final String[] params = new String[] {QUERY, PREFIX, LIMIT}; | |
Collapse file Copy file name to clipboardExpand all lines: src/main/java/com/ibm/watson/developer_cloud/concept_insights/v2/model/AccountPermission.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -29,7 +29,7 @@ public enum Permission { | 29 | 29 |
| 30 | 30 | @SerializedName("Admin") ADMIN, | 31 | 31 |
| 32 | | - @SerializedName("ReadWriteAdmin") READ_WRITE_ADMIN; | | 32 | + @SerializedName("ReadWriteAdmin") READ_WRITE_ADMIN | 33 | 33 |
| 34 | 34 | } | 35 | 35 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/main/java/com/ibm/watson/developer_cloud/concept_insights/v2/model/Concept.java +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 18 | 18 | import com.google.gson.annotations.SerializedName; | 19 | 19 | import com.ibm.watson.developer_cloud.concept_insights.v2.ConceptInsights; | 20 | 20 | import com.ibm.watson.developer_cloud.service.model.GenericModel; | 21 | | -import com.ibm.watson.developer_cloud.util.Validate; | | 21 | +import com.ibm.watson.developer_cloud.util.Validator; | 22 | 22 |
| 23 | 23 | /** | 24 | 24 | * Concept returned by the {@link ConceptInsights} service. | @@ -56,8 +56,8 @@ public Concept() {} | 56 | 56 | * @param concept the concept | 57 | 57 | */ | 58 | 58 | public Concept(final Graph graph, final String concept) { | 59 | | - Validate.notNull(graph, "graph cannot be null"); | 60 | | - Validate.notNull(graph.getId(), "graph.id cannot be null"); | | 59 | + Validator.notNull(graph, "graph cannot be null"); | | 60 | + Validator.notNull(graph.getId(), "graph.id cannot be null"); | 61 | 61 | setName(concept); | 62 | 62 | setId(graph.getId() + "/concepts/" + concept); | 63 | 63 | } | @@ -70,7 +70,7 @@ public Concept(final Graph graph, final String concept) { | 70 | 70 | * @param concept the concept | 71 | 71 | */ | 72 | 72 | public Concept(final String accountId, final String graphName, final String concept) { | 73 | | - Validate.notNull(concept, "concept cannot be null"); | | 73 | + Validator.notNull(concept, "concept cannot be null"); | 74 | 74 | setName(concept); | 75 | 75 | setId(new Graph(accountId, graphName).getId() + "/concepts/" + concept); | 76 | 76 | } | |
Collapse file Copy file name to clipboardExpand all lines: src/main/java/com/ibm/watson/developer_cloud/concept_insights/v2/model/Corpus.java +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 19 | 19 | import com.google.gson.annotations.SerializedName; | 20 | 20 | import com.ibm.watson.developer_cloud.concept_insights.v2.ConceptInsights; | 21 | 21 | import com.ibm.watson.developer_cloud.service.model.GenericModel; | 22 | | -import com.ibm.watson.developer_cloud.util.Validate; | | 22 | +import com.ibm.watson.developer_cloud.util.Validator; | 23 | 23 |
| 24 | 24 | /** | 25 | 25 | * Graphs returned by the {@link ConceptInsights} service. | @@ -108,8 +108,8 @@ public Corpus() {} | 108 | 108 | * @param name the corpus name | 109 | 109 | */ | 110 | 110 | public Corpus(String accountId, String name) { | 111 | | - Validate.notEmpty(accountId, "accountId cannot be empty"); | 112 | | - Validate.notEmpty(name, "name cannot be empty"); | | 111 | + Validator.notEmpty(accountId, "accountId cannot be empty"); | | 112 | + Validator.notEmpty(name, "name cannot be empty"); | 113 | 113 | setName(name); | 114 | 114 | setId("/corpora/" + accountId + "/" + name); | 115 | 115 | } | |
Collapse file Copy file name to clipboardExpand all lines: src/main/java/com/ibm/watson/developer_cloud/concept_insights/v2/model/Document.java +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 21 | 21 | import com.google.gson.annotations.SerializedName; | 22 | 22 | import com.ibm.watson.developer_cloud.concept_insights.v2.ConceptInsights; | 23 | 23 | import com.ibm.watson.developer_cloud.service.model.GenericModel; | 24 | | -import com.ibm.watson.developer_cloud.util.Validate; | | 24 | +import com.ibm.watson.developer_cloud.util.Validator; | 25 | 25 |
| 26 | 26 | /** | 27 | 27 | * Document returned by the {@link ConceptInsights} service. | @@ -67,8 +67,8 @@ public Document() {} | 67 | 67 | * @param document the document | 68 | 68 | */ | 69 | 69 | public Document(final Corpus corpus, final String document) { | 70 | | - Validate.notNull(corpus, "corpus cannot be null"); | 71 | | - Validate.notEmpty(corpus.getId(), "corpus.id cannot be empty"); | | 70 | + Validator.notNull(corpus, "corpus cannot be null"); | | 71 | + Validator.notEmpty(corpus.getId(), "corpus.id cannot be empty"); | 72 | 72 | setName(document); | 73 | 73 | setId(corpus.getId() + "/documents/" + document); | 74 | 74 | } | @@ -81,7 +81,7 @@ public Document(final Corpus corpus, final String document) { | 81 | 81 | * @param document the document | 82 | 82 | */ | 83 | 83 | public Document(final String accountId, final String corpusName, final String document) { | 84 | | - Validate.notEmpty(document, "document cannot be empty"); | | 84 | + Validator.notEmpty(document, "document cannot be empty"); | 85 | 85 | setName(document); | 86 | 86 | setId(new Corpus(accountId, corpusName).getId() + "/documents/" + document); | 87 | 87 | } | |
Collapse file Copy file name to clipboardExpand all lines: src/main/java/com/ibm/watson/developer_cloud/concept_insights/v2/model/Graph.java +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 15 | 15 |
| 16 | 16 | import com.ibm.watson.developer_cloud.concept_insights.v2.ConceptInsights; | 17 | 17 | import com.ibm.watson.developer_cloud.service.model.GenericModel; | 18 | | -import com.ibm.watson.developer_cloud.util.Validate; | | 18 | +import com.ibm.watson.developer_cloud.util.Validator; | 19 | 19 |
| 20 | 20 | /** | 21 | 21 | * Graph returned by the {@link ConceptInsights} service. | @@ -44,8 +44,8 @@ public Graph() {} | 44 | 44 | * @param name the name | 45 | 45 | */ | 46 | 46 | public Graph(String accountId, String name) { | 47 | | - Validate.notEmpty(accountId, "accountId cannot be empty"); | 48 | | - Validate.notEmpty(name, "name cannot be empty"); | | 47 | + Validator.notEmpty(accountId, "accountId cannot be empty"); | | 48 | + Validator.notEmpty(name, "name cannot be empty"); | 49 | 49 | setName(name); | 50 | 50 | setId("/graphs/" + accountId + "/" + name); | 51 | 51 | } | |
|