T getJsonData(final String request, final P payload, final String
// todo: need to refactor for duplicated code.
public List getJsonDataAsList(final String request,
- final P payload, final String requestType, final Map headers, final Class elementClass)
- throws UnauthorizedException, GeneralException, NotFoundException {
+ final P payload, final String requestType, final Map headers, final Class elementClass)
+ throws UnauthorizedException, GeneralException, NotFoundException {
if (request == null) {
throw new IllegalArgumentException(REQUEST_VALUE_MUST_BE_SPECIFIED);
}
@@ -327,12 +322,12 @@ public List getJsonDataAsList(final String request,
}
private T readValue(ObjectMapper mapper, String content, Class clazz)
- throws JsonProcessingException {
+ throws JsonProcessingException {
return mapper.readValue(content, clazz);
}
private List readValueAsList(ObjectMapper mapper, String content, final Class elementClass)
- throws JsonProcessingException {
+ throws JsonProcessingException {
return mapper.readValue(content, mapper.getTypeFactory().constructCollectionType(List.class, elementClass));
}
@@ -637,11 +632,7 @@ private void setAdditionalHeaders(HttpURLConnection connection, Map 0) {
- return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");
- }
- return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZZZ");
+ return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");
}
/**
@@ -798,4 +789,4 @@ private String getPathVariables(final Map map) {
}
return bpath.toString();
}
-}
+}
\ No newline at end of file
diff --git a/api/src/main/java/com/messagebird/common/StringUtils.java b/api/src/main/java/com/messagebird/common/StringUtils.java
new file mode 100644
index 0000000..f59ecd0
--- /dev/null
+++ b/api/src/main/java/com/messagebird/common/StringUtils.java
@@ -0,0 +1,12 @@
+package com.messagebird.common;
+
+public class StringUtils {
+
+ private StringUtils() {
+ // static utility
+ }
+
+ public static boolean isBlank(String text) {
+ return text == null || text.trim().isEmpty();
+ }
+}
diff --git a/api/src/main/java/com/messagebird/objects/conversations/MessageParam.java b/api/src/main/java/com/messagebird/objects/conversations/MessageParam.java
index 38ae18f..6a84526 100644
--- a/api/src/main/java/com/messagebird/objects/conversations/MessageParam.java
+++ b/api/src/main/java/com/messagebird/objects/conversations/MessageParam.java
@@ -1,7 +1,7 @@
package com.messagebird.objects.conversations;
import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.commons.lang3.StringUtils;
+import com.messagebird.common.StringUtils;
public class MessageParam {
diff --git a/api/src/main/java/com/messagebird/objects/integrations/HSMComponent.java b/api/src/main/java/com/messagebird/objects/integrations/HSMComponent.java
index ed93847..5f2db2d 100644
--- a/api/src/main/java/com/messagebird/objects/integrations/HSMComponent.java
+++ b/api/src/main/java/com/messagebird/objects/integrations/HSMComponent.java
@@ -1,7 +1,7 @@
package com.messagebird.objects.integrations;
import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.commons.lang3.StringUtils;
+import com.messagebird.common.StringUtils;
import java.util.List;