From 76e842249aea4596b645bc53523132699382fbf0 Mon Sep 17 00:00:00 2001 From: dmitrykuzmin Date: Thu, 5 Mar 2020 15:46:18 +0200 Subject: [PATCH 1/6] Extend `Filters` with more filter creation overloads --- .../main/java/io/spine/client/Filters.java | 364 +++++++++++++++++- .../java/io/spine/client/FiltersTest.java | 69 ++++ 2 files changed, 427 insertions(+), 6 deletions(-) diff --git a/client/src/main/java/io/spine/client/Filters.java b/client/src/main/java/io/spine/client/Filters.java index 62bc8fa518a..130d5325a2e 100644 --- a/client/src/main/java/io/spine/client/Filters.java +++ b/client/src/main/java/io/spine/client/Filters.java @@ -26,11 +26,15 @@ import com.google.protobuf.Message; import com.google.protobuf.Timestamp; import io.spine.annotation.Internal; +import io.spine.base.EntityColumn; +import io.spine.base.EntityStateField; +import io.spine.base.EventMessageField; import io.spine.base.Field; import io.spine.base.FieldPath; import io.spine.client.CompositeFilter.CompositeOperator; import io.spine.code.proto.FieldName; import io.spine.core.Event; +import io.spine.core.EventContextField; import io.spine.core.Version; import java.util.Collection; @@ -82,6 +86,7 @@ * @see EntityStateFilter * @see EventFilter */ +@SuppressWarnings("ClassWithTooManyMethods") // A lot of method overloads for filter creation. public final class Filters { /** Prevents this utility class instantiation. */ @@ -95,7 +100,7 @@ private Filters() { * the field path or the entity column name for entity filters * @param value * the requested value - * @return new instance of Filter + * @return a new instance of {@code Filter} */ public static Filter eq(String fieldPath, Object value) { checkNotNull(fieldPath); @@ -103,16 +108,79 @@ public static Filter eq(String fieldPath, Object value) { return createFilter(fieldPath, value, EQUAL); } + /** + * Creates a new equality {@link Filter}. + * + * @param column + * the entity column to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter eq(EntityColumn column, Object value) { + checkNotNull(column); + checkNotNull(value); + return QueryFilter.eq(column, value).filter(); + } + + /** + * Creates a new equality {@link Filter}. + * + * @param field + * the entity state field to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter eq(EntityStateField field, Object value) { + checkNotNull(field); + checkNotNull(value); + return EntityStateFilter.eq(field, value).filter(); + } + + /** + * Creates a new equality {@link Filter}. + * + * @param field + * the event message field to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter eq(EventMessageField field, Object value) { + checkNotNull(field); + checkNotNull(value); + return EventFilter.eq(field, value).filter(); + } + + /** + * Creates a new equality {@link Filter}. + * + *

The field path in the filter will be automatically prepended with {@code "context."} to + * enable filtering by {@linkplain io.spine.core.EventContext event context}. + * + * @param field + * the event context field to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter eq(EventContextField field, Object value) { + checkNotNull(field); + checkNotNull(value); + return EventFilter.eq(field, value).filter(); + } + /** * Creates a new "greater than" {@link Filter}. * - *

For the supported types description see Comparison types section. + *

For the supported types description, see Comparison types section. * * @param fieldPath * the field path or the entity column name for entity filters * @param value * the requested value - * @return new instance of Filter + * @return a new instance of {@code Filter} */ public static Filter gt(String fieldPath, Object value) { checkNotNull(fieldPath); @@ -121,6 +189,77 @@ public static Filter gt(String fieldPath, Object value) { return createFilter(fieldPath, value, GREATER_THAN); } + /** + * Creates a new "greater than" {@link Filter}. + * + *

For the supported types description, see Comparison types section. + * + * @param column + * the entity column to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter gt(EntityColumn column, Object value) { + checkNotNull(column); + checkNotNull(value); + return QueryFilter.gt(column, value).filter(); + } + + /** + * Creates a new "greater than" {@link Filter}. + * + *

For the supported types description, see Comparison types section. + * + * @param field + * the entity state field to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter gt(EntityStateField field, Object value) { + checkNotNull(field); + checkNotNull(value); + return EntityStateFilter.gt(field, value).filter(); + } + + /** + * Creates a new "greater than" {@link Filter}. + * + *

For the supported types description, see Comparison types section. + * + * @param field + * the event message field to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter gt(EventMessageField field, Object value) { + checkNotNull(field); + checkNotNull(value); + return EventFilter.gt(field, value).filter(); + } + + /** + * Creates a new "greater than" {@link Filter}. + * + *

The field path in the filter will be automatically prepended with {@code "context."} to + * enable filtering by {@linkplain io.spine.core.EventContext event context}. + * + *

For the supported types description, see Comparison types section. + * + * @param field + * the event context field to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter gt(EventContextField field, Object value) { + checkNotNull(field); + checkNotNull(value); + return EventFilter.gt(field, value).filter(); + } + /** * Creates a new "less than" {@link Filter}. * @@ -130,7 +269,7 @@ public static Filter gt(String fieldPath, Object value) { * the field path or the entity column name for entity filters * @param value * the requested value - * @return new instance of Filter + * @return a new instance of {@code Filter} */ public static Filter lt(String fieldPath, Object value) { checkNotNull(fieldPath); @@ -139,6 +278,77 @@ public static Filter lt(String fieldPath, Object value) { return createFilter(fieldPath, value, LESS_THAN); } + /** + * Creates a new "less than" {@link Filter}. + * + *

For the supported types description, see Comparison types section. + * + * @param column + * the entity column to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter lt(EntityColumn column, Object value) { + checkNotNull(column); + checkNotNull(value); + return QueryFilter.lt(column, value).filter(); + } + + /** + * Creates a new "less than" {@link Filter}. + * + *

For the supported types description, see Comparison types section. + * + * @param field + * the entity state field to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter lt(EntityStateField field, Object value) { + checkNotNull(field); + checkNotNull(value); + return EntityStateFilter.lt(field, value).filter(); + } + + /** + * Creates a new "less than" {@link Filter}. + * + *

For the supported types description, see Comparison types section. + * + * @param field + * the event message field to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter lt(EventMessageField field, Object value) { + checkNotNull(field); + checkNotNull(value); + return EventFilter.lt(field, value).filter(); + } + + /** + * Creates a new "less than" {@link Filter}. + * + *

The field path in the filter will be automatically prepended with {@code "context."} to + * enable filtering by {@linkplain io.spine.core.EventContext event context}. + * + *

For the supported types description, see Comparison types section. + * + * @param field + * the event context field to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter lt(EventContextField field, Object value) { + checkNotNull(field); + checkNotNull(value); + return EventFilter.lt(field, value).filter(); + } + /** * Creates a new "greater or equal" {@link Filter}. * @@ -148,7 +358,7 @@ public static Filter lt(String fieldPath, Object value) { * the field path or the entity column name for entity filters * @param value * the requested value - * @return new instance of Filter + * @return a new instance of {@code Filter} */ public static Filter ge(String fieldPath, Object value) { checkNotNull(fieldPath); @@ -157,6 +367,77 @@ public static Filter ge(String fieldPath, Object value) { return createFilter(fieldPath, value, GREATER_OR_EQUAL); } + /** + * Creates a new "greater or equal" {@link Filter}. + * + *

See Comparison types section for the supported types description. + * + * @param column + * the entity column to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter ge(EntityColumn column, Object value) { + checkNotNull(column); + checkNotNull(value); + return QueryFilter.ge(column, value).filter(); + } + + /** + * Creates a new "greater or equal" {@link Filter}. + * + *

See Comparison types section for the supported types description. + * + * @param field + * the entity state field to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter ge(EntityStateField field, Object value) { + checkNotNull(field); + checkNotNull(value); + return EntityStateFilter.ge(field, value).filter(); + } + + /** + * Creates a new "greater or equal" {@link Filter}. + * + *

See Comparison types section for the supported types description. + * + * @param field + * the event message field to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter ge(EventMessageField field, Object value) { + checkNotNull(field); + checkNotNull(value); + return EventFilter.ge(field, value).filter(); + } + + /** + * Creates a new "greater or equal" {@link Filter}. + * + *

The field path in the filter will be automatically prepended with {@code "context."} to + * enable filtering by {@linkplain io.spine.core.EventContext event context}. + * + *

See Comparison types section for the supported types description. + * + * @param field + * the event context field to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter ge(EventContextField field, Object value) { + checkNotNull(field); + checkNotNull(value); + return EventFilter.ge(field, value).filter(); + } + /** * Creates a new "less or equal" {@link Filter}. * @@ -166,7 +447,7 @@ public static Filter ge(String fieldPath, Object value) { * the field path or the entity column name for entity filters * @param value * the requested value - * @return new instance of Filter + * @return new instance of {@code Filter} */ public static Filter le(String fieldPath, Object value) { checkNotNull(fieldPath); @@ -175,6 +456,77 @@ public static Filter le(String fieldPath, Object value) { return createFilter(fieldPath, value, LESS_OR_EQUAL); } + /** + * Creates a new "less or equal" {@link Filter}. + * + *

See Comparison types section for the supported types description. + * + * @param column + * the entity column to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter le(EntityColumn column, Object value) { + checkNotNull(column); + checkNotNull(value); + return QueryFilter.le(column, value).filter(); + } + + /** + * Creates a new "less or equal" {@link Filter}. + * + *

See Comparison types section for the supported types description. + * + * @param field + * the entity state field to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter le(EntityStateField field, Object value) { + checkNotNull(field); + checkNotNull(value); + return EntityStateFilter.le(field, value).filter(); + } + + /** + * Creates a new "less or equal" {@link Filter}. + * + *

See Comparison types section for the supported types description. + * + * @param field + * the event message field to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter le(EventMessageField field, Object value) { + checkNotNull(field); + checkNotNull(value); + return EventFilter.le(field, value).filter(); + } + + /** + * Creates a new "less or equal" {@link Filter}. + * + *

The field path in the filter will be automatically prepended with {@code "context."} to + * enable filtering by {@linkplain io.spine.core.EventContext event context}. + * + *

See Comparison types section for the supported types description. + * + * @param field + * the event context field to filter by + * @param value + * the requested value + * @return a new instance of {@code Filter} + */ + public static Filter le(EventContextField field, Object value) { + checkNotNull(field); + checkNotNull(value); + return EventFilter.le(field, value).filter(); + } + /** * Creates a new conjunction composite filter. * diff --git a/client/src/test/java/io/spine/client/FiltersTest.java b/client/src/test/java/io/spine/client/FiltersTest.java index 2b191837519..3bbdc3d4130 100644 --- a/client/src/test/java/io/spine/client/FiltersTest.java +++ b/client/src/test/java/io/spine/client/FiltersTest.java @@ -21,14 +21,22 @@ package io.spine.client; import com.google.common.testing.NullPointerTester; +import com.google.protobuf.Any; import com.google.protobuf.DoubleValue; import com.google.protobuf.StringValue; import com.google.protobuf.Timestamp; +import io.spine.base.EntityColumn; +import io.spine.base.EntityStateField; +import io.spine.base.EventMessageField; import io.spine.base.Field; import io.spine.base.FieldPath; import io.spine.client.Filter.Operator; +import io.spine.core.EventContext; +import io.spine.core.EventContextField; import io.spine.core.Version; import io.spine.core.Versions; +import io.spine.test.client.ClProjectCreated; +import io.spine.test.client.TestEntity; import io.spine.test.client.TestEntityOwner; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; @@ -59,6 +67,7 @@ import static io.spine.testing.DisplayNames.HAVE_PARAMETERLESS_CTOR; import static io.spine.testing.DisplayNames.NOT_ACCEPT_NULLS; import static io.spine.testing.Tests.assertHasPrivateParameterlessCtor; +import static java.lang.String.format; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -141,6 +150,66 @@ private void checkCreatesInstance(Filter filter, Operator operator) { } } + @Nested + @DisplayName("create filter based on a typed") + class CreateFilterByTyped { + + @Test + @DisplayName("column") + void column() { + EntityColumn column = TestEntity.Column.firstField(); + String value = "expected-filter-value"; + String expectedPath = column.name() + .value(); + checkCreates(eq(column, value), expectedPath, value, EQUAL); + } + + @Test + @DisplayName("entity state field") + void entityStateField() { + EntityStateField field = TestEntity.Field.thirdField(); + int value = 142; + String expectedPath = field.getField() + .toString(); + checkCreates(gt(field, value), expectedPath, value, GREATER_THAN); + } + + @Test + @DisplayName("event message field") + void eventMessageField() { + EventMessageField field = ClProjectCreated.Field.name().value(); + String value = "expected-project-name"; + String expectedPath = field.getField() + .toString(); + checkCreates(eq(field, value), expectedPath, value, EQUAL); + } + + @Test + @DisplayName("event context field") + void eventContextField() { + EventContextField field = EventContext.Field.external(); + boolean value = true; + String expectedPath = format("context.%s", field.getField()); + checkCreates(eq(field, value), expectedPath, value, EQUAL); + } + + private void checkCreates(Filter filter, + String expectedPath, + Object expectedValue, + Operator expectedOperator) { + String fieldPath = Field.withPath(filter.getFieldPath()) + .toString(); + assertThat(fieldPath).isEqualTo(expectedPath); + + Any value = filter.getValue(); + Any packedExpectedValue = toAny(expectedValue); + assertThat(value).isEqualTo(packedExpectedValue); + + Operator operator = filter.getOperator(); + assertThat(operator).isEqualTo(expectedOperator); + } + } + @Nested @DisplayName("create composite filter of type") class CreateCompositeFilterOfType { From 6eaf91ba5d0f24c552d6ad098c64a83164eebacf Mon Sep 17 00:00:00 2001 From: dmitrykuzmin Date: Thu, 5 Mar 2020 16:04:48 +0200 Subject: [PATCH 2/6] Fix a test --- client/src/test/java/io/spine/client/FiltersTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/src/test/java/io/spine/client/FiltersTest.java b/client/src/test/java/io/spine/client/FiltersTest.java index 3bbdc3d4130..cc18800bdb2 100644 --- a/client/src/test/java/io/spine/client/FiltersTest.java +++ b/client/src/test/java/io/spine/client/FiltersTest.java @@ -91,6 +91,10 @@ void haveUtilityConstructor() { void passNullToleranceCheck() { new NullPointerTester() .setDefault(Filter.class, Filter.getDefaultInstance()) + .setDefault(EntityColumn.class, TestEntity.Column.firstField()) + .setDefault(EntityStateField.class, TestEntity.Field.owner()) + .setDefault(EventMessageField.class, ClProjectCreated.Field.name()) + .setDefault(EventContextField.class, EventContext.Field.pastMessage()) .testAllPublicStaticMethods(Filters.class); } From 9db9e702fe73722684a484099d40d91153e8221e Mon Sep 17 00:00:00 2001 From: dmitrykuzmin Date: Thu, 5 Mar 2020 16:05:08 +0200 Subject: [PATCH 3/6] Bump Spine version and the `base` dependency --- license-report.md | 32 ++++++++++++++++---------------- pom.xml | 18 +++++++++--------- version.gradle | 4 ++-- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/license-report.md b/license-report.md index 29c549105e7..c6b005b3622 100644 --- a/license-report.md +++ b/license-report.md @@ -1,6 +1,6 @@ -# Dependencies of `io.spine:spine-client:1.4.11` +# Dependencies of `io.spine:spine-client:1.4.12` ## Runtime 1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4 @@ -415,12 +415,12 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 04 15:47:54 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Mar 05 16:02:31 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-core:1.4.11` +# Dependencies of `io.spine:spine-core:1.4.12` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -791,12 +791,12 @@ This report was generated on **Wed Mar 04 15:47:54 EET 2020** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 04 15:47:55 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Mar 05 16:02:32 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-model-assembler:1.4.11` +# Dependencies of `io.spine.tools:spine-model-assembler:1.4.12` ## Runtime 1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4 @@ -1206,12 +1206,12 @@ This report was generated on **Wed Mar 04 15:47:55 EET 2020** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 04 15:47:56 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Mar 05 16:02:32 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-model-verifier:1.4.11` +# Dependencies of `io.spine.tools:spine-model-verifier:1.4.12` ## Runtime 1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4 @@ -1681,12 +1681,12 @@ This report was generated on **Wed Mar 04 15:47:56 EET 2020** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 04 15:47:57 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Mar 05 16:02:33 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-server:1.4.11` +# Dependencies of `io.spine:spine-server:1.4.12` ## Runtime 1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4 @@ -2113,12 +2113,12 @@ This report was generated on **Wed Mar 04 15:47:57 EET 2020** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 04 15:47:58 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Mar 05 16:02:34 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-testutil-client:1.4.11` +# Dependencies of `io.spine:spine-testutil-client:1.4.12` ## Runtime 1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4 @@ -2586,12 +2586,12 @@ This report was generated on **Wed Mar 04 15:47:58 EET 2020** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 04 15:48:00 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Mar 05 16:02:37 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-testutil-core:1.4.11` +# Dependencies of `io.spine:spine-testutil-core:1.4.12` ## Runtime 1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4 @@ -3067,12 +3067,12 @@ This report was generated on **Wed Mar 04 15:48:00 EET 2020** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 04 15:48:02 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Mar 05 16:02:38 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-testutil-server:1.4.11` +# Dependencies of `io.spine:spine-testutil-server:1.4.12` ## Runtime 1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4 @@ -3584,4 +3584,4 @@ This report was generated on **Wed Mar 04 15:48:02 EET 2020** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Mar 04 15:48:05 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Thu Mar 05 16:02:42 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index 7bc59dec4d2..d457990dfdd 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ all modules and does not describe the project structure per-subproject. io.spine spine-core-java -1.4.11 +1.4.12 2015 @@ -70,7 +70,7 @@ all modules and does not describe the project structure per-subproject. io.spine spine-base - 1.4.9 + 1.4.10 compile @@ -82,13 +82,13 @@ all modules and does not describe the project structure per-subproject. io.spine.tools spine-model-compiler - 1.4.9 + 1.4.10 compile io.spine.tools spine-plugin-base - 1.4.9 + 1.4.10 compile @@ -130,7 +130,7 @@ all modules and does not describe the project structure per-subproject. io.spine spine-testlib - 1.4.9 + 1.4.10 test @@ -142,13 +142,13 @@ all modules and does not describe the project structure per-subproject. io.spine.tools spine-mute-logging - 1.4.9 + 1.4.10 test io.spine.tools spine-plugin-testlib - 1.4.9 + 1.4.10 test @@ -210,12 +210,12 @@ all modules and does not describe the project structure per-subproject. io.spine.tools spine-javadoc-filter - 1.4.9 + 1.4.10 io.spine.tools spine-protoc-plugin - 1.4.9 + 1.4.10 net.sourceforge.pmd diff --git a/version.gradle b/version.gradle index 53f59a3da85..a1d61f495ac 100644 --- a/version.gradle +++ b/version.gradle @@ -25,14 +25,14 @@ * as we want to manage the versions in a single source. */ -final def spineVersion = '1.4.11' +final def spineVersion = '1.4.12' ext { // The version of the modules in this project. versionToPublish = spineVersion // Depend on `base` for the general definitions and a model compiler. - spineBaseVersion = '1.4.9' + spineBaseVersion = '1.4.10' // Depend on `time` for `ZoneId`, `ZoneOffset` and other date/time types and utilities. spineTimeVersion = '1.4.7' From c0f2871b021ba1d90a8d766116e392256c2c3114 Mon Sep 17 00:00:00 2001 From: dmitrykuzmin Date: Thu, 5 Mar 2020 16:14:56 +0200 Subject: [PATCH 4/6] Do not delegate filter creation to typed filters ...to avoid extra object creation. --- .../main/java/io/spine/client/Filters.java | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/client/src/main/java/io/spine/client/Filters.java b/client/src/main/java/io/spine/client/Filters.java index 130d5325a2e..519661e4969 100644 --- a/client/src/main/java/io/spine/client/Filters.java +++ b/client/src/main/java/io/spine/client/Filters.java @@ -120,7 +120,7 @@ public static Filter eq(String fieldPath, Object value) { public static Filter eq(EntityColumn column, Object value) { checkNotNull(column); checkNotNull(value); - return QueryFilter.eq(column, value).filter(); + return createFilter(column.name(), value, EQUAL); } /** @@ -135,7 +135,7 @@ public static Filter eq(EntityColumn column, Object value) { public static Filter eq(EntityStateField field, Object value) { checkNotNull(field); checkNotNull(value); - return EntityStateFilter.eq(field, value).filter(); + return createFilter(field.getField(), value, EQUAL); } /** @@ -150,7 +150,7 @@ public static Filter eq(EntityStateField field, Object value) { public static Filter eq(EventMessageField field, Object value) { checkNotNull(field); checkNotNull(value); - return EventFilter.eq(field, value).filter(); + return createFilter(field.getField(), value, EQUAL); } /** @@ -168,7 +168,7 @@ public static Filter eq(EventMessageField field, Object value) { public static Filter eq(EventContextField field, Object value) { checkNotNull(field); checkNotNull(value); - return EventFilter.eq(field, value).filter(); + return createContextFilter(field.getField(), value, EQUAL); } /** @@ -203,7 +203,7 @@ public static Filter gt(String fieldPath, Object value) { public static Filter gt(EntityColumn column, Object value) { checkNotNull(column); checkNotNull(value); - return QueryFilter.gt(column, value).filter(); + return createFilter(column.name(), value, GREATER_THAN); } /** @@ -220,7 +220,7 @@ public static Filter gt(EntityColumn column, Object value) { public static Filter gt(EntityStateField field, Object value) { checkNotNull(field); checkNotNull(value); - return EntityStateFilter.gt(field, value).filter(); + return createFilter(field.getField(), value, GREATER_THAN); } /** @@ -237,7 +237,7 @@ public static Filter gt(EntityStateField field, Object value) { public static Filter gt(EventMessageField field, Object value) { checkNotNull(field); checkNotNull(value); - return EventFilter.gt(field, value).filter(); + return createFilter(field.getField(), value, GREATER_THAN); } /** @@ -257,7 +257,7 @@ public static Filter gt(EventMessageField field, Object value) { public static Filter gt(EventContextField field, Object value) { checkNotNull(field); checkNotNull(value); - return EventFilter.gt(field, value).filter(); + return createContextFilter(field.getField(), value, GREATER_THAN); } /** @@ -292,7 +292,7 @@ public static Filter lt(String fieldPath, Object value) { public static Filter lt(EntityColumn column, Object value) { checkNotNull(column); checkNotNull(value); - return QueryFilter.lt(column, value).filter(); + return createFilter(column.name(), value, LESS_THAN); } /** @@ -309,7 +309,7 @@ public static Filter lt(EntityColumn column, Object value) { public static Filter lt(EntityStateField field, Object value) { checkNotNull(field); checkNotNull(value); - return EntityStateFilter.lt(field, value).filter(); + return createFilter(field.getField(), value, LESS_THAN); } /** @@ -326,7 +326,7 @@ public static Filter lt(EntityStateField field, Object value) { public static Filter lt(EventMessageField field, Object value) { checkNotNull(field); checkNotNull(value); - return EventFilter.lt(field, value).filter(); + return createFilter(field.getField(), value, LESS_THAN); } /** @@ -346,7 +346,7 @@ public static Filter lt(EventMessageField field, Object value) { public static Filter lt(EventContextField field, Object value) { checkNotNull(field); checkNotNull(value); - return EventFilter.lt(field, value).filter(); + return createContextFilter(field.getField(), value, LESS_THAN); } /** @@ -381,7 +381,7 @@ public static Filter ge(String fieldPath, Object value) { public static Filter ge(EntityColumn column, Object value) { checkNotNull(column); checkNotNull(value); - return QueryFilter.ge(column, value).filter(); + return createFilter(column.name(), value, GREATER_OR_EQUAL); } /** @@ -398,7 +398,7 @@ public static Filter ge(EntityColumn column, Object value) { public static Filter ge(EntityStateField field, Object value) { checkNotNull(field); checkNotNull(value); - return EntityStateFilter.ge(field, value).filter(); + return createFilter(field.getField(), value, GREATER_OR_EQUAL); } /** @@ -415,7 +415,7 @@ public static Filter ge(EntityStateField field, Object value) { public static Filter ge(EventMessageField field, Object value) { checkNotNull(field); checkNotNull(value); - return EventFilter.ge(field, value).filter(); + return createFilter(field.getField(), value, GREATER_OR_EQUAL); } /** @@ -435,7 +435,7 @@ public static Filter ge(EventMessageField field, Object value) { public static Filter ge(EventContextField field, Object value) { checkNotNull(field); checkNotNull(value); - return EventFilter.ge(field, value).filter(); + return createContextFilter(field.getField(), value, GREATER_OR_EQUAL); } /** @@ -470,7 +470,7 @@ public static Filter le(String fieldPath, Object value) { public static Filter le(EntityColumn column, Object value) { checkNotNull(column); checkNotNull(value); - return QueryFilter.le(column, value).filter(); + return createFilter(column.name(), value, LESS_OR_EQUAL); } /** @@ -487,7 +487,7 @@ public static Filter le(EntityColumn column, Object value) { public static Filter le(EntityStateField field, Object value) { checkNotNull(field); checkNotNull(value); - return EntityStateFilter.le(field, value).filter(); + return createFilter(field.getField(), value, LESS_OR_EQUAL); } /** @@ -504,7 +504,7 @@ public static Filter le(EntityStateField field, Object value) { public static Filter le(EventMessageField field, Object value) { checkNotNull(field); checkNotNull(value); - return EventFilter.le(field, value).filter(); + return createFilter(field.getField(), value, LESS_OR_EQUAL); } /** @@ -524,7 +524,7 @@ public static Filter le(EventMessageField field, Object value) { public static Filter le(EventContextField field, Object value) { checkNotNull(field); checkNotNull(value); - return EventFilter.le(field, value).filter(); + return createContextFilter(field.getField(), value, LESS_OR_EQUAL); } /** From 6ea5878185ff0033885757d79e105650ba2af0b1 Mon Sep 17 00:00:00 2001 From: dmitrykuzmin Date: Thu, 5 Mar 2020 16:33:38 +0200 Subject: [PATCH 5/6] Reword doc --- client/src/main/java/io/spine/client/Filters.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/main/java/io/spine/client/Filters.java b/client/src/main/java/io/spine/client/Filters.java index 519661e4969..8f2bbf09455 100644 --- a/client/src/main/java/io/spine/client/Filters.java +++ b/client/src/main/java/io/spine/client/Filters.java @@ -669,8 +669,8 @@ private static boolean isSupportedNumber(Class wrapperClass) { * Creates a filter of events which can apply conditions from the passed * {@code CompositeFilter} to both event message and its context. * - *

The filter is deemed addressing the event context if the field path specified in it - * starts with the {@code "context."} prefix. + *

The filter is deemed addressing the {@linkplain io.spine.core.EventContext event context} + * if the field path specified in it starts with the {@code "context."} prefix. */ @Internal public static Predicate toEventFilter(CompositeFilter filterData) { From febd6c484a7d054009a5f40b6b975d8ee20754d4 Mon Sep 17 00:00:00 2001 From: dmitrykuzmin Date: Thu, 5 Mar 2020 18:28:17 +0200 Subject: [PATCH 6/6] Bump Spine version --- license-report.md | 32 ++++++++++++++++---------------- pom.xml | 2 +- version.gradle | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/license-report.md b/license-report.md index c6b005b3622..0f928912a78 100644 --- a/license-report.md +++ b/license-report.md @@ -1,6 +1,6 @@ -# Dependencies of `io.spine:spine-client:1.4.12` +# Dependencies of `io.spine:spine-client:1.4.13` ## Runtime 1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4 @@ -415,12 +415,12 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Mar 05 16:02:31 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Mar 05 18:26:36 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-core:1.4.12` +# Dependencies of `io.spine:spine-core:1.4.13` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -791,12 +791,12 @@ This report was generated on **Thu Mar 05 16:02:31 EET 2020** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Mar 05 16:02:32 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Mar 05 18:26:38 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-model-assembler:1.4.12` +# Dependencies of `io.spine.tools:spine-model-assembler:1.4.13` ## Runtime 1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4 @@ -1206,12 +1206,12 @@ This report was generated on **Thu Mar 05 16:02:32 EET 2020** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Mar 05 16:02:32 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Mar 05 18:26:38 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-model-verifier:1.4.12` +# Dependencies of `io.spine.tools:spine-model-verifier:1.4.13` ## Runtime 1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4 @@ -1681,12 +1681,12 @@ This report was generated on **Thu Mar 05 16:02:32 EET 2020** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Mar 05 16:02:33 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Mar 05 18:26:39 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-server:1.4.12` +# Dependencies of `io.spine:spine-server:1.4.13` ## Runtime 1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4 @@ -2113,12 +2113,12 @@ This report was generated on **Thu Mar 05 16:02:33 EET 2020** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Mar 05 16:02:34 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Mar 05 18:26:40 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-testutil-client:1.4.12` +# Dependencies of `io.spine:spine-testutil-client:1.4.13` ## Runtime 1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4 @@ -2586,12 +2586,12 @@ This report was generated on **Thu Mar 05 16:02:34 EET 2020** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Mar 05 16:02:37 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Mar 05 18:26:42 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-testutil-core:1.4.12` +# Dependencies of `io.spine:spine-testutil-core:1.4.13` ## Runtime 1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4 @@ -3067,12 +3067,12 @@ This report was generated on **Thu Mar 05 16:02:37 EET 2020** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Mar 05 16:02:38 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Mar 05 18:26:44 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-testutil-server:1.4.12` +# Dependencies of `io.spine:spine-testutil-server:1.4.13` ## Runtime 1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4 @@ -3584,4 +3584,4 @@ This report was generated on **Thu Mar 05 16:02:38 EET 2020** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Mar 05 16:02:42 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Thu Mar 05 18:26:47 EET 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index d457990dfdd..45c40bc42af 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ all modules and does not describe the project structure per-subproject. io.spine spine-core-java -1.4.12 +1.4.13 2015 diff --git a/version.gradle b/version.gradle index a1d61f495ac..f0b0727cc94 100644 --- a/version.gradle +++ b/version.gradle @@ -25,7 +25,7 @@ * as we want to manage the versions in a single source. */ -final def spineVersion = '1.4.12' +final def spineVersion = '1.4.13' ext { // The version of the modules in this project.