From 60d4ce7ddcc95b92f534178b8a31d5de980c3862 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Wed, 18 Jan 2017 18:12:10 +0100 Subject: [PATCH] Remove dead code related to Elasticsearch utilities --- .../java/org/sonar/server/es/BaseDoc.java | 9 +- .../java/org/sonar/server/es/EsUtils.java | 19 +- .../main/java/org/sonar/server/es/Facets.java | 12 -- .../org/sonar/server/es/SearchIdResult.java | 2 +- .../java/org/sonar/server/search/Facets.java | 127 ----------- .../org/sonar/server/search/IndexUtils.java | 44 ---- .../java/org/sonar/server/search/Result.java | 57 ----- .../org/sonar/server/search/BaseDocTest.java | 5 +- .../sonar/server/search/FacetsMediumTest.java | 201 ------------------ 9 files changed, 15 insertions(+), 461 deletions(-) delete mode 100644 server/sonar-server/src/main/java/org/sonar/server/search/Facets.java delete mode 100644 server/sonar-server/src/main/java/org/sonar/server/search/IndexUtils.java delete mode 100644 server/sonar-server/src/main/java/org/sonar/server/search/Result.java delete mode 100644 server/sonar-server/src/test/java/org/sonar/server/search/FacetsMediumTest.java diff --git a/server/sonar-server/src/main/java/org/sonar/server/es/BaseDoc.java b/server/sonar-server/src/main/java/org/sonar/server/es/BaseDoc.java index c4654208c2d..70ed83d248c 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/es/BaseDoc.java +++ b/server/sonar-server/src/main/java/org/sonar/server/es/BaseDoc.java @@ -23,7 +23,6 @@ import java.util.Date; import java.util.Map; import javax.annotation.CheckForNull; import javax.annotation.Nullable; -import org.sonar.server.search.IndexUtils; import static com.google.common.collect.Maps.newHashMap; @@ -42,10 +41,6 @@ public abstract class BaseDoc { this.fields = fields; } - public String keyField() { - return (String) fields.get("key"); - } - public abstract String getId(); @CheckForNull @@ -72,7 +67,7 @@ public abstract class BaseDoc { if (val instanceof Date) { return (Date)val; } - return IndexUtils.parseDateTime((String) val); + return EsUtils.parseDateTime((String) val); } return null; } @@ -99,7 +94,7 @@ public abstract class BaseDoc { if (value instanceof Date) { return (Date)value; } - return IndexUtils.parseDateTime((String)value); + return EsUtils.parseDateTime((String)value); } public void setField(String key, @Nullable Object value) { diff --git a/server/sonar-server/src/main/java/org/sonar/server/es/EsUtils.java b/server/sonar-server/src/main/java/org/sonar/server/es/EsUtils.java index 539fd2b3422..99b819ec4b2 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/es/EsUtils.java +++ b/server/sonar-server/src/main/java/org/sonar/server/es/EsUtils.java @@ -20,7 +20,6 @@ package org.sonar.server.es; import com.google.common.base.Function; -import com.google.common.collect.Lists; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collections; @@ -42,6 +41,7 @@ import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHits; import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.joda.time.format.ISODateTimeFormat; +import org.sonar.core.util.stream.Collectors; import static java.lang.String.format; @@ -76,20 +76,19 @@ public class EsUtils { } public static List termsKeys(Terms terms) { - return Lists.transform(terms.getBuckets(), new Function() { - @Override - public String apply(Terms.Bucket bucket) { - return bucket.getKeyAsString(); - } - }); + return terms.getBuckets().stream() + .map(Terms.Bucket::getKeyAsString) + .collect(Collectors.toList(terms.getBuckets().size())); } + + @CheckForNull public static Date parseDateTime(@Nullable String s) { - if (s != null) { - return ISODateTimeFormat.dateTime().parseDateTime(s).toDate(); + if (s == null) { + return null; } - return null; + return ISODateTimeFormat.dateTime().parseDateTime(s).toDate(); } @CheckForNull diff --git a/server/sonar-server/src/main/java/org/sonar/server/es/Facets.java b/server/sonar-server/src/main/java/org/sonar/server/es/Facets.java index e77d2a5c5f8..6fd5b5bc973 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/es/Facets.java +++ b/server/sonar-server/src/main/java/org/sonar/server/es/Facets.java @@ -147,18 +147,6 @@ public class Facets { return facetsByName; } - /** - * Value of the facet bucket. Null if the facet or the bucket do not exist. - */ - @CheckForNull - public Long getBucketValue(String facetName, String bucketKey) { - LinkedHashMap facet = facetsByName.get(facetName); - if (facet != null) { - return facet.get(bucketKey); - } - return null; - } - public Set getBucketKeys(String facetName) { LinkedHashMap facet = facetsByName.get(facetName); if (facet != null) { diff --git a/server/sonar-server/src/main/java/org/sonar/server/es/SearchIdResult.java b/server/sonar-server/src/main/java/org/sonar/server/es/SearchIdResult.java index 7936a38e07e..1c8a9170c62 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/es/SearchIdResult.java +++ b/server/sonar-server/src/main/java/org/sonar/server/es/SearchIdResult.java @@ -56,7 +56,7 @@ public class SearchIdResult { return ReflectionToStringBuilder.toString(this); } - public static List convertToIds(SearchHits hits, Function converter) { + private static List convertToIds(SearchHits hits, Function converter) { List docs = new ArrayList<>(); for (SearchHit hit : hits.getHits()) { docs.add(converter.apply(hit.getId())); diff --git a/server/sonar-server/src/main/java/org/sonar/server/search/Facets.java b/server/sonar-server/src/main/java/org/sonar/server/search/Facets.java deleted file mode 100644 index 25ed16776fd..00000000000 --- a/server/sonar-server/src/main/java/org/sonar/server/search/Facets.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.server.search; - -import com.google.common.collect.LinkedHashMultimap; -import com.google.common.collect.Multimap; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.search.aggregations.Aggregation; -import org.elasticsearch.search.aggregations.HasAggregations; -import org.elasticsearch.search.aggregations.bucket.histogram.Histogram; -import org.elasticsearch.search.aggregations.bucket.missing.Missing; -import org.elasticsearch.search.aggregations.bucket.terms.Terms; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; - -public class Facets { - - private static final Logger LOGGER = Loggers.get(Facets.class); - - private final Multimap facetValues; - - public Facets(SearchResponse response) { - facetValues = LinkedHashMultimap.create(); - - if (response.getAggregations() != null) { - for (Aggregation facet : response.getAggregations()) { - this.processAggregation(facet); - } - } - } - - private void processAggregation(Aggregation aggregation) { - if (Missing.class.isAssignableFrom(aggregation.getClass())) { - processMissingAggregation(aggregation); - } else if (Terms.class.isAssignableFrom(aggregation.getClass())) { - processTermsAggregation(aggregation); - } else if (HasAggregations.class.isAssignableFrom(aggregation.getClass())) { - processSubAggregations(aggregation); - } else if (Histogram.class.isAssignableFrom(aggregation.getClass())) { - processDateHistogram(aggregation); - } else { - LOGGER.warn("Cannot process {} type of aggregation", aggregation.getClass()); - } - } - - private void processMissingAggregation(Aggregation aggregation) { - Missing missing = (Missing) aggregation; - long docCount = missing.getDocCount(); - if (docCount > 0L) { - String facetName = aggregation.getName(); - if (facetName.contains("__") && !facetName.startsWith("__")) { - facetName = facetName.substring(0, facetName.indexOf("__")); - } - this.facetValues.put(facetName.replace("_missing", ""), new FacetValue("", docCount)); - } - } - - private void processTermsAggregation(Aggregation aggregation) { - Terms termAggregation = (Terms) aggregation; - for (Terms.Bucket value : termAggregation.getBuckets()) { - String facetName = aggregation.getName(); - if (facetName.contains("__") && !facetName.startsWith("__")) { - facetName = facetName.substring(0, facetName.indexOf("__")); - } - facetName = facetName.replace("_selected", ""); - this.facetValues.put(facetName, new FacetValue(value.getKeyAsString(), value.getDocCount())); - } - } - - private void processSubAggregations(Aggregation aggregation) { - HasAggregations hasAggregations = (HasAggregations) aggregation; - for (Aggregation internalAggregation : hasAggregations.getAggregations()) { - this.processAggregation(internalAggregation); - } - } - - private void processDateHistogram(Aggregation aggregation) { - Histogram dateHistogram = (Histogram) aggregation; - for (Histogram.Bucket value : dateHistogram.getBuckets()) { - this.facetValues.put(dateHistogram.getName(), new FacetValue(value.getKeyAsString(), value.getDocCount())); - } - } - - public Map> getFacets() { - return this.facetValues.asMap(); - } - - public Collection getFacetValues(String facetName) { - return this.facetValues.get(facetName); - } - - public List getFacetKeys(String facetName) { - List keys = new ArrayList<>(); - if (this.facetValues.containsKey(facetName)) { - for (FacetValue facetValue : facetValues.get(facetName)) { - keys.add(facetValue.getKey()); - } - } - return keys; - } - - @Override - public String toString() { - return facetValues.toString(); - } -} diff --git a/server/sonar-server/src/main/java/org/sonar/server/search/IndexUtils.java b/server/sonar-server/src/main/java/org/sonar/server/search/IndexUtils.java deleted file mode 100644 index 6536be850a1..00000000000 --- a/server/sonar-server/src/main/java/org/sonar/server/search/IndexUtils.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.server.search; - -import java.util.Date; -import javax.annotation.CheckForNull; -import javax.annotation.Nullable; -import org.joda.time.format.ISODateTimeFormat; - -public class IndexUtils { - - private IndexUtils() { - // only static stuff - } - - @CheckForNull - public static Date parseDateTime(@Nullable String s) { - if (s == null) { - return null; - } - return ISODateTimeFormat.dateTime().parseDateTime(s).toDate(); - } - - public static String format(Date date) { - return ISODateTimeFormat.dateTime().print(date.getTime()); - } -} diff --git a/server/sonar-server/src/main/java/org/sonar/server/search/Result.java b/server/sonar-server/src/main/java/org/sonar/server/search/Result.java deleted file mode 100644 index 53c4c4ef878..00000000000 --- a/server/sonar-server/src/main/java/org/sonar/server/search/Result.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.server.search; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; -import org.elasticsearch.action.search.SearchResponse; - -public class Result { - - private final List hits; - private final Facets facets; - private final long total; - - public Result(SearchResponse response) { - this.facets = new Facets(response); - this.total = (int) response.getHits().totalHits(); - this.hits = new ArrayList<>(); - } - - public List getHits() { - return hits; - } - - public long getTotal() { - return total; - } - - public Map> getFacets() { - return this.facets.getFacets(); - } - - @Override - public String toString() { - return ReflectionToStringBuilder.toString(this); - } -} diff --git a/server/sonar-server/src/test/java/org/sonar/server/search/BaseDocTest.java b/server/sonar-server/src/test/java/org/sonar/server/search/BaseDocTest.java index e8891abba1c..d0609630e46 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/search/BaseDocTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/search/BaseDocTest.java @@ -25,6 +25,7 @@ import java.util.Date; import java.util.Map; import org.junit.Test; import org.sonar.server.es.BaseDoc; +import org.sonar.server.es.EsUtils; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; @@ -109,7 +110,7 @@ public class BaseDocTest { doc.setField("javaDate", new Date(now)); assertThat(doc.getFieldAsDate("javaDate").getTime()).isEqualTo(now); - doc.setField("stringDate", IndexUtils.format(new Date(now))); + doc.setField("stringDate", EsUtils.formatDateTime(new Date(now))); assertThat(doc.getFieldAsDate("stringDate").getTime()).isEqualTo(now); } @@ -135,7 +136,7 @@ public class BaseDocTest { doc.setField("javaDate", new Date(now)); assertThat(doc.getNullableFieldAsDate("javaDate").getTime()).isEqualTo(now); - doc.setField("stringDate", IndexUtils.format(new Date(now))); + doc.setField("stringDate", EsUtils.formatDateTime(new Date(now))); assertThat(doc.getNullableFieldAsDate("stringDate").getTime()).isEqualTo(now); doc.setField("noValue", null); diff --git a/server/sonar-server/src/test/java/org/sonar/server/search/FacetsMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/search/FacetsMediumTest.java deleted file mode 100644 index e58c217455c..00000000000 --- a/server/sonar-server/src/test/java/org/sonar/server/search/FacetsMediumTest.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.server.search; - -import com.google.common.collect.Maps; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.search.aggregations.AggregationBuilders; -import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; -import org.junit.Rule; -import org.junit.Test; -import org.sonar.api.utils.DateUtils; -import org.sonar.server.es.BaseDoc; -import org.sonar.server.es.EsTester; -import org.sonar.server.es.NewIndex.NewIndexType; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Mockito.mock; - -public class FacetsMediumTest { - - private static final String INDEX = "facetstests"; - private static final String TYPE = "tagsdoc"; - private static final String FIELD_KEY = "key"; - private static final String FIELD_TAGS = "tags"; - private static final String FIELD_CREATED_AT = "createdAt"; - - @Rule - public EsTester esTester = new EsTester(new FacetsTestDefinition()); - - @Test - public void should_ignore_result_without_aggregations() { - Facets facets = new Facets(mock(SearchResponse.class)); - assertThat(facets.getFacets()).isEmpty(); - assertThat(facets.getFacetKeys("polop")).isEmpty(); - assertThat(facets.getFacetValues("polop")).isEmpty(); - } - - @Test - public void should_ignore_unknown_aggregation_type() throws Exception { - esTester.putDocuments(INDEX, TYPE, newTagsDocument("noTags")); - esTester.putDocuments(INDEX, TYPE, newTagsDocument("oneTag", "tag1")); - esTester.putDocuments(INDEX, TYPE, newTagsDocument("twoTags", "tag1", "tag2")); - esTester.putDocuments(INDEX, TYPE, newTagsDocument("threeTags", "tag1", "tag2", "tag3")); - esTester.putDocuments(INDEX, TYPE, newTagsDocument("fourTags", "tag1", "tag2", "tag3", "tag4")); - SearchRequestBuilder search = esTester.client().prepareSearch(INDEX).setTypes(TYPE) - .addAggregation(AggregationBuilders.cardinality(FIELD_TAGS).field(FIELD_TAGS)); - - Facets facets = new Facets(search.get()); - assertThat(facets.getFacets()).isEmpty(); - assertThat(facets.getFacetKeys(FIELD_TAGS)).isEmpty(); - } - - @Test - public void should_process_result_with_nested_missing_and_terms_aggregations() throws Exception { - esTester.putDocuments(INDEX, TYPE, newTagsDocument("noTags")); - esTester.putDocuments(INDEX, TYPE, newTagsDocument("oneTag", "tag1")); - esTester.putDocuments(INDEX, TYPE, newTagsDocument("fourTags", "tag1", "tag2", "tag3", "tag4")); - - SearchRequestBuilder search = esTester.client().prepareSearch(INDEX).setTypes(TYPE) - .addAggregation(AggregationBuilders.global("tags__global") - .subAggregation(AggregationBuilders.missing("tags_missing").field(FIELD_TAGS)) - .subAggregation(AggregationBuilders.terms("tags").field(FIELD_TAGS).size(2)) - .subAggregation(AggregationBuilders.terms("tags__selected").field(FIELD_TAGS).include("tag4")) - .subAggregation(AggregationBuilders.terms("__ignored").field(FIELD_TAGS).include("tag3"))); - - Facets facets = new Facets(search.get()); - assertThat(facets.getFacets()).isNotEmpty(); - assertThat(facets.getFacetKeys(FIELD_TAGS)).containsOnly("", "tag1", "tag2", "tag4"); - assertThat(facets.getFacetKeys(FIELD_CREATED_AT)).isEmpty(); - // ES internals use HashMap, so can't test the exact string for compatibility with both java 7 and java 8 - assertThat(facets.toString()).startsWith("{tags=[{") - .contains("__ignored=[{tag3=1}]") - .contains("{tag4=1}") - .contains("{=1}") - .contains("{tag1=2}") - .contains("{tag2=1}"); - } - - @Test - public void should_ignore_empty_missing_aggregation() throws Exception { - esTester.putDocuments(INDEX, TYPE, newTagsDocument("oneTag", "tag1")); - esTester.putDocuments(INDEX, TYPE, newTagsDocument("twoTags", "tag1", "tag2")); - esTester.putDocuments(INDEX, TYPE, newTagsDocument("threeTags", "tag1", "tag2", "tag3")); - esTester.putDocuments(INDEX, TYPE, newTagsDocument("fourTags", "tag1", "tag2", "tag3", "tag4")); - - SearchRequestBuilder search = esTester.client().prepareSearch(INDEX).setTypes(TYPE) - .addAggregation(AggregationBuilders.global("tags__global") - .subAggregation(AggregationBuilders.missing("tags_missing").field(FIELD_TAGS)) - .subAggregation(AggregationBuilders.terms("tags").field(FIELD_TAGS).size(2)) - .subAggregation(AggregationBuilders.terms("tags__selected").field(FIELD_TAGS).include("tag4")) - .subAggregation(AggregationBuilders.terms("__ignored").field(FIELD_TAGS).include("tag3"))); - - Facets facets = new Facets(search.get()); - assertThat(facets.getFacets()).isNotEmpty(); - assertThat(facets.getFacetKeys(FIELD_TAGS)).containsOnly("tag1", "tag2", "tag4"); - assertThat(facets.getFacetKeys(FIELD_CREATED_AT)).isEmpty(); - } - - @Test - public void should_process_result_with_date_histogram() throws Exception { - esTester.putDocuments(INDEX, TYPE, newTagsDocument("first")); - esTester.putDocuments(INDEX, TYPE, newTagsDocument("second")); - esTester.putDocuments(INDEX, TYPE, newTagsDocument("third")); - - SearchRequestBuilder search = esTester.client().prepareSearch(INDEX).setTypes(TYPE) - .addAggregation( - AggregationBuilders.dateHistogram(FIELD_CREATED_AT) - .minDocCount(0L) - .field(FIELD_CREATED_AT) - .interval(DateHistogramInterval.MINUTE) - .format(DateUtils.DATETIME_FORMAT)); - - Facets facets = new Facets(search.get()); - assertThat(facets.getFacets()).isNotEmpty(); - assertThat(facets.getFacetKeys(FIELD_TAGS)).isEmpty(); - assertThat(facets.getFacetKeys(FIELD_CREATED_AT)).hasSize(1); - FacetValue value = facets.getFacetValues(FIELD_CREATED_AT).iterator().next(); - assertThat(DateUtils.parseDateTime(value.getKey()).before(new Date())).isTrue(); - assertThat(value.getValue()).isEqualTo(3L); - } - - private static TagsDoc newTagsDocument(String key, String... tags) { - return new TagsDoc().setKey(key).setTags(Arrays.asList(tags)).setCreatedAt(new Date()); - } - - private static class FacetsTestDefinition implements org.sonar.server.es.IndexDefinition { - - @Override - public void define(IndexDefinitionContext context) { - NewIndexType newType = context.create(INDEX).createType(TYPE); - newType.stringFieldBuilder(FIELD_KEY).build(); - newType.stringFieldBuilder(FIELD_TAGS).build(); - newType.createDateTimeField(FIELD_CREATED_AT); - } - } - - private static class TagsDoc extends BaseDoc { - public TagsDoc() { - super(Maps.newHashMap()); - } - - @Override - public String getId() { - return getKey(); - } - - @Override - public String getRouting() { - return null; - } - - @Override - public String getParent() { - return null; - } - - public String getKey() { - return getField(FIELD_KEY); - } - - public List getTags() { - return (List) getField(FIELD_TAGS); - } - - public TagsDoc setKey(String s) { - setField(FIELD_KEY, s); - return this; - } - - public TagsDoc setTags(List tags) { - setField(FIELD_TAGS, tags); - return this; - } - - public TagsDoc setCreatedAt(Date date) { - setField(FIELD_CREATED_AT, date); - return this; - } - } -} -- 2.39.5