forked from plusone/plusone-commons
删除 jackson-annotations 依赖。
parent
292e982ab2
commit
b08562adaf
7
pom.xml
7
pom.xml
|
@ -13,7 +13,6 @@
|
|||
<java.version>8</java.version>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<jackson.version>2.13.5</jackson.version>
|
||||
<commons-lang3.version>3.13.0</commons-lang3.version>
|
||||
<guava.version>32.1.3-jre</guava.version>
|
||||
<google-jsr305.version>3.0.2</google-jsr305.version>
|
||||
|
@ -21,12 +20,6 @@
|
|||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
|
||||
package xyz.zhouxy.plusone.commons.domain;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import xyz.zhouxy.plusone.commons.util.RegexTools;
|
||||
|
@ -37,7 +37,7 @@ public abstract class ValidatableStringRecord
|
|||
|
||||
protected ValidatableStringRecord(String value, Pattern pattern) {
|
||||
Preconditions.checkNotNull(pattern, "The pattern must not be null.");
|
||||
Preconditions.checkArgument(StringUtils.isNotBlank(value), "The value must be has text.");
|
||||
Preconditions.checkNotNull(StringUtils.isNotBlank(value), "The value must not be null.");
|
||||
Preconditions.checkArgument(RegexTools.matches(value, pattern));
|
||||
this.value = value;
|
||||
}
|
||||
|
@ -47,7 +47,6 @@ public abstract class ValidatableStringRecord
|
|||
*
|
||||
* @return 字符串(不为空)
|
||||
*/
|
||||
@JsonValue
|
||||
public final String value() {
|
||||
return this.value;
|
||||
}
|
||||
|
@ -57,6 +56,23 @@ public abstract class ValidatableStringRecord
|
|||
return this.value.compareTo(o.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
ValidatableStringRecord other = (ValidatableStringRecord) obj;
|
||||
return Objects.equals(value, other.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.value();
|
||||
|
|
|
@ -21,7 +21,6 @@ import java.util.function.Supplier;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
/**
|
||||
|
@ -31,7 +30,6 @@ import com.google.common.base.Preconditions;
|
|||
* @deprecated 已被 {@link UnifiedResponse} 代替。
|
||||
*/
|
||||
@Deprecated
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class RestfulResult {
|
||||
|
||||
public static final int SUCCESS_STATUS = 2000000;
|
||||
|
|
Loading…
Reference in New Issue