diff --git a/haiti-bom/pom.xml b/haiti-bom/pom.xml
index 54dbfc3..57c876d 100644
--- a/haiti-bom/pom.xml
+++ b/haiti-bom/pom.xml
@@ -6,12 +6,231 @@
dev.struchkov.haiti
haiti-bom
- 0.0.1-SNAPSHOT
+ 0.0.2
pom
Haiti BOM
Current versions of the framework dependencies
https://github.com/haiti-projects/haiti-framework
+
+
+ true
+ 11
+ 11
+ 11
+
+ 0.0.2
+ 0.0.2
+ 0.0.2
+ 0.0.2
+ 0.0.2
+ 0.0.2
+ 0.0.2
+
+ 4.1.0
+ 2.4.0
+ 2.4.0
+
+ 2.2
+ 7.9.3
+ 1.18.22
+ 1.7.32
+
+ 1.6.8
+ 3.8.0
+ 3.2.1
+ 3.3.1
+ 3.0.1
+
+
+
+
+
+ dev.struchkov.haiti
+ haiti-exception
+ ${haiti.exception.ver}
+
+
+
+ dev.struchkov.haiti
+ haiti-context
+ ${haiti.exception.ver}
+
+
+
+ dev.struchkov.haiti
+ haiti-context
+ ${haiti.context.ver}
+
+
+
+ dev.struchkov.haiti
+ haiti-core
+ ${haiti.core.ver}
+
+
+
+ dev.struchkov.haiti
+ haiti-filter
+ ${haiti.filter.api.ver}
+
+
+
+ dev.struchkov.haiti.filter
+ haiti-filter-criteria
+ ${haiti.filter.criteria.ver}
+
+
+
+ dev.struchkov.haiti
+ haiti-utils
+ ${haiti.utils.ver}
+
+
+
+ org.projectlombok
+ lombok
+ ${lombok.ver}
+
+
+
+ org.elasticsearch
+ elasticsearch
+ ${elasticsearch.ver}
+
+
+
+ javax.persistence
+ javax.persistence-api
+ ${javax.persisttence.api.ver}
+
+
+
+
+ org.springframework.data
+ spring-data-elasticsearch
+ ${spring.data.elasticsearch.ver}
+
+
+
+ org.springframework.data
+ spring-data-commons
+ ${spring.data.commons.ver}
+
+
+
+ org.springframework.data
+ spring-data-jpa
+ ${spring.data.jpa.ver}
+
+
+
+ org.slf4j
+ slf4j-api
+ ${slf4j.ver}
+
+
+
+
+
+
+
+ release
+
+
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+ ${plugin.nexus.staging.ver}
+ true
+
+ ossrh
+ https://s01.oss.sonatype.org/
+ true
+ ${skip.deploy}
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ ${plugin.maven.source.ver}
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ ${plugin.maven.javadoc.ver}
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ ${plugin.maven.gpg.ver}
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ ${plugin.maven.compiler.ver}
+
+
+ 11
+
+
+
+
+
+
+ scm:git:https://github.com/haiti-projects/haiti-framework.git
+ https://github.com/haiti-projects/haiti-framework
+ scm:git:https://github.com/haiti-projects/haiti-framework.git
+
+
+
+
+ ossrh
+ https://s01.oss.sonatype.org/content/repositories/snapshots
+
+
+
+
+
+ uPagge
+ Struchkov Mark
+ mark@struchkov.dev
+ https://mark.struchkov.dev
+
+
+
Apache License, Version 2.0
@@ -35,210 +254,4 @@
-
- Struchkov Inc.
- https://mark.struchkov.dev
-
-
-
- scm:git:https://github.com/haiti-projects/haiti-framework.git
- https://github.com/haiti-projects/haiti-framework
- scm:git:https://github.com/haiti-projects/haiti-framework.git
-
-
-
-
- ossrh
- https://oss.sonatype.org/content/repositories/snapshots
-
-
-
-
- GitHub
- https://github.com/haiti-projects/haiti-framework/issues
-
-
-
- 16
- 16
- 16
-
- 0.0.1-SNAPSHOT
- 0.0.1-SNAPSHOT
- 0.0.1-SNAPSHOT
- 0.0.1-SNAPSHOT
- 0.0.1-RELEASE
- 0.0.1-SNAPSHOT
-
- 4.1.0
- 2.4.0
- 2.4.0
-
- 7.9.3
- 1.18.22
-
-
-
-
-
- dev.struchkov.haiti
- haiti-context
- ${haiti.context.version}
-
-
-
- dev.struchkov.haiti
- haiti-core
- ${haiti.core.version}
-
-
-
- dev.struchkov.haiti
- haiti-filter
- ${haiti.filter.api.version}
-
-
-
- dev.struchkov.haiti.filter
- haiti-filter-criteria
- ${haiti.filter.criteria.version}
-
-
-
- dev.struchkov.haiti
- haiti-utils
- ${haiti.utils.version}
-
-
-
- org.projectlombok
- lombok
- ${lombok.version}
- provided
-
-
-
- org.elasticsearch
- elasticsearch
- ${elasticsearch.version}
-
-
-
- javax.persistence
- javax.persistence-api
- 2.2
-
-
-
-
- org.springframework.data
- spring-data-elasticsearch
- ${spring.data.elasticsearch.version}
-
-
-
- org.springframework.data
- spring-data-commons
- ${spring.data.commons.version}
-
-
-
- org.springframework.data
- spring-data-jpa
- ${spring.data.jpa.version}
-
-
-
-
-
-
-
- release
-
-
-
- org.sonatype.plugins
- nexus-staging-maven-plugin
- 1.6.7
- true
-
- ossrh
- https://oss.sonatype.org/
- true
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- 2.2.1
-
-
- attach-sources
-
- jar-no-fork
-
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- 2.9.1
-
-
- attach-javadocs
-
- jar
-
-
-
-
-
- org.apache.maven.plugins
- maven-gpg-plugin
- 1.5
-
-
- sign-artifacts
- verify
-
- sign
-
-
-
-
-
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.8.0
-
-
- 8
-
-
-
-
-
-
-
- uPagge
- Struchkov Mark
- mark@struchkov.dev
- Struchkov Inc.
- https://struchkov.dev
- https://mark.struchkov.dev
-
- Project Lead
-
- +3
-
-
-
\ No newline at end of file
diff --git a/haiti-context/pom.xml b/haiti-context/pom.xml
index 7941cb1..cd87faf 100644
--- a/haiti-context/pom.xml
+++ b/haiti-context/pom.xml
@@ -6,35 +6,49 @@
dev.struchkov.haiti
haiti
- 0.0.1-SNAPSHOT
+ 0.0.2
haiti-context
- 0.0.1-SNAPSHOT
+ ${haiti.context.ver}
Haiti Context
Basic framework classes
- https://github.com/haiti-projects/haiti-framework
+
+
+ false
+
+
+ dev.struchkov.haiti
+ haiti-exception
+
+
org.projectlombok
lombok
+
+
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+
+ ${skip.deploy}
+
+
+
+
+
uPagge
Struchkov Mark
mark@struchkov.dev
- Struchkov Inc.
- https://struchkov.dev
https://mark.struchkov.dev
-
- Project Lead
-
- +3
diff --git a/haiti-context/src/main/java/dev/struchkov/haiti/context/domain/BasicEntity.java b/haiti-context/src/main/java/dev/struchkov/haiti/context/domain/BasicEntity.java
index 6367c66..8ed9dde 100644
--- a/haiti-context/src/main/java/dev/struchkov/haiti/context/domain/BasicEntity.java
+++ b/haiti-context/src/main/java/dev/struchkov/haiti/context/domain/BasicEntity.java
@@ -1,5 +1,7 @@
package dev.struchkov.haiti.context.domain;
+import lombok.NonNull;
+
/**
* // TODO: 14.01.2021 Добавить описание.
*
@@ -9,4 +11,6 @@ public interface BasicEntity {
K getId();
+ void setId(@NonNull K id);
+
}
diff --git a/haiti-context/src/main/java/dev/struchkov/haiti/context/page/Pagination.java b/haiti-context/src/main/java/dev/struchkov/haiti/context/page/Pagination.java
index f152219..6f13866 100644
--- a/haiti-context/src/main/java/dev/struchkov/haiti/context/page/Pagination.java
+++ b/haiti-context/src/main/java/dev/struchkov/haiti/context/page/Pagination.java
@@ -1,15 +1,13 @@
package dev.struchkov.haiti.context.page;
-import dev.struchkov.haiti.context.enums.TypeSort;
+import java.util.Set;
public interface Pagination {
- int getPage();
+ Integer getPage();
- int getSize();
+ Integer getSize();
- TypeSort getTypeSort();
-
- String getFieldSort();
+ Set extends Sort> getSorts();
}
diff --git a/haiti-context/src/main/java/dev/struchkov/haiti/context/page/Sort.java b/haiti-context/src/main/java/dev/struchkov/haiti/context/page/Sort.java
new file mode 100644
index 0000000..723308e
--- /dev/null
+++ b/haiti-context/src/main/java/dev/struchkov/haiti/context/page/Sort.java
@@ -0,0 +1,11 @@
+package dev.struchkov.haiti.context.page;
+
+import dev.struchkov.haiti.context.enums.TypeSort;
+
+public interface Sort {
+
+ TypeSort getType();
+
+ String getField();
+
+}
diff --git a/haiti-context/src/main/java/dev/struchkov/haiti/context/page/impl/PaginationImpl.java b/haiti-context/src/main/java/dev/struchkov/haiti/context/page/impl/PaginationImpl.java
new file mode 100644
index 0000000..c858a9d
--- /dev/null
+++ b/haiti-context/src/main/java/dev/struchkov/haiti/context/page/impl/PaginationImpl.java
@@ -0,0 +1,35 @@
+package dev.struchkov.haiti.context.page.impl;
+
+import dev.struchkov.haiti.context.page.Pagination;
+import dev.struchkov.haiti.context.page.Sort;
+import lombok.Getter;
+
+import java.util.Set;
+
+@Getter
+public class PaginationImpl implements Pagination {
+
+ private final Integer page;
+ private final Integer size;
+ private Set extends Sort> sorts;
+
+ private PaginationImpl(int page, int size) {
+ this.page = page;
+ this.size = size;
+ }
+
+ public PaginationImpl(int page, int size, Set extends Sort> sorts) {
+ this.page = page;
+ this.size = size;
+ this.sorts = sorts;
+ }
+
+ public static Pagination of(int page, int size) {
+ return new PaginationImpl(page, size);
+ }
+
+ public static Pagination of(int page, int size, Set extends Sort> sorts) {
+ return new PaginationImpl(page, size, sorts);
+ }
+
+}
diff --git a/haiti-core/src/main/java/dev/struchkov/haiti/core/page/SheetImpl.java b/haiti-context/src/main/java/dev/struchkov/haiti/context/page/impl/SheetImpl.java
similarity index 97%
rename from haiti-core/src/main/java/dev/struchkov/haiti/core/page/SheetImpl.java
rename to haiti-context/src/main/java/dev/struchkov/haiti/context/page/impl/SheetImpl.java
index 0a591ec..2544cb3 100644
--- a/haiti-core/src/main/java/dev/struchkov/haiti/core/page/SheetImpl.java
+++ b/haiti-context/src/main/java/dev/struchkov/haiti/context/page/impl/SheetImpl.java
@@ -1,4 +1,4 @@
-package dev.struchkov.haiti.core.page;
+package dev.struchkov.haiti.context.page.impl;
import dev.struchkov.haiti.context.page.Sheet;
import lombok.AllArgsConstructor;
diff --git a/haiti-context/src/main/java/dev/struchkov/haiti/context/page/impl/SortImpl.java b/haiti-context/src/main/java/dev/struchkov/haiti/context/page/impl/SortImpl.java
new file mode 100644
index 0000000..29c0ead
--- /dev/null
+++ b/haiti-context/src/main/java/dev/struchkov/haiti/context/page/impl/SortImpl.java
@@ -0,0 +1,21 @@
+package dev.struchkov.haiti.context.page.impl;
+
+import dev.struchkov.haiti.context.enums.TypeSort;
+import dev.struchkov.haiti.context.page.Sort;
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.NonNull;
+import lombok.RequiredArgsConstructor;
+
+@Getter
+@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
+public class SortImpl implements Sort {
+
+ private final TypeSort type;
+ private final String field;
+
+ public static Sort of(@NonNull TypeSort type, String field) {
+ return new SortImpl(type, field);
+ }
+
+}
diff --git a/haiti-core/pom.xml b/haiti-core/pom.xml
index 162d58b..0a1a91a 100644
--- a/haiti-core/pom.xml
+++ b/haiti-core/pom.xml
@@ -6,15 +6,18 @@
dev.struchkov.haiti
haiti
- 0.0.1-SNAPSHOT
+ 0.0.2
haiti-core
- 0.0.1-SNAPSHOT
+ ${haiti.core.ver}
Haiti Core
Implementation of the main classes of the framework
- https://github.com/haiti-projects/haiti-framework
+
+
+ false
+
@@ -33,18 +36,24 @@
+
+
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+
+ ${skip.deploy}
+
+
+
+
+
uPagge
Struchkov Mark
mark@struchkov.dev
- Struchkov Inc.
- https://struchkov.dev
https://mark.struchkov.dev
-
- Project Lead
-
- +3
diff --git a/haiti-core/src/main/java/dev/struchkov/haiti/core/page/PaginationImpl.java b/haiti-core/src/main/java/dev/struchkov/haiti/core/page/PaginationImpl.java
deleted file mode 100644
index 5afddd0..0000000
--- a/haiti-core/src/main/java/dev/struchkov/haiti/core/page/PaginationImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package dev.struchkov.haiti.core.page;
-
-import dev.struchkov.haiti.context.enums.TypeSort;
-import dev.struchkov.haiti.context.page.Pagination;
-import lombok.Getter;
-
-@Getter
-public class PaginationImpl implements Pagination {
-
- private final int page;
- private final int size;
- private String fieldSort;
- private TypeSort typeSort;
-
- private PaginationImpl(int page, int size) {
- this.page = page;
- this.size = size;
- }
-
- public PaginationImpl(int page, int size, String fieldSort, TypeSort typeSort) {
- this.page = page;
- this.size = size;
- this.fieldSort = fieldSort;
- this.typeSort = typeSort;
- }
-
- public static Pagination of(int page, int size) {
- return new PaginationImpl(page, size);
- }
-
- public static Pagination of(int page, int size, String fieldSort, TypeSort typeSort) {
- return new PaginationImpl(page, size, fieldSort, typeSort);
- }
-
-}
diff --git a/haiti-core/src/main/java/dev/struchkov/haiti/core/repository/SimpleManagerRepositoryMap.java b/haiti-core/src/main/java/dev/struchkov/haiti/core/repository/SimpleManagerRepositoryMap.java
new file mode 100644
index 0000000..688a046
--- /dev/null
+++ b/haiti-core/src/main/java/dev/struchkov/haiti/core/repository/SimpleManagerRepositoryMap.java
@@ -0,0 +1,68 @@
+package dev.struchkov.haiti.core.repository;
+
+import dev.struchkov.haiti.context.domain.BasicEntity;
+import dev.struchkov.haiti.context.page.Pagination;
+import dev.struchkov.haiti.context.page.Sheet;
+import dev.struchkov.haiti.context.repository.SimpleManagerRepository;
+import lombok.NonNull;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+public class SimpleManagerRepositoryMap> implements SimpleManagerRepository {
+
+ protected final Map map = new HashMap<>();
+ protected long key = 0;
+
+ @Override
+ public T save(@NonNull T accessTarget) {
+ accessTarget.setId(key);
+ map.put(key, accessTarget);
+ key++;
+ return accessTarget;
+ }
+
+ @Override
+ public Optional findById(@NonNull Long id) {
+ return Optional.ofNullable(map.get(id));
+ }
+
+ @Override
+ public boolean existsById(@NonNull Long id) {
+ return map.containsKey(id);
+ }
+
+ @Override
+ public void deleteById(@NonNull Long id) {
+ map.remove(id);
+ }
+
+ @Override
+ public List saveAll(@NonNull Collection accessTargets) {
+ return accessTargets.stream()
+ .map(this::save)
+ .collect(Collectors.toList());
+ }
+
+ @Override
+ public void deleteAllById(@NonNull Collection accessTargets) {
+ accessTargets.forEach(map::remove);
+ }
+
+ @Override
+ public List findAllById(@NonNull Collection ids) {
+ return ids.stream()
+ .map(map::get)
+ .collect(Collectors.toList());
+ }
+
+ @Override
+ public Sheet findAll(@NonNull Pagination pagination) {
+ return null;
+ }
+
+}
diff --git a/haiti-exception/pom.xml b/haiti-exception/pom.xml
new file mode 100644
index 0000000..7454359
--- /dev/null
+++ b/haiti-exception/pom.xml
@@ -0,0 +1,43 @@
+
+
+
+ haiti
+ dev.struchkov.haiti
+ 0.0.2
+
+ 4.0.0
+
+ haiti-exception
+ ${haiti.exception.ver}
+
+ Haiti Exception
+ General exceptions for the haiti project
+
+
+ false
+
+
+
+
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+
+ ${skip.deploy}
+
+
+
+
+
+
+
+ uPagge
+ Struchkov Mark
+ mark@struchkov.dev
+ https://mark.struchkov.dev
+
+
+
+
\ No newline at end of file
diff --git a/haiti-context/src/main/java/dev/struchkov/haiti/context/exception/AccessException.java b/haiti-exception/src/main/java/dev/struchkov/haiti/context/exception/AccessException.java
similarity index 50%
rename from haiti-context/src/main/java/dev/struchkov/haiti/context/exception/AccessException.java
rename to haiti-exception/src/main/java/dev/struchkov/haiti/context/exception/AccessException.java
index b9b4fe6..83152b0 100644
--- a/haiti-context/src/main/java/dev/struchkov/haiti/context/exception/AccessException.java
+++ b/haiti-exception/src/main/java/dev/struchkov/haiti/context/exception/AccessException.java
@@ -1,5 +1,8 @@
package dev.struchkov.haiti.context.exception;
+import java.text.MessageFormat;
+import java.util.function.Supplier;
+
/**
* Исключения связанные с доступом.
*/
@@ -9,5 +12,9 @@ public class AccessException extends BasicException {
super(message);
}
+ public static Supplier supplier(String message, Object... objects) {
+ return () -> new AccessException(MessageFormat.format(message, objects));
+ }
+
}
diff --git a/haiti-context/src/main/java/dev/struchkov/haiti/context/exception/BasicException.java b/haiti-exception/src/main/java/dev/struchkov/haiti/context/exception/BasicException.java
similarity index 100%
rename from haiti-context/src/main/java/dev/struchkov/haiti/context/exception/BasicException.java
rename to haiti-exception/src/main/java/dev/struchkov/haiti/context/exception/BasicException.java
diff --git a/haiti-context/src/main/java/dev/struchkov/haiti/context/exception/ConvertException.java b/haiti-exception/src/main/java/dev/struchkov/haiti/context/exception/ConvertException.java
similarity index 100%
rename from haiti-context/src/main/java/dev/struchkov/haiti/context/exception/ConvertException.java
rename to haiti-exception/src/main/java/dev/struchkov/haiti/context/exception/ConvertException.java
diff --git a/haiti-context/src/main/java/dev/struchkov/haiti/context/exception/CreateException.java b/haiti-exception/src/main/java/dev/struchkov/haiti/context/exception/CreateException.java
similarity index 100%
rename from haiti-context/src/main/java/dev/struchkov/haiti/context/exception/CreateException.java
rename to haiti-exception/src/main/java/dev/struchkov/haiti/context/exception/CreateException.java
diff --git a/haiti-context/src/main/java/dev/struchkov/haiti/context/exception/NotFoundException.java b/haiti-exception/src/main/java/dev/struchkov/haiti/context/exception/NotFoundException.java
similarity index 100%
rename from haiti-context/src/main/java/dev/struchkov/haiti/context/exception/NotFoundException.java
rename to haiti-exception/src/main/java/dev/struchkov/haiti/context/exception/NotFoundException.java
diff --git a/haiti-filter/pom.xml b/haiti-filter/pom.xml
index d1071b4..7c69f9e 100644
--- a/haiti-filter/pom.xml
+++ b/haiti-filter/pom.xml
@@ -6,15 +6,19 @@
dev.struchkov.haiti
haiti
- 0.0.1-SNAPSHOT
+ 0.0.2
haiti-filter
- 0.0.1-SNAPSHOT
+ ${haiti.filter.api.ver}
+ jar
Haiti Filter
Fast and convenient filtering requests to data warehouses.
- https://github.com/haiti-projects/haiti-framework
+
+
+ false
+
@@ -28,19 +32,25 @@
+
+
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+
+ ${skip.deploy}
+
+
+
+
+
uPagge
Struchkov Mark
mark@struchkov.dev
- Struchkov Inc.
- https://struchkov.dev
https://mark.struchkov.dev
-
- Project Lead
-
- +3
-
+
\ No newline at end of file
diff --git a/haiti-filter/src/main/java/dev/struchkov/haiti/filter/Filter.java b/haiti-filter/src/main/java/dev/struchkov/haiti/filter/Filter.java
index f656049..3a975b8 100644
--- a/haiti-filter/src/main/java/dev/struchkov/haiti/filter/Filter.java
+++ b/haiti-filter/src/main/java/dev/struchkov/haiti/filter/Filter.java
@@ -1,13 +1,21 @@
package dev.struchkov.haiti.filter;
+import java.util.function.Consumer;
+
public interface Filter {
Filter and(FilterQuery filterQuery);
+ Filter and(Consumer query);
+
Filter or(FilterQuery filterQuery);
+ Filter or(Consumer query);
+
Filter not(FilterQuery filterQuery);
+ Filter not(Consumer query);
+
Q build();
}
diff --git a/haiti-utils/pom.xml b/haiti-utils/pom.xml
index e0c3a96..aad56d4 100644
--- a/haiti-utils/pom.xml
+++ b/haiti-utils/pom.xml
@@ -5,37 +5,50 @@
dev.struchkov.haiti
haiti
- 0.0.1-SNAPSHOT
+ 0.0.2
4.0.0
+ Haiti Utils
+ Utility useful things
+
haiti-utils
- 0.0.1-SNAPSHOT
+ ${haiti.utils.ver}
+
+
+ false
+
+
+ dev.struchkov.haiti
+ haiti-exception
+
+
org.projectlombok
lombok
-
-
- dev.struchkov.haiti
- haiti-context
-
+
+
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+
+ ${skip.deploy}
+
+
+
+
+
uPagge
Struchkov Mark
mark@struchkov.dev
- Struchkov Inc.
- https://struchkov.dev
https://mark.struchkov.dev
-
- Project Lead
-
- +3
diff --git a/haiti-utils/src/main/java/dev/struchkov/haiti/utils/Assert.java b/haiti-utils/src/main/java/dev/struchkov/haiti/utils/Assert.java
index b24372f..757ae2f 100644
--- a/haiti-utils/src/main/java/dev/struchkov/haiti/utils/Assert.java
+++ b/haiti-utils/src/main/java/dev/struchkov/haiti/utils/Assert.java
@@ -1,7 +1,11 @@
package dev.struchkov.haiti.utils;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
import lombok.experimental.UtilityClass;
+import java.util.Arrays;
+import java.util.Objects;
import java.util.function.Supplier;
/**
@@ -9,7 +13,7 @@ import java.util.function.Supplier;
*
* @author upagge 06.09.2020
*/
-@UtilityClass
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class Assert {
/**
@@ -24,6 +28,12 @@ public final class Assert {
}
}
+ public static void isAnyNotNull(Supplier extends RuntimeException> exception, Object... objects) {
+ if (Arrays.stream(objects).allMatch(Objects::isNull)) {
+ throw exception.get();
+ }
+ }
+
/**
* Проверка на null значение с возвращением исключения, если объект null.
*
diff --git a/haiti-utils/src/main/java/dev/struchkov/haiti/utils/ObjectUtils.java b/haiti-utils/src/main/java/dev/struchkov/haiti/utils/ObjectUtils.java
index b310a39..dca532e 100644
--- a/haiti-utils/src/main/java/dev/struchkov/haiti/utils/ObjectUtils.java
+++ b/haiti-utils/src/main/java/dev/struchkov/haiti/utils/ObjectUtils.java
@@ -10,6 +10,7 @@ import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Collection;
+import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -136,6 +137,10 @@ public class ObjectUtils {
&& method.getName().toLowerCase().endsWith(fieldName.toLowerCase());
}
+ public static List toList(T... t) {
+ return Arrays.stream(t).collect(Collectors.toList());
+ }
+
public static Collection toCollect(T... t) {
return Arrays.stream(t).collect(Collectors.toList());
}
diff --git a/pom.xml b/pom.xml
index ccd54c0..62a75cf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
dev.struchkov.haiti
haiti
- 0.0.1-SNAPSHOT
+ 0.0.2
pom
@@ -15,11 +15,175 @@
haiti-filter
haiti-bom
haiti-utils
+ haiti-exception
Haiti Framework
Fast development to keep time on the beach
https://github.com/haiti-projects/haiti-framework
+
+
+ 0.0.2
+ 0.0.2
+ 0.0.2
+ 0.0.2
+ 0.0.2
+ 0.0.2
+ 0.0.2
+ 0.0.2
+
+ 1.6.8
+ 3.2.1
+ 3.3.1
+ 3.0.1
+
+
+
+ scm:git:https://github.com/haiti-projects/haiti-framework.git
+ https://github.com/haiti-projects/haiti-framework
+ scm:git:https://github.com/haiti-projects/haiti-framework.git
+
+
+
+
+ ossrh
+ https://s01.oss.sonatype.org/content/repositories/snapshots
+
+
+
+
+ GitHub
+ https://github.com/haiti-projects/haiti-framework/issues
+
+
+
+
+
+ dev.struchkov.haiti
+ haiti-bom
+ 0.0.2
+ pom
+ import
+
+
+
+
+
+
+
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+ ${plugin.nexus.staging.ver}
+ true
+
+ ossrh
+ https://s01.oss.sonatype.org/
+ true
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ ${plugin.maven.source.ver}
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ ${plugin.maven.javadoc.ver}
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ ${plugin.maven.gpg.ver}
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+ --pinentry-mode
+ loopback
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+ 11
+
+
+
+
+
+
+
+ release
+
+
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+
+
+
+
+
+
+
+
+ uPagge
+ Struchkov Mark
+ mark@struchkov.dev
+ Struchkov Inc.
+ https://struchkov.dev
+ https://mark.struchkov.dev
+
+ Project Lead
+
+ +3
+
+
+
Apache License, Version 2.0
@@ -43,129 +207,4 @@
-
- Struchkov Inc.
- https://mark.struchkov.dev
-
-
-
- scm:git:https://github.com/haiti-projects/haiti-framework.git
- https://github.com/haiti-projects/haiti-framework
- scm:git:https://github.com/haiti-projects/haiti-framework.git
-
-
-
-
- ossrh
- https://oss.sonatype.org/content/repositories/snapshots
-
-
-
-
- GitHub
- https://github.com/haiti-projects/haiti-framework/issues
-
-
-
-
- release
-
-
-
- org.sonatype.plugins
- nexus-staging-maven-plugin
- 1.6.7
- true
-
- ossrh
- https://oss.sonatype.org/
- true
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- 2.2.1
-
-
- attach-sources
-
- jar-no-fork
-
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- 2.9.1
-
-
- attach-javadocs
-
- jar
-
-
-
-
-
- org.apache.maven.plugins
- maven-gpg-plugin
- 1.5
-
-
- sign-artifacts
- verify
-
- sign
-
-
-
-
-
-
-
-
-
-
-
-
- dev.struchkov.haiti
- haiti-bom
- 0.0.1-SNAPSHOT
- pom
- import
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.8.0
-
-
- 8
-
-
-
-
-
-
-
- uPagge
- Struchkov Mark
- mark@struchkov.dev
- Struchkov Inc.
- https://struchkov.dev
- https://mark.struchkov.dev
-
- Project Lead
-
- +3
-
-
-
\ No newline at end of file