code stringlengths 23 201k | docstring stringlengths 17 96.2k | func_name stringlengths 0 235 | language stringclasses 1
value | repo stringlengths 8 72 | path stringlengths 11 317 | url stringlengths 57 377 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
public int getNumberOfDataNodes() {
return numberOfDataNodes;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | getNumberOfDataNodes | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public int getActiveShards() {
return activeShards;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | getActiveShards | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public int getRelocatingShards() {
return relocatingShards;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | getRelocatingShards | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public int getActivePrimaryShards() {
return activePrimaryShards;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | getActivePrimaryShards | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public int getInitializingShards() {
return initializingShards;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | getInitializingShards | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public int getUnassignedShards() {
return unassignedShards;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | getUnassignedShards | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public double getActiveShardsPercent() {
return activeShardsPercent;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | getActiveShardsPercent | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public int getNumberOfPendingTasks() {
return numberOfPendingTasks;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | getNumberOfPendingTasks | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public boolean isTimedOut() {
return timedOut;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | isTimedOut | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public int getNumberOfInFlightFetch() {
return numberOfInFlightFetch;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | getNumberOfInFlightFetch | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public int getDelayedUnassignedShards() {
return delayedUnassignedShards;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | getDelayedUnassignedShards | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public long getTaskMaxWaitingTimeMillis() {
return taskMaxWaitingTimeMillis;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | getTaskMaxWaitingTimeMillis | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
@Override
public String toString() {
return "ClusterHealth{" + //
"clusterName='" + clusterName + '\'' + //
", status='" + status + '\'' + //
", numberOfNodes=" + numberOfNodes + //
", numberOfDataNodes=" + numberOfDataNodes + //
", activeShards=" + activeShards + //
", relocatingShards=" + r... | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | toString | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public static ClusterHealthBuilder builder() {
return new ClusterHealthBuilder();
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | builder | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public ClusterHealthBuilder withClusterName(String clusterName) {
this.clusterName = clusterName;
return this;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | withClusterName | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public ClusterHealthBuilder withStatus(String status) {
this.status = status.toUpperCase();
return this;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | withStatus | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public ClusterHealthBuilder withNumberOfNodes(int numberOfNodes) {
this.numberOfNodes = numberOfNodes;
return this;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | withNumberOfNodes | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public ClusterHealthBuilder withNumberOfDataNodes(int numberOfDataNodes) {
this.numberOfDataNodes = numberOfDataNodes;
return this;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | withNumberOfDataNodes | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public ClusterHealthBuilder withActiveShards(int activeShards) {
this.activeShards = activeShards;
return this;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | withActiveShards | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public ClusterHealthBuilder withRelocatingShards(int relocatingShards) {
this.relocatingShards = relocatingShards;
return this;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | withRelocatingShards | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public ClusterHealthBuilder withActivePrimaryShards(int activePrimaryShards) {
this.activePrimaryShards = activePrimaryShards;
return this;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | withActivePrimaryShards | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public ClusterHealthBuilder withInitializingShards(int initializingShards) {
this.initializingShards = initializingShards;
return this;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | withInitializingShards | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public ClusterHealthBuilder withUnassignedShards(int unassignedShards) {
this.unassignedShards = unassignedShards;
return this;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | withUnassignedShards | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public ClusterHealthBuilder withActiveShardsPercent(double activeShardsPercent) {
this.activeShardsPercent = activeShardsPercent;
return this;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | withActiveShardsPercent | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public ClusterHealthBuilder withNumberOfPendingTasks(int numberOfPendingTasks) {
this.numberOfPendingTasks = numberOfPendingTasks;
return this;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | withNumberOfPendingTasks | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public ClusterHealthBuilder withTimedOut(boolean timedOut) {
this.timedOut = timedOut;
return this;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | withTimedOut | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public ClusterHealthBuilder withNumberOfInFlightFetch(int numberOfInFlightFetch) {
this.numberOfInFlightFetch = numberOfInFlightFetch;
return this;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | withNumberOfInFlightFetch | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public ClusterHealthBuilder withDelayedUnassignedShards(int delayedUnassignedShards) {
this.delayedUnassignedShards = delayedUnassignedShards;
return this;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | withDelayedUnassignedShards | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public ClusterHealthBuilder withTaskMaxWaitingTimeMillis(long taskMaxWaitingTimeMillis) {
this.taskMaxWaitingTimeMillis = taskMaxWaitingTimeMillis;
return this;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | withTaskMaxWaitingTimeMillis | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public ClusterHealth build() {
return new ClusterHealth(clusterName, status, numberOfNodes, numberOfDataNodes, activeShards, relocatingShards,
activePrimaryShards, initializingShards, unassignedShards, activeShardsPercent, numberOfPendingTasks,
timedOut, numberOfInFlightFetch, delayedUnassignedShards, task... | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | build | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public Class<?> getGenericType() {
return genericType;
} | @param property the property this convertrer belongs to
@param genericType the generic type of the Range | getGenericType | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractRangePropertyValueConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractRangePropertyValueConverter.java | Apache-2.0 |
@Override
public Object read(Object value) {
Assert.notNull(value, "value must not be null.");
Assert.isInstanceOf(Map.class, value, "value must be instance of Map.");
try {
// noinspection unchecked
Map<String, Object> source = (Map<String, Object>) value;
Range.Bound<T> lowerBound;
Range.Bound<T>... | @param property the property this convertrer belongs to
@param genericType the generic type of the Range | read | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractRangePropertyValueConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractRangePropertyValueConverter.java | Apache-2.0 |
@Override
public Object write(Object value) {
Assert.notNull(value, "value must not be null.");
if (!Range.class.isAssignableFrom(value.getClass())) {
return value.toString();
}
try {
// noinspection unchecked
Range<T> range = (Range<T>) value;
Range.Bound<T> lowerBound = range.getLowerBound();
... | @param property the property this convertrer belongs to
@param genericType the generic type of the Range | write | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractRangePropertyValueConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractRangePropertyValueConverter.java | Apache-2.0 |
@Override
public boolean isTypeKey(String key) {
return typeKey != null && typeKey.equals(key);
} | Elasticsearch specific {@link org.springframework.data.convert.TypeMapper} implementation.
@author Christoph Strobl
@author Mark Paluch
@since 3.2 | isTypeKey | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java | Apache-2.0 |
@Override
@Nullable
public String getTypeKey() {
return typeKey;
} | Elasticsearch specific {@link org.springframework.data.convert.TypeMapper} implementation.
@author Christoph Strobl
@author Mark Paluch
@since 3.2 | getTypeKey | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java | Apache-2.0 |
@Override
protected TypeInformation<?> getFallbackTypeFor(Map<String, Object> source) {
return MAP_TYPE_INFO;
} | Elasticsearch specific {@link org.springframework.data.convert.TypeMapper} implementation.
@author Christoph Strobl
@author Mark Paluch
@since 3.2 | getFallbackTypeFor | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java | Apache-2.0 |
@Override
public Alias readAliasFrom(Map<String, Object> source) {
return Alias.ofNullable(source.get(typeKey));
} | {@link TypeAliasAccessor} to store aliases in a {@link Map}.
@author Christoph Strobl | readAliasFrom | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java | Apache-2.0 |
@Override
public void writeTypeTo(Map<String, Object> sink, Object alias) {
if (typeKey == null) {
return;
}
sink.put(typeKey, alias);
} | {@link TypeAliasAccessor} to store aliases in a {@link Map}.
@author Christoph Strobl | writeTypeTo | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java | Apache-2.0 |
default ProjectionFactory getProjectionFactory() {
return new SpelAwareProxyProjectionFactory();
} | Get the configured {@link ProjectionFactory}. <br />
<strong>NOTE</strong> Should be overwritten in implementation to make use of the type cache.
@since 3.2 | getProjectionFactory | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java | Apache-2.0 |
default String convertId(Object idValue) {
Assert.notNull(idValue, "idValue must not be null!");
if (!getConversionService().canConvert(idValue.getClass(), String.class)) {
return idValue.toString();
}
String converted = getConversionService().convert(idValue, String.class);
if (converted == null) {
... | Convert a given {@literal idValue} to its {@link String} representation taking potentially registered
{@link org.springframework.core.convert.converter.Converter Converters} into account.
@param idValue must not be {@literal null}.
@return never {@literal null}.
@since 3.2 | convertId | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java | Apache-2.0 |
default Document mapObject(@Nullable Object source) {
Document target = Document.create();
if (source != null) {
write(source, target);
}
return target;
} | Map an object to a {@link Document}.
@param source the object to map
@return will not be {@literal null}. | mapObject | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java | Apache-2.0 |
@Override
public UUID convert(String source) {
return UUID.fromString(source);
} | {@link Converter} to read a {@link UUID} from its {@link String} representation. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java | Apache-2.0 |
@Override
public String convert(UUID source) {
return source.toString();
} | {@link Converter} to write a {@link UUID} to its {@link String} representation. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java | Apache-2.0 |
@Override
public BigDecimal convert(Double source) {
return NumberUtils.convertNumberToTargetClass(source, BigDecimal.class);
} | {@link Converter} to read a {@link BigDecimal} from a {@link Double} value. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java | Apache-2.0 |
@Override
public Double convert(BigDecimal source) {
return NumberUtils.convertNumberToTargetClass(source, Double.class);
} | {@link Converter} to write a {@link BigDecimal} to a {@link Double} value. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java | Apache-2.0 |
@Override
public String convert(byte[] source) {
return Base64.getEncoder().encodeToString(source);
} | {@link Converter} to write a byte[] to a base64 encoded {@link String} value.
@since 4.0 | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java | Apache-2.0 |
@Override
public byte[] convert(String source) {
return Base64.getDecoder().decode(source);
} | {@link Converter} to read a byte[] from a base64 encoded {@link String} value.
@since 4.0 | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java | Apache-2.0 |
public static ElasticsearchDateConverter of(DateFormat dateFormat) {
Assert.notNull(dateFormat, "dateFormat must not be null");
return of(dateFormat.name());
} | Creates an ElasticsearchDateConverter for the given {@link DateFormat}.
@param dateFormat must not be @{literal null}
@return converter | of | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | Apache-2.0 |
public static ElasticsearchDateConverter of(String pattern) {
Assert.hasText(pattern, "pattern must not be empty");
String[] subPatterns = pattern.split("\\|\\|");
return converters.computeIfAbsent(subPatterns[0].trim(), p -> new ElasticsearchDateConverter(forPattern(p)));
} | Creates an ElasticsearchDateConverter for the given pattern.
@param pattern must not be {@literal null}
@return converter | of | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | Apache-2.0 |
public String format(TemporalAccessor accessor) {
Assert.notNull(accessor, "accessor must not be null");
if (accessor instanceof Instant instant) {
ZonedDateTime zonedDateTime = ZonedDateTime.ofInstant(instant, ZoneId.of("UTC"));
return dateFormatter.format(zonedDateTime);
}
return dateFormatter.format... | Formats the given {@link TemporalAccessor} into a String.
@param accessor must not be {@literal null}
@return the formatted object | format | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | Apache-2.0 |
public String format(Date date) {
Assert.notNull(date, "accessor must not be null");
return dateFormatter.format(Instant.ofEpochMilli(date.getTime()));
} | Formats the given {@link TemporalAccessor} int a String
@param date must not be {@literal null}
@return the formatted object | format | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | Apache-2.0 |
public <T extends TemporalAccessor> T parse(String input, Class<T> type) {
return dateFormatter.parse(input, type);
} | Parses a String into a TemporalAccessor.
@param input the String to parse, must not be {@literal null}.
@param type the class to return
@param <T> the class of type
@return the new created object | parse | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | Apache-2.0 |
public Date parse(String input) {
return new Date(dateFormatter.parse(input, Instant.class).toEpochMilli());
} | Parses a String into a Date.
@param input the String to parse, must not be {@literal null}.
@return the new created object | parse | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | Apache-2.0 |
private static DateFormatter forPattern(String pattern) {
String resolvedPattern = pattern;
if (DateFormat.epoch_millis.getPattern().equals(pattern)) {
return new EpochMillisDateFormatter();
}
if (DateFormat.epoch_second.getPattern().equals(pattern)) {
return new EpochSecondDateFormatter();
}
// c... | Creates a {@link DateFormatter} for a given pattern. The pattern can be the name of a {@link DateFormat} enum value
or a literal pattern.
@param pattern the pattern to use
@return DateFormatter | forPattern | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | Apache-2.0 |
@SuppressWarnings("unchecked")
private static <T extends TemporalAccessor> TemporalQuery<T> getTemporalQuery(Class<T> type) {
return temporal -> {
// no reflection for java.time classes (GraalVM native)
if (type == java.time.chrono.HijrahDate.class) {
return (T) java.time.chrono.HijrahDate.from(temporal);
... | Creates a {@link DateFormatter} for a given pattern. The pattern can be the name of a {@link DateFormat} enum value
or a literal pattern.
@param pattern the pattern to use
@return DateFormatter | getTemporalQuery | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | Apache-2.0 |
@Override
public String format(TemporalAccessor accessor) {
Assert.notNull(accessor, "accessor must not be null");
long epochMilli = Instant.from(accessor).toEpochMilli();
long fraction = epochMilli % 1_000;
if (fraction == 0) {
return Long.toString(epochMilli / 1_000);
} else {
Double d = ((... | a DateFormatter to convert epoch seconds. Elasticsearch's formatter uses double values, so do we | format | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | Apache-2.0 |
@Override
public <T extends TemporalAccessor> T parse(String input, Class<T> type) {
Assert.notNull(input, "input must not be null");
Assert.notNull(type, "type must not be null");
Double epochMilli = Double.parseDouble(input) * 1_000;
Instant instant = Instant.ofEpochMilli(epochMilli.longValue());
T... | a DateFormatter to convert epoch seconds. Elasticsearch's formatter uses double values, so do we | parse | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | Apache-2.0 |
@Override
public String format(TemporalAccessor accessor) {
Assert.notNull(accessor, "accessor must not be null");
try {
return dateTimeFormatter.format(accessor);
} catch (Exception e) {
if (accessor instanceof Instant instant) {
// as alternatives try to format a ZonedDateTime or LocalDateTi... | a DateFormatter to convert epoch seconds. Elasticsearch's formatter uses double values, so do we | format | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | Apache-2.0 |
@Override
public <T extends TemporalAccessor> T parse(String input, Class<T> type) {
Assert.notNull(input, "input must not be null");
Assert.notNull(type, "type must not be null");
try {
return dateTimeFormatter.parse(input, getTemporalQuery(type));
} catch (Exception e) {
if (type.equals(Insta... | a DateFormatter to convert epoch seconds. Elasticsearch's formatter uses double values, so do we | parse | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java | Apache-2.0 |
static ElasticsearchTypeMapper create(
MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext) {
return new DefaultElasticsearchTypeMapper(DEFAULT_TYPE_KEY, mappingContext);
} | Creates a new default {@link ElasticsearchTypeMapper}.
@param mappingContext the mapping context.
@return a new default {@link ElasticsearchTypeMapper}.
@see DefaultElasticsearchTypeMapper | create | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchTypeMapper.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchTypeMapper.java | Apache-2.0 |
static Collection<Converter<?, ?>> getConvertersToRegister() {
return Arrays.asList(PointToMapConverter.INSTANCE, MapToPointConverter.INSTANCE, //
GeoPointToMapConverter.INSTANCE, MapToGeoPointConverter.INSTANCE, //
GeoJsonToMapConverter.INSTANCE, MapToGeoJsonConverter.INSTANCE, //
GeoJsonPointToMapConve... | Set of {@link Converter converters} specific to Elasticsearch Geo types.
@author Christoph Strobl
@author Peter-Josef Meisch
@since 3.2 | getConvertersToRegister | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public Map<String, Object> convert(Point source) {
Map<String, Object> target = new LinkedHashMap<>();
target.put("lat", source.getY());
target.put("lon", source.getX());
return target;
} | {@link Converter} to write a {@link Point} to {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public Point convert(Map<String, Object> source) {
Double x = NumberUtils.convertNumberToTargetClass((Number) source.get("lon"), Double.class);
Double y = NumberUtils.convertNumberToTargetClass((Number) source.get("lat"), Double.class);
return new Point(x, y);
} | {@link Converter} to read a {@link Point} from {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public Map<String, Object> convert(GeoPoint source) {
Map<String, Object> target = new LinkedHashMap<>();
target.put("lat", source.getLat());
target.put("lon", source.getLon());
return target;
} | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public GeoPoint convert(Map<String, Object> source) {
Double lat = NumberUtils.convertNumberToTargetClass((Number) source.get("lat"), Double.class);
Double lon = NumberUtils.convertNumberToTargetClass((Number) source.get("lon"), Double.class);
return new GeoPoint(lat, lon);
} | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public Map<String, Object> convert(GeoJson<? extends Iterable<?>> source) {
if (source instanceof GeoJsonPoint geoJsonPoint) {
return GeoJsonPointToMapConverter.INSTANCE.convert(geoJsonPoint);
} else if (source instanceof GeoJsonMultiPoint geoJsonMultiPoint) {
return GeoJsonMultiPointToMapConv... | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public GeoJson<? extends Iterable<?>> convert(Map<String, Object> source) {
String type = GeoConverters.getGeoJsonType(source);
return switch (type) {
case "point" -> MapToGeoJsonPointConverter.INSTANCE.convert(source);
case "multipoint" -> MapToGeoJsonMultiPointConverter.INSTANCE.convert(so... | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public Map<String, Object> convert(GeoJsonPoint geoJsonPoint) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("type", geoJsonPoint.getType());
map.put("coordinates", geoJsonPoint.getCoordinates());
return map;
} | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public GeoJsonPoint convert(Map<String, Object> source) {
String type = GeoConverters.getGeoJsonType(source);
Assert.isTrue(type.equalsIgnoreCase(GeoJsonPoint.TYPE), "does not contain a type 'Point'");
Object coordinates = source.get("coordinates");
Assert.notNull(coordinates, "Document to con... | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public Map<String, Object> convert(GeoJsonMultiPoint geoJsonMultiPoint) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("type", geoJsonMultiPoint.getType());
map.put("coordinates", pointsToCoordinates(geoJsonMultiPoint.getCoordinates()));
return map;
} | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public GeoJsonMultiPoint convert(Map<String, Object> source) {
String type = GeoConverters.getGeoJsonType(source);
Assert.isTrue(type.equalsIgnoreCase(GeoJsonMultiPoint.TYPE), "does not contain a type 'MultiPoint'");
Object coordinates = source.get("coordinates");
Assert.notNull(coordinates, "D... | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public Map<String, Object> convert(GeoJsonLineString geoJsonLineString) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("type", geoJsonLineString.getType());
map.put("coordinates", pointsToCoordinates(geoJsonLineString.getCoordinates()));
return map;
} | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public GeoJsonLineString convert(Map<String, Object> source) {
String type = GeoConverters.getGeoJsonType(source);
Assert.isTrue(type.equalsIgnoreCase(GeoJsonLineString.TYPE), "does not contain a type 'LineString'");
Object coordinates = source.get("coordinates");
Assert.notNull(coordinates, "D... | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public Map<String, Object> convert(GeoJsonMultiLineString source) {
return geoJsonLinesStringsToMap(source.getType(), source.getCoordinates());
} | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public GeoJsonMultiLineString convert(Map<String, Object> source) {
String type = GeoConverters.getGeoJsonType(source);
Assert.isTrue(type.equalsIgnoreCase(GeoJsonMultiLineString.TYPE), "does not contain a type 'MultiLineString'");
List<GeoJsonLineString> lines = geoJsonLineStringsFromMap(source);... | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public Map<String, Object> convert(GeoJsonPolygon source) {
return geoJsonLinesStringsToMap(source.getType(), source.getCoordinates());
} | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public GeoJsonPolygon convert(Map<String, Object> source) {
String type = GeoConverters.getGeoJsonType(source);
Assert.isTrue(type.equalsIgnoreCase(GeoJsonPolygon.TYPE), "does not contain a type 'Polygon'");
List<GeoJsonLineString> lines = geoJsonLineStringsFromMap(source);
Assert.isTrue(!lines... | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public Map<String, Object> convert(GeoJsonMultiPolygon source) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("type", source.getType());
List<Object> coordinates = source.getCoordinates().stream() //
.map(GeoJsonPolygonToMapConverter.INSTANCE::convert) //
.filter(Objects::no... | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public GeoJsonMultiPolygon convert(Map<String, Object> source) {
String type = GeoConverters.getGeoJsonType(source);
Assert.isTrue(type.equalsIgnoreCase(GeoJsonMultiPolygon.TYPE), "does not contain a type 'MultiPolygon'");
Object coordinates = source.get("coordinates");
Assert.notNull(coordinat... | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public Map<String, Object> convert(GeoJsonGeometryCollection source) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("type", source.getType());
List<Map<String, Object>> geometries = source.getGeometries().stream()
.map(GeoJsonToMapConverter.INSTANCE::convert).collect(Collectors.to... | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public GeoJsonGeometryCollection convert(Map<String, Object> source) {
String type = GeoConverters.getGeoJsonType(source);
Assert.isTrue(type.equalsIgnoreCase(GeoJsonGeometryCollection.TYPE),
"does not contain a type 'GeometryCollection'");
Object geometries = source.get("geometries");
Ass... | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | convert | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
private static String getGeoJsonType(Map<String, Object> source) {
Object type = source.get("type");
Assert.notNull(type, "Document to convert does not contain a type");
Assert.isTrue(type instanceof String, "type must be a String");
return type.toString().toLowerCase();
} | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | getGeoJsonType | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
private static List<Double> toCoordinates(Point point) {
return Arrays.asList(point.getX(), point.getY());
} | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | toCoordinates | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
private static List<List<Double>> pointsToCoordinates(List<Point> points) {
return points.stream().map(GeoConverters::toCoordinates).collect(Collectors.toList());
} | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | pointsToCoordinates | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
private static List<Point> coordinatesToPoints(List<List<Number>> pointList) {
Assert.isTrue(pointList.size() >= 2, "pointList must have at least 2 elements");
return pointList.stream().map(numbers -> {
Assert.isTrue(numbers.size() >= 2, "coordinates must have at least 2 elements");
return new Point(number... | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | coordinatesToPoints | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
private static Map<String, Object> geoJsonLinesStringsToMap(String type, List<GeoJsonLineString> lineStrings) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("type", type);
List<List<List<Double>>> coordinates = lineStrings.stream()
.map(it -> GeoConverters.pointsToCoordinates(it.getCoordinates()))... | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | geoJsonLinesStringsToMap | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
private static List<GeoJsonLineString> geoJsonLineStringsFromMap(Map<String, Object> source) {
Object coordinates = source.get("coordinates");
Assert.notNull(coordinates, "Document to convert does not contain coordinates");
Assert.isTrue(coordinates instanceof List, "coordinates must be a List");
// noinspecti... | {@link Converter} to write a {@link GeoPoint} to {@link Map} using {@code lat/long} properties. | geoJsonLineStringsFromMap | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java | Apache-2.0 |
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
if (mappingContext instanceof ApplicationContextAware contextAware) {
contextAware.setApplicationContext(applicationContext);
}
} | Elasticsearch specific {@link org.springframework.data.convert.EntityConverter} implementation based on domain type
{@link ElasticsearchPersistentEntity metadata}.
@author Rizwan Idrees
@author Mohsin Husen
@author Christoph Strobl
@author Peter-Josef Meisch
@author Mark Paluch
@author Roman Puchkovskiy
@author Konrad... | setApplicationContext | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | Apache-2.0 |
@Override
public Environment getEnvironment() {
if (environment == null) {
environment = new StandardEnvironment();
}
return environment;
} | Elasticsearch specific {@link org.springframework.data.convert.EntityConverter} implementation based on domain type
{@link ElasticsearchPersistentEntity metadata}.
@author Rizwan Idrees
@author Mohsin Husen
@author Christoph Strobl
@author Peter-Josef Meisch
@author Mark Paluch
@author Roman Puchkovskiy
@author Konrad... | getEnvironment | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | Apache-2.0 |
@Override
public MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> getMappingContext() {
return mappingContext;
} | Elasticsearch specific {@link org.springframework.data.convert.EntityConverter} implementation based on domain type
{@link ElasticsearchPersistentEntity metadata}.
@author Rizwan Idrees
@author Mohsin Husen
@author Christoph Strobl
@author Peter-Josef Meisch
@author Mark Paluch
@author Roman Puchkovskiy
@author Konrad... | getMappingContext | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | Apache-2.0 |
@Override
public ConversionService getConversionService() {
return conversionService;
} | Elasticsearch specific {@link org.springframework.data.convert.EntityConverter} implementation based on domain type
{@link ElasticsearchPersistentEntity metadata}.
@author Rizwan Idrees
@author Mohsin Husen
@author Christoph Strobl
@author Peter-Josef Meisch
@author Mark Paluch
@author Roman Puchkovskiy
@author Konrad... | getConversionService | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | Apache-2.0 |
public void setConversions(CustomConversions conversions) {
Assert.notNull(conversions, "CustomConversions must not be null");
this.conversions = conversions;
} | Set the {@link CustomConversions} to be applied during the mapping process. <br />
Conversions are registered after {@link #afterPropertiesSet() bean initialization}.
@param conversions must not be {@literal null}. | setConversions | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | Apache-2.0 |
@Override
public void afterPropertiesSet() {
DateFormatterRegistrar.addDateConverters(conversionService);
conversions.registerConvertersIn(conversionService);
} | Set the {@link CustomConversions} to be applied during the mapping process. <br />
Conversions are registered after {@link #afterPropertiesSet() bean initialization}.
@param conversions must not be {@literal null}. | afterPropertiesSet | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | Apache-2.0 |
public ElasticsearchTypeMapper getTypeMapper() {
return typeMapper;
} | Set the {@link CustomConversions} to be applied during the mapping process. <br />
Conversions are registered after {@link #afterPropertiesSet() bean initialization}.
@param conversions must not be {@literal null}. | getTypeMapper | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | Apache-2.0 |
@Override
public <R> R read(Class<R> type, Document source) {
Reader reader = new Reader(mappingContext, conversionService, conversions, typeMapper, expressionEvaluatorFactory,
instantiators);
return reader.read(type, source);
} | Set the {@link CustomConversions} to be applied during the mapping process. <br />
Conversions are registered after {@link #afterPropertiesSet() bean initialization}.
@param conversions must not be {@literal null}. | read | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | Apache-2.0 |
@Override
public void write(Object source, Document sink) {
Assert.notNull(source, "source to map must not be null");
Writer writer = new Writer(mappingContext, conversionService, conversions, typeMapper);
writer.write(source, sink);
} | Set the {@link CustomConversions} to be applied during the mapping process. <br />
Conversions are registered after {@link #afterPropertiesSet() bean initialization}.
@param conversions must not be {@literal null}. | write | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | Apache-2.0 |
<R> R read(Class<R> type, Document source) {
// noinspection unchecked
TypeInformation<R> typeInformation = TypeInformation.of((Class<R>) ClassUtils.getUserClass(type));
R r = read(typeInformation, source);
if (r == null) {
throw new ConversionException("could not convert into object of class " + type... | Reads the given source into the given type.
@param type the type to convert the given source to.
@param source the source to create an object of the given type from.
@return the object that was read | read | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | Apache-2.0 |
@Nullable
@SuppressWarnings("unchecked")
private <R> R read(TypeInformation<R> typeInformation, Map<String, Object> source) {
Assert.notNull(source, "Source must not be null!");
TypeInformation<? extends R> typeToUse = typeMapper.readType(source, typeInformation);
Class<? extends R> rawType = typeToUse.g... | Reads the given source into the given type.
@param type the type to convert the given source to.
@param source the source to create an object of the given type from.
@return the object that was read | read | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | Apache-2.0 |
@SuppressWarnings("unchecked")
private <R> R readMap(TypeInformation<?> type, Map<String, Object> source) {
Assert.notNull(source, "Document must not be null!");
Class<?> mapType = typeMapper.readType(source, type).getType();
TypeInformation<?> keyType = type.getComponentType();
TypeInformation<?> valu... | Reads the given source into the given type.
@param type the type to convert the given source to.
@param source the source to create an object of the given type from.
@return the object that was read | readMap | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | Apache-2.0 |
private <R> R readEntity(ElasticsearchPersistentEntity<?> entity, Map<String, Object> source) {
ElasticsearchPersistentEntity<?> targetEntity = computeClosestEntity(entity, source);
ValueExpressionEvaluator evaluator = expressionEvaluatorFactory.create(source);
MapValueAccessor accessor = new MapValueAccessor... | Reads the given source into the given type.
@param type the type to convert the given source to.
@param source the source to create an object of the given type from.
@return the object that was read | readEntity | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.