diff --git a/haiti-bom/pom.xml b/haiti-bom/pom.xml index a7f01c7..52311d5 100644 --- a/haiti-bom/pom.xml +++ b/haiti-bom/pom.xml @@ -6,7 +6,7 @@ dev.struchkov.haiti haiti-bom - 1.1.0 + 1.2.0 pom Haiti BOM @@ -30,7 +30,7 @@ UTF-8 UTF-8 - 1.1.0 + 1.2.0 ${haiti.ver} ${haiti.ver} diff --git a/haiti-context/pom.xml b/haiti-context/pom.xml index 245aea8..e8e5e90 100644 --- a/haiti-context/pom.xml +++ b/haiti-context/pom.xml @@ -6,7 +6,7 @@ dev.struchkov.haiti haiti - 1.1.0 + 1.2.0 haiti-context diff --git a/haiti-core/pom.xml b/haiti-core/pom.xml index d4ab3c6..4f0d2d1 100644 --- a/haiti-core/pom.xml +++ b/haiti-core/pom.xml @@ -6,7 +6,7 @@ dev.struchkov.haiti haiti - 1.1.0 + 1.2.0 haiti-core diff --git a/haiti-exception/pom.xml b/haiti-exception/pom.xml index f14d901..3998d30 100644 --- a/haiti-exception/pom.xml +++ b/haiti-exception/pom.xml @@ -6,7 +6,7 @@ dev.struchkov.haiti haiti - 1.1.0 + 1.2.0 haiti-exception diff --git a/haiti-filter/pom.xml b/haiti-filter/pom.xml index 78ce92e..804968d 100644 --- a/haiti-filter/pom.xml +++ b/haiti-filter/pom.xml @@ -6,7 +6,7 @@ dev.struchkov.haiti haiti - 1.1.0 + 1.2.0 haiti-filter diff --git a/haiti-utils/pom.xml b/haiti-utils/pom.xml index 4d707c0..f29d5eb 100644 --- a/haiti-utils/pom.xml +++ b/haiti-utils/pom.xml @@ -6,7 +6,7 @@ dev.struchkov.haiti haiti - 1.1.0 + 1.2.0 Haiti Utils diff --git a/haiti-utils/src/main/java/dev/struchkov/haiti/utils/CollectionUtils.java b/haiti-utils/src/main/java/dev/struchkov/haiti/utils/CollectionUtils.java new file mode 100644 index 0000000..5de09f1 --- /dev/null +++ b/haiti-utils/src/main/java/dev/struchkov/haiti/utils/CollectionUtils.java @@ -0,0 +1,37 @@ +package dev.struchkov.haiti.utils; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static dev.struchkov.haiti.utils.Exceptions.utilityClass; + +public final class CollectionUtils { + + private CollectionUtils() { + utilityClass(); + } + + public static List toList(T... t) { + return Arrays.stream(t).collect(Collectors.toList()); + } + + public static Collection toCollection(T... t) { + return Arrays.stream(t).collect(Collectors.toList()); + } + + public static Collection toCollection(Collection collection, T... t) { + return Stream.concat( + collection.stream(), Arrays.stream(t) + ).collect(Collectors.toList()); + } + + public static Collection toCollection(Collection collectionOne, Collection collectionTwo) { + return Stream.concat( + collectionOne.stream(), collectionTwo.stream() + ).collect(Collectors.toList()); + } + +} 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 ab586c6..417c6e6 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 @@ -7,10 +7,6 @@ import java.lang.reflect.Method; 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; import static dev.struchkov.haiti.utils.Exceptions.utilityClass; import static dev.struchkov.haiti.utils.Inspector.isNotNull; @@ -145,24 +141,4 @@ 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()); - } - - public static Collection toCollect(Collection collection, T... t) { - return Stream.concat( - collection.stream(), Arrays.stream(t) - ).collect(Collectors.toList()); - } - - public static Collection toCollect(Collection collectionOne, Collection collectionTwo) { - return Stream.concat( - collectionOne.stream(), collectionTwo.stream() - ).collect(Collectors.toList()); - } - } diff --git a/haiti-utils/src/main/java/dev/struchkov/haiti/utils/Parser.java b/haiti-utils/src/main/java/dev/struchkov/haiti/utils/Parser.java index 09922f2..6af7067 100644 --- a/haiti-utils/src/main/java/dev/struchkov/haiti/utils/Parser.java +++ b/haiti-utils/src/main/java/dev/struchkov/haiti/utils/Parser.java @@ -10,7 +10,7 @@ import static dev.struchkov.haiti.utils.Exceptions.utilityClass; public final class Parser { - private static Pattern URL_PARSE; + private static Pattern urlParse; private Parser() { utilityClass(); @@ -29,10 +29,10 @@ public final class Parser { } private static Pattern getUrlParse() { - if (checkNull(URL_PARSE)) { - URL_PARSE = Pattern.compile("(https?://)([^:^/]*)(:\\d*)?(.*)?"); + if (checkNull(urlParse)) { + urlParse = Pattern.compile("(https?://)([^:^/]*)(:\\d*)?(.*)?"); } - return URL_PARSE; + return urlParse; } } diff --git a/pom.xml b/pom.xml index 73138a1..ef96f12 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ dev.struchkov.haiti haiti - 1.1.0 + 1.2.0 pom Haiti Framework @@ -39,7 +39,7 @@ UTF-8 UTF-8 - 1.1.0 + 1.2.0 ${haiti.ver} ${haiti.ver}