GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [General-jdk] Static variable polish. · einsnull/java-sdk@8615502

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/main/java/com/ibm/watson/developer_cloud/dialog/v1
    • DialogService.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/main/java/com/ibm/watson/developer_cloud/dialog/v1/DialogService.java‎

Copy file name to clipboardExpand all lines: src/main/java/com/ibm/watson/developer_cloud/dialog/v1/DialogService.java
+16-16Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -83,21 +83,21 @@ public class DialogService extends WatsonService {
8383
public static final String LIMIT = "limit";
8484

8585
/** The list conversation data type. */
86-
private static final Type listConversationDataType = new TypeToken<List<ConversationData>>() {}
86+
private static final Type LIST_CONVERSATION_DATA_TYPE = new TypeToken<List<ConversationData>>() {}
8787
.getType();
8888

8989
/** The list dialog content type. */
90-
private static final Type listDialogContentType = new TypeToken<List<DialogContent>>() {}
90+
private static final Type LIST_DIALOG_CONTENT_TYPE = new TypeToken<List<DialogContent>>() {}
9191
.getType();
9292

9393
/** The list dialog type. */
94-
private static final Type listDialogType = new TypeToken<List<Dialog>>() {}.getType();
94+
private static final Type LIST_DIALOG_TYPE = new TypeToken<List<Dialog>>() {}.getType();
9595

9696
/** The list name value type. */
97-
private static Type listNameValueType = new TypeToken<List<NameValue>>() {}.getType();
97+
private static final Type LIST_NAME_VALUE_TYPE = new TypeToken<List<NameValue>>() {}.getType();
9898

99-
/** The Constant log. */
100-
private static final Logger log = Logger.getLogger(DialogService.class.getName());
99+
/** The Constant LOG. */
100+
private static final Logger LOG = Logger.getLogger(DialogService.class.getName());
101101

102102
/** The Constant NAME. */
103103
private static final String NAME = "name";
@@ -111,8 +111,8 @@ public class DialogService extends WatsonService {
111111
/** The Constant PATH_DIALOGS. */
112112
private static final String PATH_DIALOGS = "/v1/dialogs";
113113

114-
/** The Constant sdfDate. */
115-
private static final SimpleDateFormat sdfDate = new SimpleDateFormat(CONVERSATION_DATE_FORMAT);
114+
/** The Constant SIMPLE_DATE_FORMAT. */
115+
private static final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat(CONVERSATION_DATE_FORMAT);
116116

117117
/** The Constant URL. */
118118
private static final String URL = "https://gateway.watsonplatform.net/dialog/api";
@@ -163,10 +163,10 @@ public Conversation converse(final Map<String, Object> params) {
163163
throw new IllegalArgumentException("dialog id cannot be null or empty");
164164

165165
if (conversationId == null)
166-
log.info("Creating a new conversation with for dialog: " + dialogId);
166+
LOG.info("Creating a new conversation with for dialog: " + dialogId);
167167

168168
if (clientId == null) {
169-
log.info("Creating a new client id with for dialog: " + dialogId);
169+
LOG.info("Creating a new client id with for dialog: " + dialogId);
170170
}
171171

172172
final String path = String.format(PATH_DIALOG_CONVERSATION, dialogId);
@@ -249,7 +249,7 @@ public List<DialogContent> getContent(final String dialogId) {
249249
final Response response = execute(request);
250250
final JsonObject jsonObject = ResponseUtils.getJsonObject(response);
251251
final List<DialogContent> content =
252-
GsonSingleton.getGsonWithoutPrettyPrinting().fromJson(jsonObject.get("items"), listDialogContentType);
252+
GsonSingleton.getGsonWithoutPrettyPrinting().fromJson(jsonObject.get("items"), LIST_DIALOG_CONTENT_TYPE);
253253
return content;
254254
}
255255

@@ -280,8 +280,8 @@ public List<ConversationData> getConversationData(final Map<String, Object> para
280280
if (from.after(to))
281281
throw new IllegalArgumentException("'" + DATE_FROM + "' is greater than '" + DATE_TO + "'");
282282

283-
final String fromString = sdfDate.format(from);
284-
final String toString = sdfDate.format(to);
283+
final String fromString = SIMPLE_DATE_FORMAT.format(from);
284+
final String toString = SIMPLE_DATE_FORMAT.format(to);
285285

286286
final String path = String.format(PATH_DIALOG_CONVERSATION, dialogId);
287287

@@ -298,7 +298,7 @@ public List<ConversationData> getConversationData(final Map<String, Object> para
298298
final Response response = execute(request);
299299
final JsonObject jsonObject = ResponseUtils.getJsonObject(response);
300300
final List<ConversationData> conversationDataList =
301-
GsonSingleton.getGsonWithoutPrettyPrinting().fromJson(jsonObject.get(CONVERSATIONS), listConversationDataType);
301+
GsonSingleton.getGsonWithoutPrettyPrinting().fromJson(jsonObject.get(CONVERSATIONS), LIST_CONVERSATION_DATA_TYPE);
302302
return conversationDataList;
303303
}
304304

@@ -313,7 +313,7 @@ public List<Dialog> getDialogs() {
313313
final Response response = execute(request);
314314
final JsonObject jsonObject = ResponseUtils.getJsonObject(response);
315315
final List<Dialog> dialogs =
316-
GsonSingleton.getGsonWithoutPrettyPrinting().fromJson(jsonObject.get("dialogs"), listDialogType);
316+
GsonSingleton.getGsonWithoutPrettyPrinting().fromJson(jsonObject.get("dialogs"), LIST_DIALOG_TYPE);
317317
return dialogs;
318318
}
319319

@@ -345,7 +345,7 @@ public Map<String, String> getProfile(String dialogId, Integer clientId, String.
345345
final Response response = execute(request);
346346
final JsonObject jsonObject = ResponseUtils.getJsonObject(response);
347347
final List<NameValue> nameValues =
348-
GsonSingleton.getGsonWithoutPrettyPrinting().fromJson(jsonObject.get(NAME_VALUES), listNameValueType);
348+
GsonSingleton.getGsonWithoutPrettyPrinting().fromJson(jsonObject.get(NAME_VALUES), LIST_NAME_VALUE_TYPE);
349349

350350
return fromNameValues(nameValues);
351351
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.