Небольшой рефакторинг
This commit is contained in:
parent
e8867426ad
commit
fb9d8a0f6e
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>dev.struchkov.haiti</groupId>
|
<groupId>dev.struchkov.haiti</groupId>
|
||||||
<artifactId>haiti-bom</artifactId>
|
<artifactId>haiti-bom</artifactId>
|
||||||
<version>1.2.0</version>
|
<version>1.3.0</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<name>Haiti BOM</name>
|
<name>Haiti BOM</name>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
|
||||||
<haiti.ver>1.2.0</haiti.ver>
|
<haiti.ver>${project.version}</haiti.ver>
|
||||||
|
|
||||||
<haiti.exception.ver>${haiti.ver}</haiti.exception.ver>
|
<haiti.exception.ver>${haiti.ver}</haiti.exception.ver>
|
||||||
<haiti.context.ver>${haiti.ver}</haiti.context.ver>
|
<haiti.context.ver>${haiti.ver}</haiti.context.ver>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>dev.struchkov.haiti</groupId>
|
<groupId>dev.struchkov.haiti</groupId>
|
||||||
<artifactId>haiti</artifactId>
|
<artifactId>haiti</artifactId>
|
||||||
<version>1.2.0</version>
|
<version>1.3.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>haiti-context</artifactId>
|
<artifactId>haiti-context</artifactId>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>dev.struchkov.haiti</groupId>
|
<groupId>dev.struchkov.haiti</groupId>
|
||||||
<artifactId>haiti</artifactId>
|
<artifactId>haiti</artifactId>
|
||||||
<version>1.2.0</version>
|
<version>1.3.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>haiti-core</artifactId>
|
<artifactId>haiti-core</artifactId>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>dev.struchkov.haiti</groupId>
|
<groupId>dev.struchkov.haiti</groupId>
|
||||||
<artifactId>haiti</artifactId>
|
<artifactId>haiti</artifactId>
|
||||||
<version>1.2.0</version>
|
<version>1.3.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>haiti-exception</artifactId>
|
<artifactId>haiti-exception</artifactId>
|
||||||
|
@ -12,7 +12,7 @@ public class AccessException extends BasicException {
|
|||||||
super(message);
|
super(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Supplier<AccessException> supplier(String message, Object... objects) {
|
public static Supplier<AccessException> accessException(String message, Object... objects) {
|
||||||
return () -> new AccessException(MessageFormat.format(message, objects));
|
return () -> new AccessException(MessageFormat.format(message, objects));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ public class ConvertException extends BasicException {
|
|||||||
super(message, cause);
|
super(message, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Supplier<ConvertException> supplier(String message, Object... objects) {
|
public static Supplier<ConvertException> convertException(String message, Object... objects) {
|
||||||
return () -> new ConvertException(MessageFormat.format(message, objects));
|
return () -> new ConvertException(MessageFormat.format(message, objects));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ public class CreateException extends BasicException {
|
|||||||
super(message);
|
super(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Supplier<CreateException> supplier(String message, Object... objects) {
|
public static Supplier<CreateException> createException(String message, Object... objects) {
|
||||||
return () -> new CreateException(MessageFormat.format(message, objects));
|
return () -> new CreateException(MessageFormat.format(message, objects));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>dev.struchkov.haiti</groupId>
|
<groupId>dev.struchkov.haiti</groupId>
|
||||||
<artifactId>haiti</artifactId>
|
<artifactId>haiti</artifactId>
|
||||||
<version>1.2.0</version>
|
<version>1.3.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>haiti-filter</artifactId>
|
<artifactId>haiti-filter</artifactId>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>dev.struchkov.haiti</groupId>
|
<groupId>dev.struchkov.haiti</groupId>
|
||||||
<artifactId>haiti</artifactId>
|
<artifactId>haiti</artifactId>
|
||||||
<version>1.2.0</version>
|
<version>1.3.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<name>Haiti Utils</name>
|
<name>Haiti Utils</name>
|
||||||
|
@ -3,6 +3,7 @@ package dev.struchkov.haiti.utils;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import static dev.struchkov.haiti.utils.Exceptions.utilityClass;
|
import static dev.struchkov.haiti.utils.Exceptions.utilityClass;
|
||||||
|
import static dev.struchkov.haiti.utils.Strings.EMPTY;
|
||||||
|
|
||||||
public final class Checker {
|
public final class Checker {
|
||||||
|
|
||||||
@ -40,6 +41,10 @@ public final class Checker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean checkNotEmpty(String s) {
|
||||||
|
return !EMPTY.equals(s);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Проверка коллекции на пустоту.
|
* Проверка коллекции на пустоту.
|
||||||
*
|
*
|
||||||
@ -58,6 +63,10 @@ public final class Checker {
|
|||||||
return args == null || args.length == 0;
|
return args == null || args.length == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean checkEmpty(String s) {
|
||||||
|
return EMPTY.equals(s);
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean checkLong(String s) {
|
public static boolean checkLong(String s) {
|
||||||
try {
|
try {
|
||||||
Long.parseLong(s);
|
Long.parseLong(s);
|
||||||
|
4
pom.xml
4
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>dev.struchkov.haiti</groupId>
|
<groupId>dev.struchkov.haiti</groupId>
|
||||||
<artifactId>haiti</artifactId>
|
<artifactId>haiti</artifactId>
|
||||||
<version>1.2.0</version>
|
<version>1.3.0</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<name>Haiti Framework</name>
|
<name>Haiti Framework</name>
|
||||||
@ -39,7 +39,7 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
|
||||||
<haiti.ver>1.2.0</haiti.ver>
|
<haiti.ver>1.3.0</haiti.ver>
|
||||||
|
|
||||||
<haiti.bom.ver>${haiti.ver}</haiti.bom.ver>
|
<haiti.bom.ver>${haiti.ver}</haiti.bom.ver>
|
||||||
<haiti.exception.ver>${haiti.ver}</haiti.exception.ver>
|
<haiti.exception.ver>${haiti.ver}</haiti.exception.ver>
|
||||||
|
Loading…
Reference in New Issue
Block a user