Fix simple Sonar Lint issues
[aai/search-data-service.git] / src / main / java / org / onap / aai / sa / searchdbabstraction / searchapi / DateRange.java
index 448abdc..cd49ee7 100644 (file)
@@ -2,8 +2,8 @@
  * ============LICENSE_START=======================================================
  * org.onap.aai
  * ================================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017 Amdocs
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2018 Amdocs
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,8 +17,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * ============LICENSE_END=========================================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 package org.onap.aai.sa.searchdbabstraction.searchapi;
 
@@ -29,6 +27,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
  * <p>
  * The expected JSON structure for a ranges is as follows:
  * <p>
+ *
  * <pre>
  * {
  *  "from": <from-date>
@@ -37,6 +36,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
  * <p>
  * or
  * <p>
+ *
  * <pre>
  * {
  *  "to": <to-date>
@@ -45,6 +45,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
  * <p>
  * or
  * <p>
+ *
  * <pre>
  * {
  *  "from": <from-date>,
@@ -56,58 +57,59 @@ import com.fasterxml.jackson.annotation.JsonProperty;
  */
 public class DateRange {
 
-  @JsonProperty("from")
-  private String fromDate;
+    @JsonProperty("from")
+    private String fromDate;
 
-  @JsonProperty("to")
-  private String toDate;
+    @JsonProperty("to")
+    private String toDate;
 
-  public String getFromDate() {
-    return fromDate;
-  }
+    public String getFromDate() {
+        return fromDate;
+    }
 
-  public void setFromDate(String fromDate) {
-    this.fromDate = fromDate;
-  }
+    public void setFromDate(String fromDate) {
+        this.fromDate = fromDate;
+    }
 
-  public String getToDate() {
-    return toDate;
-  }
+    public String getToDate() {
+        return toDate;
+    }
 
-  public void setToDate(String toDate) {
-    this.toDate = toDate;
-  }
+    public void setToDate(String toDate) {
+        this.toDate = toDate;
+    }
 
-  public String toElasticSearch() {
-    StringBuilder sb = new StringBuilder();
+    public String toElasticSearch() {
+        StringBuilder sb = new StringBuilder();
 
-    sb.append("{");
+        sb.append("{");
 
-    if (fromDate != null) {
-      sb.append("\"from\": \"");
-      sb.append(fromDate.toString());
-      sb.append("\"");
-    }
+        if (fromDate != null) {
+            sb.append("\"from\": \"");
+            sb.append(fromDate);
+            sb.append("\"");
+        }
 
-    if (toDate != null) {
-      if (fromDate != null) {
-        sb.append(", \"to\": \"");
-        sb.append(toDate.toString());
-        sb.append("\"");
-      } else {
-        sb.append("\"to\": \"");
-        sb.append(toDate.toString());
-        sb.append("\"");
-      }
-    }
+        if (toDate != null) {
+            if (fromDate != null) {
+                sb.append(", \"to\": \"");
+                sb.append(toDate);
+                sb.append("\"");
+            } else {
+                sb.append("\"to\": \"");
+                sb.append(toDate);
+                sb.append("\"");
+            }
+        }
 
-    sb.append("}");
+        sb.append("}");
 
-    return sb.toString();
-  }
+        return sb.toString();
+    }
 
-  public String toString() {
-    return "{from: " + fromDate + ", to: " + toDate + "}";
-  }
+    @Override
+    public String toString() {
+        return "{from: " + fromDate + ", to: " + toDate + "}";
+    }
 
 }