Skip to content

Commit 301a3e5

Browse files
Update javadoc
1 parent 23d15df commit 301a3e5

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/main/java/com/ibm/watson/developer_cloud/alchemy/v1/AlchemyDataNews.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ public static enum TimeFormat {
9292
* @return the news documents
9393
*/
9494
public DocumentsResult getNewsDocuments(Map<String, Object> parameters) {
95-
Validate.notNull(parameters.get(START), "start time can't be null");
96-
Validate.notNull(parameters.get(END), "end time can't be null");
97-
Validate.notNull(parameters.get(RETURN), "return can't be null");
95+
Validate.notNull(parameters.get(START), "start time cannot be null");
96+
Validate.notNull(parameters.get(END), "end time cannot be null");
97+
Validate.notNull(parameters.get(RETURN), "return cannot be null");
9898

9999
// Return json
100100
parameters.put(OUTPUT_MODE, "json");
@@ -125,8 +125,8 @@ public DocumentsResult getNewsDocuments(Map<String, Object> parameters) {
125125
* @return {@link VolumeResult}
126126
*/
127127
public VolumeResult getVolume(final String start, final String end, final String timeSlice) {
128-
Validate.notNull(start, "start time can't be null");
129-
Validate.notNull(end, "end time can't be null");
128+
Validate.notNull(start, "start time cannot be null");
129+
Validate.notNull(end, "end time cannot be null");
130130

131131
Request request = Request.Get(NEWS_END_POINT);
132132

src/main/java/com/ibm/watson/developer_cloud/natural_language_classifier/v1/util/TrainingDataUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import org.apache.commons.csv.CSVRecord;
3131

3232
import com.ibm.watson.developer_cloud.natural_language_classifier.v1.model.TrainingData;
33+
import com.ibm.watson.developer_cloud.util.Validate;
3334

3435

3536
/**
@@ -45,11 +46,10 @@ public class TrainingDataUtils {
4546
*
4647
* @param data
4748
* the training data data
48-
* @return the string with the CSV representation fo the training data
49+
* @return the string with the CSV representation for the training data
4950
*/
5051
public static String toCSV(final TrainingData... data) {
51-
if (data == null || data.length == 0)
52-
throw new IllegalArgumentException("data can't be null or empty");
52+
Validate.notEmpty(data, "data cannot be null or empty");
5353

5454
StringWriter stringWriter = new StringWriter();
5555
try {

src/main/java/com/ibm/watson/developer_cloud/speech_to_text/v1/SpeechToText.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import com.ibm.watson.developer_cloud.speech_to_text.v1.model.SpeechResults;
3535
import com.ibm.watson.developer_cloud.speech_to_text.v1.model.SpeechSession;
3636
import com.ibm.watson.developer_cloud.util.GsonSingleton;
37+
import com.ibm.watson.developer_cloud.util.HttpHeaders;
3738
import com.ibm.watson.developer_cloud.util.ResponseUtil;
3839
import com.ibm.watson.developer_cloud.util.Validate;
3940

@@ -116,7 +117,7 @@ public SpeechSession createSession() {
116117
* @return the {@link SpeechSession}
117118
*/
118119
public SpeechSession createSession(final SpeechModel model) {
119-
Validate.notNull(model, "model can't be null");
120+
Validate.notNull(model, "model cannot be null");
120121
return createSession(model.getName());
121122
}
122123

@@ -275,7 +276,6 @@ public SpeechResults recognize(final File audio, final String contentType) {
275276
* @return the speech results
276277
*/
277278
public SpeechResults recognize(Map<String, Object> params) {
278-
279279
File audio = (File) params.get(AUDIO);
280280
if (audio == null || !audio.exists() || !audio.isFile())
281281
throw new IllegalArgumentException(
@@ -293,7 +293,7 @@ public SpeechResults recognize(Map<String, Object> params) {
293293
urlBuider.append("/recognize");
294294

295295
Request request = Request.Post(urlBuider.toString());
296-
request.withHeader("Content-Type", contentType);
296+
request.withHeader(HttpHeaders.CONTENT_TYPE, contentType);
297297

298298
String[] queryParameters = new String[] { WORD_CONFIDENCE,
299299
CONTINUOUS, MAX_ALTERNATIVES, TIMESTAMPS,

0 commit comments

Comments
 (0)