X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fsa%2Fsearchdbabstraction%2Fsearchapi%2FDateRange.java;h=78f707a18ea0c4f0c1c1dd5009f0b5fad9705682;hb=15af66b115f3e8046b2d0f2634fb77b3d835f730;hp=448abdc5163d982e490ae8a755dc73ee569c57e5;hpb=22c477621c40c4762cceb67a1d18749bff68fb87;p=aai%2Fsearch-data-service.git diff --git a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRange.java b/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRange.java index 448abdc..78f707a 100644 --- a/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRange.java +++ b/src/main/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateRange.java @@ -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; *
* The expected JSON structure for a ranges is as follows: *
+ * *
* { * "from":@@ -37,6 +36,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; * * or *
+ * *
* { * "to":@@ -45,6 +45,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; * * or *
+ * *
* { * "from":, @@ -56,58 +57,58 @@ 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.toString()); + 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.toString()); + sb.append("\""); + } else { + sb.append("\"to\": \""); + sb.append(toDate.toString()); + sb.append("\""); + } + } - sb.append("}"); + sb.append("}"); - return sb.toString(); - } + return sb.toString(); + } - public String toString() { - return "{from: " + fromDate + ", to: " + toDate + "}"; - } + public String toString() { + return "{from: " + fromDate + ", to: " + toDate + "}"; + } }