Skip to content

Commit dd3d01e

Browse files
committed
Polishing
1 parent 3f2ab4b commit dd3d01e

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

src/main/java/org/springframework/data/elasticsearch/annotations/Field.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,14 @@
159159

160160
/**
161161
* if true, the field will be stored in Elasticsearch even if it has a null value
162-
*
162+
*
163163
* @since 4.1
164164
*/
165165
boolean storeNullValue() default false;
166166

167167
/**
168168
* to be used in combination with {@link FieldType#Rank_Feature}
169-
*
169+
*
170170
* @since 4.1
171171
*/
172172
boolean positiveScoreImpact() default true;
@@ -189,7 +189,7 @@
189189
NullValueType nullValueType() default NullValueType.String;
190190

191191
/**
192-
* to be used in combination with {@link FieldType#Dense_Vector}
192+
* to be used in combination with {@link FieldType#Dense_Vector}
193193
*
194194
* @since 4.2
195195
*/

src/main/java/org/springframework/data/elasticsearch/annotations/FieldType.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ public enum FieldType {
6060
Rank_Features, //
6161
/** since 4.2 */
6262
Wildcard, //
63-
/** @since 4.2 */
64-
Dense_Vector //
63+
/** @since 4.2 */
64+
Dense_Vector //
6565
}

src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java

+7-9
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.lang.Boolean;
3232
import java.lang.Double;
3333
import java.lang.Integer;
34+
import java.lang.Object;
3435
import java.math.BigDecimal;
3536
import java.time.LocalDate;
3637
import java.util.Collection;
@@ -508,7 +509,7 @@ void shouldWriteRankFeatureProperties() throws JSONException {
508509
assertEquals(expected, mapping, false);
509510
}
510511

511-
@Test // #1700
512+
@Test // #1700
512513
@DisplayName("should write dense_vector properties")
513514
void shouldWriteDenseVectorProperties() throws JSONException {
514515
String expected = "{\n" + //
@@ -563,9 +564,8 @@ void shouldWriteDisabledPropertyMapping() throws JSONException {
563564
@DisplayName("should only allow disabled properties on type object")
564565
void shouldOnlyAllowDisabledPropertiesOnTypeObject() {
565566

566-
assertThatThrownBy(() ->
567-
getMappingBuilder().buildPropertyMapping(InvalidDisabledMappingProperty.class)
568-
).isInstanceOf(MappingException.class);
567+
assertThatThrownBy(() -> getMappingBuilder().buildPropertyMapping(InvalidDisabledMappingProperty.class))
568+
.isInstanceOf(MappingException.class);
569569
}
570570

571571
@Setter
@@ -982,7 +982,7 @@ static class RankFeatureEntity {
982982
@Field(type = FieldType.Rank_Features) private Map<String, Integer> topics;
983983
}
984984

985-
@Data
985+
@Data
986986
static class DenseVectorEntity {
987987

988988
@Id private String id;
@@ -999,15 +999,13 @@ static class DisabledMappingEntity {
999999
@Data
10001000
static class InvalidDisabledMappingProperty {
10011001
@Id private String id;
1002-
@Mapping(enabled = false)
1003-
@Field(type = Text) private String text;
1002+
@Mapping(enabled = false) @Field(type = Text) private String text;
10041003
}
10051004

10061005
@Data
10071006
static class DisabledMappingProperty {
10081007
@Id private String id;
10091008
@Field(type = Text) private String text;
1010-
@Mapping(enabled = false)
1011-
@Field(type = Object) private Object object;
1009+
@Mapping(enabled = false) @Field(type = Object) private Object object;
10121010
}
10131011
}

src/test/java/org/springframework/data/elasticsearch/core/index/MappingParametersTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.springframework.data.elasticsearch.core.index;
22

33
import static org.assertj.core.api.Assertions.*;
4-
import static org.springframework.data.elasticsearch.annotations.FieldType.Dense_Vector;
4+
import static org.springframework.data.elasticsearch.annotations.FieldType.*;
55
import static org.springframework.data.elasticsearch.annotations.FieldType.Object;
66

77
import java.lang.annotation.Annotation;

0 commit comments

Comments
 (0)