From 3869a4f418f51daf0ee67ec974fab3457d9fb69b Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Wed, 30 Nov 2022 21:07:16 +0300 Subject: [PATCH] v.0.7.0 --- pom.xml | 6 +++--- .../haiti/filter/jooq/CriteriaJooqFilter.java | 14 +++++++------- .../haiti/filter/jooq/CriteriaJooqQuery.java | 10 +++++----- .../haiti/filter/jooq/join/JoinTable.java | 14 +++++++------- .../haiti/filter/jooq/page/PageableSeek.java | 6 +++--- .../haiti/filter/jooq/sort/SortContainer.java | 6 +++--- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/pom.xml b/pom.xml index 975358d..530905f 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ dev.struchkov.haiti.filter haiti-filter-jooq - 0.6.0-SNAPSHOT + 0.7.0 jar Haiti Filter JOOQ @@ -30,7 +30,7 @@ UTF-8 UTF-8 - 3.15.6 + 3.15.5 1.6.8 3.2.1 @@ -43,7 +43,7 @@ dev.struchkov.haiti haiti-bom - 1.0.0 + 1.4.0 pom import diff --git a/src/main/java/dev/struchkov/haiti/filter/jooq/CriteriaJooqFilter.java b/src/main/java/dev/struchkov/haiti/filter/jooq/CriteriaJooqFilter.java index 6eadfe8..3e2d418 100644 --- a/src/main/java/dev/struchkov/haiti/filter/jooq/CriteriaJooqFilter.java +++ b/src/main/java/dev/struchkov/haiti/filter/jooq/CriteriaJooqFilter.java @@ -7,7 +7,7 @@ import dev.struchkov.haiti.filter.jooq.page.PageableOffset; import dev.struchkov.haiti.filter.jooq.page.PageableSeek; import dev.struchkov.haiti.filter.jooq.sort.SortContainer; import dev.struchkov.haiti.filter.jooq.sort.SortType; -import dev.struchkov.haiti.utils.Assert; +import dev.struchkov.haiti.utils.Inspector; import org.jooq.Condition; import org.jooq.DSLContext; import org.jooq.Field; @@ -97,15 +97,15 @@ public class CriteriaJooqFilter { // } public CriteriaJooqFilter page(PageableOffset offset) { - Assert.isNotNull(offset); - Assert.isNull(seek, filterJooqException("Нельзя установить два типа пагинации одновременно")); + Inspector.isNotNull(offset); + Inspector.isNull(seek, filterJooqException("Нельзя установить два типа пагинации одновременно")); this.offset = offset; return this; } public CriteriaJooqFilter page(PageableSeek seek) { - Assert.isNotNull(seek); - Assert.isNull(offset, filterJooqException("Нельзя установить два типа пагинации одновременно")); + Inspector.isNotNull(seek); + Inspector.isNull(offset, filterJooqException("Нельзя установить два типа пагинации одновременно")); this.seek = seek; return this; } @@ -153,7 +153,7 @@ public class CriteriaJooqFilter { } public CriteriaJooqFilter join(JoinTable... joinTables) { - Assert.isNotNull(joinTables); + Inspector.isNotNull(joinTables); this.joinTables.addAll(Arrays.stream(joinTables).collect(Collectors.toList())); return this; } @@ -273,7 +273,7 @@ public class CriteriaJooqFilter { private void setPaginationSeek(SelectSeekStepN sort) { if (seek != null) { - Assert.isNotNull(sort, () -> new FilterJooqHaitiException("При использовании пагинации типа seek необходимо указать сортировку")); + Inspector.isNotNull(() -> new FilterJooqHaitiException("При использовании пагинации типа seek необходимо указать сортировку"), sort); final Integer pageSize = seek.getPageSize(); final Object lastId = seek.getLastId(); if (pageSize != null) { diff --git a/src/main/java/dev/struchkov/haiti/filter/jooq/CriteriaJooqQuery.java b/src/main/java/dev/struchkov/haiti/filter/jooq/CriteriaJooqQuery.java index ada4e4b..a511257 100644 --- a/src/main/java/dev/struchkov/haiti/filter/jooq/CriteriaJooqQuery.java +++ b/src/main/java/dev/struchkov/haiti/filter/jooq/CriteriaJooqQuery.java @@ -1,6 +1,6 @@ package dev.struchkov.haiti.filter.jooq; -import dev.struchkov.haiti.utils.Assert; +import dev.struchkov.haiti.utils.Inspector; import org.jooq.Condition; import org.jooq.Field; import org.jooq.impl.DSL; @@ -26,7 +26,7 @@ public class CriteriaJooqQuery { } public > CriteriaJooqQuery between(String field, Y from, Y to) { - Assert.isNotNull(field); + Inspector.isNotNull(field); if (from != null && to != null) { Condition condition = DSL.field(field).between(from, to); conditions.add(condition); @@ -35,7 +35,7 @@ public class CriteriaJooqQuery { } public CriteriaJooqQuery matchPhrase(String field, Object value) { - Assert.isNotNull(field); + Inspector.isNotNull(field); if (value != null) { final Condition condition = condition(Map.of(field(field), value)); conditions.add(condition); @@ -44,7 +44,7 @@ public class CriteriaJooqQuery { } public CriteriaJooqQuery matchPhrase(String field, Set values) { - Assert.isNotNull(field); + Inspector.isNotNull(field); if (values != null) { if (values.isEmpty()) { conditions.add(DSL.field(field).isNull()); @@ -73,7 +73,7 @@ public class CriteriaJooqQuery { } public CriteriaJooqQuery like(String field, String value, boolean ignoreCase) { - Assert.isNotNull(field); + Inspector.isNotNull(field); final Field query = field(field); if (value != null) { if (ignoreCase) { diff --git a/src/main/java/dev/struchkov/haiti/filter/jooq/join/JoinTable.java b/src/main/java/dev/struchkov/haiti/filter/jooq/join/JoinTable.java index 114e058..3f4174e 100644 --- a/src/main/java/dev/struchkov/haiti/filter/jooq/join/JoinTable.java +++ b/src/main/java/dev/struchkov/haiti/filter/jooq/join/JoinTable.java @@ -1,6 +1,6 @@ package dev.struchkov.haiti.filter.jooq.join; -import dev.struchkov.haiti.utils.Assert; +import dev.struchkov.haiti.utils.Inspector; /** * Контейнер для соединения с таблицами. @@ -24,32 +24,32 @@ public class JoinTable { } public static JoinTable ofLeft(String tableName, String fieldBase, String fieldReference) { - Assert.isNotNull(tableName, fieldBase, fieldReference); + Inspector.isNotNull(tableName, fieldBase, fieldReference); return new JoinTable(tableName, fieldBase, fieldReference, JoinTypeOperation.LEFT, null); } public static JoinTable ofLeft(String tableName, String fieldBase, String fieldReference, String alias) { - Assert.isNotNull(tableName, fieldBase, fieldReference, alias); + Inspector.isNotNull(tableName, fieldBase, fieldReference, alias); return new JoinTable(tableName, fieldBase, fieldReference, JoinTypeOperation.LEFT, alias); } public static JoinTable onRight(String tableName, String fieldBase, String fieldReference) { - Assert.isNotNull(tableName, fieldBase, fieldReference); + Inspector.isNotNull(tableName, fieldBase, fieldReference); return new JoinTable(tableName, fieldBase, fieldReference, JoinTypeOperation.RIGHT, null); } public static JoinTable onRight(String tableName, String fieldBase, String fieldReference, String alias) { - Assert.isNotNull(tableName, fieldBase, fieldReference, alias); + Inspector.isNotNull(tableName, fieldBase, fieldReference, alias); return new JoinTable(tableName, fieldBase, fieldReference, JoinTypeOperation.RIGHT, alias); } public static JoinTable of(String tableName, String fieldBase, String fieldReference, JoinTypeOperation joinType) { - Assert.isNotNull(tableName, fieldBase, fieldReference); + Inspector.isNotNull(tableName, fieldBase, fieldReference); return new JoinTable(tableName, fieldBase, fieldReference, joinType, null); } public static JoinTable of(String tableName, String fieldBase, String fieldReference, JoinTypeOperation joinType, String alias) { - Assert.isNotNull(tableName, fieldBase, fieldReference, alias); + Inspector.isNotNull(tableName, fieldBase, fieldReference, alias); return new JoinTable(tableName, fieldBase, fieldReference, joinType, alias); } diff --git a/src/main/java/dev/struchkov/haiti/filter/jooq/page/PageableSeek.java b/src/main/java/dev/struchkov/haiti/filter/jooq/page/PageableSeek.java index cdb387a..9922f74 100644 --- a/src/main/java/dev/struchkov/haiti/filter/jooq/page/PageableSeek.java +++ b/src/main/java/dev/struchkov/haiti/filter/jooq/page/PageableSeek.java @@ -1,6 +1,6 @@ package dev.struchkov.haiti.filter.jooq.page; -import dev.struchkov.haiti.utils.Assert; +import dev.struchkov.haiti.utils.Inspector; public class PageableSeek { @@ -25,12 +25,12 @@ public class PageableSeek { } public static PageableSeek of(Object lastId) { - Assert.isNotNull(lastId); + Inspector.isNotNull(lastId); return new PageableSeek(lastId); } public static PageableSeek of(Object lastId, int pageSize) { - Assert.isNotNull(lastId); + Inspector.isNotNull(lastId); return new PageableSeek(lastId, pageSize); } diff --git a/src/main/java/dev/struchkov/haiti/filter/jooq/sort/SortContainer.java b/src/main/java/dev/struchkov/haiti/filter/jooq/sort/SortContainer.java index e1ce9f3..d5ac87a 100644 --- a/src/main/java/dev/struchkov/haiti/filter/jooq/sort/SortContainer.java +++ b/src/main/java/dev/struchkov/haiti/filter/jooq/sort/SortContainer.java @@ -1,7 +1,7 @@ package dev.struchkov.haiti.filter.jooq.sort; -import dev.struchkov.haiti.utils.Assert; +import dev.struchkov.haiti.utils.Inspector; public class SortContainer { @@ -18,12 +18,12 @@ public class SortContainer { } public static SortContainer of(String fieldName) { - Assert.isNotNull(fieldName); + Inspector.isNotNull(fieldName); return new SortContainer(fieldName); } public static SortContainer of(String fieldName, SortType sortType) { - Assert.isNotNull(fieldName); + Inspector.isNotNull(fieldName); return new SortContainer(fieldName, sortType == null ? SortType.ASC : sortType); }