forked from plusone/plusone-validator
refactor!: 重命名不同属性的 validator
`ValidatorOfComparable` 重命名为 `ComparablePropertyValidator` 更合适; 不同类型的属性的 validator,原本是 `类型+Validator` 的命名, 改为 `类型+PropertyValidator` 的格式;明确是用于校验 property 的。 Reviewed-on: plusone/plusone-validator#5 Co-authored-by: ZhouXY108 <luquanlion@outlook.com> Co-committed-by: ZhouXY108 <luquanlion@outlook.com>
This commit is contained in:
parent
818c8fb26f
commit
1b6925f65d
@ -45,50 +45,50 @@ public abstract class BaseValidator<T> {
|
|||||||
this.rules.add(rule);
|
this.rules.add(rule);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final <R> ObjectValidator<T, R> ruleFor(Function<T, R> getter) {
|
protected final <R> ObjectPropertyValidator<T, R> ruleFor(Function<T, R> getter) {
|
||||||
ObjectValidator<T, R> validator = new ObjectValidator<>(getter);
|
ObjectPropertyValidator<T, R> validator = new ObjectPropertyValidator<>(getter);
|
||||||
this.rules.add(validator::validate);
|
this.rules.add(validator::validate);
|
||||||
return validator;
|
return validator;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final <R extends Comparable<R>> DefaultValidatorOfComparable<T, R> ruleForComparable(Function<T, R> getter) {
|
protected final <R extends Comparable<R>> DefaultComparablePropertyValidator<T, R> ruleForComparable(Function<T, R> getter) {
|
||||||
DefaultValidatorOfComparable<T, R> validator = new DefaultValidatorOfComparable<>(getter);
|
DefaultComparablePropertyValidator<T, R> validator = new DefaultComparablePropertyValidator<>(getter);
|
||||||
this.rules.add(validator::validate);
|
this.rules.add(validator::validate);
|
||||||
return validator;
|
return validator;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final IntValidator<T> ruleForInt(Function<T, Integer> getter) {
|
protected final IntPropertyValidator<T> ruleForInt(Function<T, Integer> getter) {
|
||||||
IntValidator<T> validator = new IntValidator<>(getter);
|
IntPropertyValidator<T> validator = new IntPropertyValidator<>(getter);
|
||||||
this.rules.add(validator::validate);
|
this.rules.add(validator::validate);
|
||||||
return validator;
|
return validator;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final LongValidator<T> ruleForLong(Function<T, Long> getter) {
|
protected final LongPropertyValidator<T> ruleForLong(Function<T, Long> getter) {
|
||||||
LongValidator<T> validator = new LongValidator<>(getter);
|
LongPropertyValidator<T> validator = new LongPropertyValidator<>(getter);
|
||||||
this.rules.add(validator::validate);
|
this.rules.add(validator::validate);
|
||||||
return validator;
|
return validator;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final DoubleValidator<T> ruleForDouble(Function<T, Double> getter) {
|
protected final DoublePropertyValidator<T> ruleForDouble(Function<T, Double> getter) {
|
||||||
DoubleValidator<T> validator = new DoubleValidator<>(getter);
|
DoublePropertyValidator<T> validator = new DoublePropertyValidator<>(getter);
|
||||||
this.rules.add(validator::validate);
|
this.rules.add(validator::validate);
|
||||||
return validator;
|
return validator;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final BoolValidator<T> ruleForBool(Function<T, Boolean> getter) {
|
protected final BoolPropertyValidator<T> ruleForBool(Function<T, Boolean> getter) {
|
||||||
BoolValidator<T> validator = new BoolValidator<>(getter);
|
BoolPropertyValidator<T> validator = new BoolPropertyValidator<>(getter);
|
||||||
this.rules.add(validator::validate);
|
this.rules.add(validator::validate);
|
||||||
return validator;
|
return validator;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final StringValidator<T> ruleForString(Function<T, String> getter) {
|
protected final StringPropertyValidator<T> ruleForString(Function<T, String> getter) {
|
||||||
StringValidator<T> validator = new StringValidator<>(getter);
|
StringPropertyValidator<T> validator = new StringPropertyValidator<>(getter);
|
||||||
this.rules.add(validator::validate);
|
this.rules.add(validator::validate);
|
||||||
return validator;
|
return validator;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final <E> CollectionValidator<T, E> ruleForCollection(Function<T, Collection<E>> getter) {
|
protected final <E> CollectionPropertyValidator<T, E> ruleForCollection(Function<T, Collection<E>> getter) {
|
||||||
CollectionValidator<T, E> validator = new CollectionValidator<>(getter);
|
CollectionPropertyValidator<T, E> validator = new CollectionPropertyValidator<>(getter);
|
||||||
this.rules.add(validator::validate);
|
this.rules.add(validator::validate);
|
||||||
return validator;
|
return validator;
|
||||||
}
|
}
|
||||||
|
@ -3,27 +3,27 @@ package xyz.zhouxy.plusone.validator;
|
|||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
public class BoolValidator<DTO> extends BasePropertyValidator<DTO, Boolean, BoolValidator<DTO>> {
|
public class BoolPropertyValidator<DTO> extends BasePropertyValidator<DTO, Boolean, BoolPropertyValidator<DTO>> {
|
||||||
|
|
||||||
BoolValidator(Function<DTO, Boolean> getter) {
|
BoolPropertyValidator(Function<DTO, Boolean> getter) {
|
||||||
super(getter);
|
super(getter);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ====== isTrue ======
|
// ====== isTrue ======
|
||||||
|
|
||||||
public BoolValidator<DTO> isTrue() {
|
public BoolPropertyValidator<DTO> isTrue() {
|
||||||
return isTrue("The value must be true.");
|
return isTrue("The value must be true.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public BoolValidator<DTO> isTrue(String errMsg) {
|
public BoolPropertyValidator<DTO> isTrue(String errMsg) {
|
||||||
return isTrue(convertExceptionCreator(errMsg));
|
return isTrue(convertExceptionCreator(errMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> BoolValidator<DTO> isTrue(Supplier<E> exceptionCreator) {
|
public <E extends RuntimeException> BoolPropertyValidator<DTO> isTrue(Supplier<E> exceptionCreator) {
|
||||||
return isTrue(convertExceptionCreator(exceptionCreator));
|
return isTrue(convertExceptionCreator(exceptionCreator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> BoolValidator<DTO> isTrue(
|
public <E extends RuntimeException> BoolPropertyValidator<DTO> isTrue(
|
||||||
Function<Boolean, E> exceptionCreator) {
|
Function<Boolean, E> exceptionCreator) {
|
||||||
withRule(Boolean.TRUE::equals, exceptionCreator);
|
withRule(Boolean.TRUE::equals, exceptionCreator);
|
||||||
return this;
|
return this;
|
||||||
@ -31,26 +31,26 @@ public class BoolValidator<DTO> extends BasePropertyValidator<DTO, Boolean, Bool
|
|||||||
|
|
||||||
// ====== isFalse ======
|
// ====== isFalse ======
|
||||||
|
|
||||||
public BoolValidator<DTO> isFalse() {
|
public BoolPropertyValidator<DTO> isFalse() {
|
||||||
return isFalse("The value must be false.");
|
return isFalse("The value must be false.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public BoolValidator<DTO> isFalse(String errMsg) {
|
public BoolPropertyValidator<DTO> isFalse(String errMsg) {
|
||||||
return isFalse(convertExceptionCreator(errMsg));
|
return isFalse(convertExceptionCreator(errMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> BoolValidator<DTO> isFalse(Supplier<E> exceptionCreator) {
|
public <E extends RuntimeException> BoolPropertyValidator<DTO> isFalse(Supplier<E> exceptionCreator) {
|
||||||
return isFalse(convertExceptionCreator(exceptionCreator));
|
return isFalse(convertExceptionCreator(exceptionCreator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> BoolValidator<DTO> isFalse(
|
public <E extends RuntimeException> BoolPropertyValidator<DTO> isFalse(
|
||||||
Function<Boolean, E> exceptionCreator) {
|
Function<Boolean, E> exceptionCreator) {
|
||||||
withRule(Boolean.FALSE::equals, exceptionCreator);
|
withRule(Boolean.FALSE::equals, exceptionCreator);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BoolValidator<DTO> thisObject() {
|
protected BoolPropertyValidator<DTO> thisObject() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,24 +6,24 @@ import java.util.function.Supplier;
|
|||||||
|
|
||||||
import xyz.zhouxy.plusone.commons.collection.CollectionTools;
|
import xyz.zhouxy.plusone.commons.collection.CollectionTools;
|
||||||
|
|
||||||
public class CollectionValidator<DTO, T>
|
public class CollectionPropertyValidator<DTO, T>
|
||||||
extends BasePropertyValidator<DTO, Collection<T>, CollectionValidator<DTO, T>> {
|
extends BasePropertyValidator<DTO, Collection<T>, CollectionPropertyValidator<DTO, T>> {
|
||||||
|
|
||||||
CollectionValidator(Function<DTO, Collection<T>> getter) {
|
CollectionPropertyValidator(Function<DTO, Collection<T>> getter) {
|
||||||
super(getter);
|
super(getter);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ====== notEmpty =====
|
// ====== notEmpty =====
|
||||||
|
|
||||||
public CollectionValidator<DTO, T> notEmpty(String errMsg) {
|
public CollectionPropertyValidator<DTO, T> notEmpty(String errMsg) {
|
||||||
return notEmpty(convertExceptionCreator(errMsg));
|
return notEmpty(convertExceptionCreator(errMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> CollectionValidator<DTO, T> notEmpty(Supplier<E> exceptionCreator) {
|
public <E extends RuntimeException> CollectionPropertyValidator<DTO, T> notEmpty(Supplier<E> exceptionCreator) {
|
||||||
return notEmpty(convertExceptionCreator(exceptionCreator));
|
return notEmpty(convertExceptionCreator(exceptionCreator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> CollectionValidator<DTO, T> notEmpty(
|
public <E extends RuntimeException> CollectionPropertyValidator<DTO, T> notEmpty(
|
||||||
Function<Collection<T>, E> exceptionCreator) {
|
Function<Collection<T>, E> exceptionCreator) {
|
||||||
withRule(CollectionTools::isNotEmpty, exceptionCreator);
|
withRule(CollectionTools::isNotEmpty, exceptionCreator);
|
||||||
return this;
|
return this;
|
||||||
@ -31,22 +31,22 @@ public class CollectionValidator<DTO, T>
|
|||||||
|
|
||||||
// ====== isEmpty =====
|
// ====== isEmpty =====
|
||||||
|
|
||||||
public CollectionValidator<DTO, T> isEmpty(String errMsg) {
|
public CollectionPropertyValidator<DTO, T> isEmpty(String errMsg) {
|
||||||
return isEmpty(convertExceptionCreator(errMsg));
|
return isEmpty(convertExceptionCreator(errMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> CollectionValidator<DTO, T> isEmpty(Supplier<E> exceptionCreator) {
|
public <E extends RuntimeException> CollectionPropertyValidator<DTO, T> isEmpty(Supplier<E> exceptionCreator) {
|
||||||
return isEmpty(convertExceptionCreator(exceptionCreator));
|
return isEmpty(convertExceptionCreator(exceptionCreator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> CollectionValidator<DTO, T> isEmpty(
|
public <E extends RuntimeException> CollectionPropertyValidator<DTO, T> isEmpty(
|
||||||
Function<Collection<T>, E> exceptionCreator) {
|
Function<Collection<T>, E> exceptionCreator) {
|
||||||
withRule(CollectionTools::isEmpty, exceptionCreator);
|
withRule(CollectionTools::isEmpty, exceptionCreator);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CollectionValidator<DTO, T> thisObject() {
|
protected CollectionPropertyValidator<DTO, T> thisObject() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,12 +6,12 @@ import java.util.function.Supplier;
|
|||||||
import com.google.common.collect.Range;
|
import com.google.common.collect.Range;
|
||||||
|
|
||||||
public abstract
|
public abstract
|
||||||
class ValidatorOfComparable<TObj,
|
class ComparablePropertyValidator<TObj,
|
||||||
TProperty extends Comparable<TProperty>,
|
TProperty extends Comparable<TProperty>,
|
||||||
TPropertyValidator extends ValidatorOfComparable<TObj, TProperty, TPropertyValidator>>
|
TPropertyValidator extends ComparablePropertyValidator<TObj, TProperty, TPropertyValidator>>
|
||||||
extends BasePropertyValidator<TObj, TProperty, TPropertyValidator> {
|
extends BasePropertyValidator<TObj, TProperty, TPropertyValidator> {
|
||||||
|
|
||||||
ValidatorOfComparable(Function<TObj, ? extends TProperty> getter) {
|
ComparablePropertyValidator(Function<TObj, ? extends TProperty> getter) {
|
||||||
super(getter);
|
super(getter);
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
|||||||
|
package xyz.zhouxy.plusone.validator;
|
||||||
|
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
public class DefaultComparablePropertyValidator<TObj, TProperty extends Comparable<TProperty>>
|
||||||
|
extends ComparablePropertyValidator<TObj, TProperty, DefaultComparablePropertyValidator<TObj, TProperty>> {
|
||||||
|
|
||||||
|
DefaultComparablePropertyValidator(Function<TObj, ? extends TProperty> getter) {
|
||||||
|
super(getter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected DefaultComparablePropertyValidator<TObj, TProperty> thisObject() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
@ -1,18 +0,0 @@
|
|||||||
package xyz.zhouxy.plusone.validator;
|
|
||||||
|
|
||||||
import java.util.function.Function;
|
|
||||||
|
|
||||||
public class DefaultValidatorOfComparable<
|
|
||||||
TObj,
|
|
||||||
TProperty extends Comparable<TProperty>
|
|
||||||
> extends ValidatorOfComparable<TObj, TProperty, DefaultValidatorOfComparable<TObj, TProperty>> {
|
|
||||||
|
|
||||||
DefaultValidatorOfComparable(Function<TObj, ? extends TProperty> getter) {
|
|
||||||
super(getter);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected DefaultValidatorOfComparable<TObj, TProperty> thisObject() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
@ -3,33 +3,33 @@ package xyz.zhouxy.plusone.validator;
|
|||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
public class DoubleValidator<DTO> extends ValidatorOfComparable<DTO, Double, DoubleValidator<DTO>> {
|
public class DoublePropertyValidator<DTO> extends ComparablePropertyValidator<DTO, Double, DoublePropertyValidator<DTO>> {
|
||||||
|
|
||||||
DoubleValidator(Function<DTO, Double> getter) {
|
DoublePropertyValidator(Function<DTO, Double> getter) {
|
||||||
super(getter);
|
super(getter);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DoubleValidator<DTO> between(double min, double max) {
|
public DoublePropertyValidator<DTO> between(double min, double max) {
|
||||||
return between(min, max, String.format("数值不在 %s 和 %s 之间", String.valueOf(min), String.valueOf(max)));
|
return between(min, max, String.format("数值不在 %s 和 %s 之间", String.valueOf(min), String.valueOf(max)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public DoubleValidator<DTO> between(double min, double max, String errMsg) {
|
public DoublePropertyValidator<DTO> between(double min, double max, String errMsg) {
|
||||||
return between(min, max, convertExceptionCreator(errMsg));
|
return between(min, max, convertExceptionCreator(errMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> DoubleValidator<DTO> between(double min, double max,
|
public <E extends RuntimeException> DoublePropertyValidator<DTO> between(double min, double max,
|
||||||
Supplier<E> exceptionCreator) {
|
Supplier<E> exceptionCreator) {
|
||||||
return between(min, max, convertExceptionCreator(exceptionCreator));
|
return between(min, max, convertExceptionCreator(exceptionCreator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> DoubleValidator<DTO> between(double min, double max,
|
public <E extends RuntimeException> DoublePropertyValidator<DTO> between(double min, double max,
|
||||||
Function<Double, E> exceptionCreator) {
|
Function<Double, E> exceptionCreator) {
|
||||||
withRule(value -> (value >= min && value < max), exceptionCreator);
|
withRule(value -> (value >= min && value < max), exceptionCreator);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected DoubleValidator<DTO> thisObject() {
|
protected DoublePropertyValidator<DTO> thisObject() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,33 +3,33 @@ package xyz.zhouxy.plusone.validator;
|
|||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
public class IntValidator<DTO> extends ValidatorOfComparable<DTO, Integer, IntValidator<DTO>> {
|
public class IntPropertyValidator<DTO> extends ComparablePropertyValidator<DTO, Integer, IntPropertyValidator<DTO>> {
|
||||||
|
|
||||||
IntValidator(Function<DTO, Integer> getter) {
|
IntPropertyValidator(Function<DTO, Integer> getter) {
|
||||||
super(getter);
|
super(getter);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IntValidator<DTO> between(int min, int max) {
|
public IntPropertyValidator<DTO> between(int min, int max) {
|
||||||
return between(min, max, String.format("数值不在 %d 和 %d 之间", min, max));
|
return between(min, max, String.format("数值不在 %d 和 %d 之间", min, max));
|
||||||
}
|
}
|
||||||
|
|
||||||
public IntValidator<DTO> between(int min, int max, String errMsg) {
|
public IntPropertyValidator<DTO> between(int min, int max, String errMsg) {
|
||||||
return between(min, max, convertExceptionCreator(errMsg));
|
return between(min, max, convertExceptionCreator(errMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> IntValidator<DTO> between(int min, int max,
|
public <E extends RuntimeException> IntPropertyValidator<DTO> between(int min, int max,
|
||||||
Supplier<E> exceptionCreator) {
|
Supplier<E> exceptionCreator) {
|
||||||
return between(min, max, convertExceptionCreator(exceptionCreator));
|
return between(min, max, convertExceptionCreator(exceptionCreator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> IntValidator<DTO> between(int min, int max,
|
public <E extends RuntimeException> IntPropertyValidator<DTO> between(int min, int max,
|
||||||
Function<Integer, E> exceptionCreator) {
|
Function<Integer, E> exceptionCreator) {
|
||||||
withRule(value -> (value >= min && value < max), exceptionCreator);
|
withRule(value -> (value >= min && value < max), exceptionCreator);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected IntValidator<DTO> thisObject() {
|
protected IntPropertyValidator<DTO> thisObject() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,33 +3,33 @@ package xyz.zhouxy.plusone.validator;
|
|||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
public class LongValidator<DTO> extends ValidatorOfComparable<DTO, Long, LongValidator<DTO>> {
|
public class LongPropertyValidator<DTO> extends ComparablePropertyValidator<DTO, Long, LongPropertyValidator<DTO>> {
|
||||||
|
|
||||||
LongValidator(Function<DTO, Long> getter) {
|
LongPropertyValidator(Function<DTO, Long> getter) {
|
||||||
super(getter);
|
super(getter);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LongValidator<DTO> between(long min, long max) {
|
public LongPropertyValidator<DTO> between(long min, long max) {
|
||||||
return between(min, max, String.format("数值不在 %d 和 %d 之间", min, max));
|
return between(min, max, String.format("数值不在 %d 和 %d 之间", min, max));
|
||||||
}
|
}
|
||||||
|
|
||||||
public LongValidator<DTO> between(long min, long max, String errMsg) {
|
public LongPropertyValidator<DTO> between(long min, long max, String errMsg) {
|
||||||
return between(min, max, convertExceptionCreator(errMsg));
|
return between(min, max, convertExceptionCreator(errMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> LongValidator<DTO> between(long min, long max,
|
public <E extends RuntimeException> LongPropertyValidator<DTO> between(long min, long max,
|
||||||
Supplier<E> exceptionCreator) {
|
Supplier<E> exceptionCreator) {
|
||||||
return between(min, max, convertExceptionCreator(exceptionCreator));
|
return between(min, max, convertExceptionCreator(exceptionCreator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> LongValidator<DTO> between(long min, long max,
|
public <E extends RuntimeException> LongPropertyValidator<DTO> between(long min, long max,
|
||||||
Function<Long, E> exceptionCreator) {
|
Function<Long, E> exceptionCreator) {
|
||||||
withRule(value -> (value >= min && value < max), exceptionCreator);
|
withRule(value -> (value >= min && value < max), exceptionCreator);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected LongValidator<DTO> thisObject() {
|
protected LongPropertyValidator<DTO> thisObject() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -43,31 +43,31 @@ public abstract class MapValidator<K, V> extends BaseValidator<Map<K, V>> {
|
|||||||
|
|
||||||
// ========== ruleFor ==========
|
// ========== ruleFor ==========
|
||||||
|
|
||||||
protected final ObjectValidator<Map<K, V>, V> ruleFor(K key) {
|
protected final ObjectPropertyValidator<Map<K, V>, V> ruleFor(K key) {
|
||||||
return ruleFor(m -> m.get(key));
|
return ruleFor(m -> m.get(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final IntValidator<Map<K, V>> ruleForInt(K key) {
|
protected final IntPropertyValidator<Map<K, V>> ruleForInt(K key) {
|
||||||
return ruleForInt(m -> (Integer) m.get(key));
|
return ruleForInt(m -> (Integer) m.get(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final LongValidator<Map<K, V>> ruleForLong(K key) {
|
protected final LongPropertyValidator<Map<K, V>> ruleForLong(K key) {
|
||||||
return ruleForLong(m -> (Long) m.get(key));
|
return ruleForLong(m -> (Long) m.get(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final DoubleValidator<Map<K, V>> ruleForDouble(K key) {
|
protected final DoublePropertyValidator<Map<K, V>> ruleForDouble(K key) {
|
||||||
return ruleForDouble(m -> (Double) m.get(key));
|
return ruleForDouble(m -> (Double) m.get(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final BoolValidator<Map<K, V>> ruleForBool(K key) {
|
protected final BoolPropertyValidator<Map<K, V>> ruleForBool(K key) {
|
||||||
return ruleForBool(m -> (Boolean) m.get(key));
|
return ruleForBool(m -> (Boolean) m.get(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final StringValidator<Map<K, V>> ruleForString(K key) {
|
protected final StringPropertyValidator<Map<K, V>> ruleForString(K key) {
|
||||||
return ruleForString(m -> (String) m.get(key));
|
return ruleForString(m -> (String) m.get(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final <E> CollectionValidator<Map<K, V>, E> ruleForCollection(K key) {
|
protected final <E> CollectionPropertyValidator<Map<K, V>, E> ruleForCollection(K key) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Function<Map<K, V>, Collection<E>> getter = m -> (Collection<E>) m.get(key);
|
Function<Map<K, V>, Collection<E>> getter = m -> (Collection<E>) m.get(key);
|
||||||
return ruleForCollection(getter);
|
return ruleForCollection(getter);
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
package xyz.zhouxy.plusone.validator;
|
||||||
|
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
public class ObjectPropertyValidator<DTO, T> extends BasePropertyValidator<DTO, T, ObjectPropertyValidator<DTO, T>> {
|
||||||
|
|
||||||
|
ObjectPropertyValidator(Function<DTO, T> getter) {
|
||||||
|
super(getter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ObjectPropertyValidator<DTO, T> thisObject() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
@ -1,15 +0,0 @@
|
|||||||
package xyz.zhouxy.plusone.validator;
|
|
||||||
|
|
||||||
import java.util.function.Function;
|
|
||||||
|
|
||||||
public class ObjectValidator<DTO, T> extends BasePropertyValidator<DTO, T, ObjectValidator<DTO, T>> {
|
|
||||||
|
|
||||||
ObjectValidator(Function<DTO, T> getter) {
|
|
||||||
super(getter);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected ObjectValidator<DTO, T> thisObject() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
@ -12,7 +12,7 @@ import xyz.zhouxy.plusone.commons.util.RegexTools;
|
|||||||
import xyz.zhouxy.plusone.commons.util.StringTools;
|
import xyz.zhouxy.plusone.commons.util.StringTools;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* StringValidator
|
* StringPropertyValidator
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* 针对文本字段的验证器。
|
* 针对文本字段的验证器。
|
||||||
@ -20,9 +20,9 @@ import xyz.zhouxy.plusone.commons.util.StringTools;
|
|||||||
*
|
*
|
||||||
* @author <a href="http://zhouxy.xyz:3000/ZhouXY108">ZhouXY</a>
|
* @author <a href="http://zhouxy.xyz:3000/ZhouXY108">ZhouXY</a>
|
||||||
*/
|
*/
|
||||||
public class StringValidator<DTO> extends ValidatorOfComparable<DTO, String, StringValidator<DTO>> {
|
public class StringPropertyValidator<DTO> extends ComparablePropertyValidator<DTO, String, StringPropertyValidator<DTO>> {
|
||||||
|
|
||||||
StringValidator(Function<DTO, String> getter) {
|
StringPropertyValidator(Function<DTO, String> getter) {
|
||||||
super(getter);
|
super(getter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,17 +30,17 @@ public class StringValidator<DTO> extends ValidatorOfComparable<DTO, String, Str
|
|||||||
// #region - matches
|
// #region - matches
|
||||||
// ================================
|
// ================================
|
||||||
|
|
||||||
public StringValidator<DTO> matches(Pattern regex, String errMsg) {
|
public StringPropertyValidator<DTO> matches(Pattern regex, String errMsg) {
|
||||||
return matches(regex, convertExceptionCreator(errMsg));
|
return matches(regex, convertExceptionCreator(errMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> matches(
|
public <E extends RuntimeException> StringPropertyValidator<DTO> matches(
|
||||||
Pattern regex,
|
Pattern regex,
|
||||||
Supplier<E> exceptionCreator) {
|
Supplier<E> exceptionCreator) {
|
||||||
return matches(regex, convertExceptionCreator(exceptionCreator));
|
return matches(regex, convertExceptionCreator(exceptionCreator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> matches(
|
public <E extends RuntimeException> StringPropertyValidator<DTO> matches(
|
||||||
Pattern regex,
|
Pattern regex,
|
||||||
Function<String, E> exceptionCreator) {
|
Function<String, E> exceptionCreator) {
|
||||||
withRule(input -> RegexTools.matches(input, regex), exceptionCreator);
|
withRule(input -> RegexTools.matches(input, regex), exceptionCreator);
|
||||||
@ -55,34 +55,34 @@ public class StringValidator<DTO> extends ValidatorOfComparable<DTO, String, Str
|
|||||||
// #region - matchesOne
|
// #region - matchesOne
|
||||||
// ================================
|
// ================================
|
||||||
|
|
||||||
public StringValidator<DTO> matchesOne(Pattern[] regexs, String errMsg) {
|
public StringPropertyValidator<DTO> matchesOne(Pattern[] regexs, String errMsg) {
|
||||||
return matchesOne(regexs, convertExceptionCreator(errMsg));
|
return matchesOne(regexs, convertExceptionCreator(errMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> matchesOne(
|
public <E extends RuntimeException> StringPropertyValidator<DTO> matchesOne(
|
||||||
Pattern[] regexs,
|
Pattern[] regexs,
|
||||||
Supplier<E> exceptionCreator) {
|
Supplier<E> exceptionCreator) {
|
||||||
return matchesOne(regexs, convertExceptionCreator(exceptionCreator));
|
return matchesOne(regexs, convertExceptionCreator(exceptionCreator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> matchesOne(
|
public <E extends RuntimeException> StringPropertyValidator<DTO> matchesOne(
|
||||||
Pattern[] regexs,
|
Pattern[] regexs,
|
||||||
Function<String, E> exceptionCreator) {
|
Function<String, E> exceptionCreator) {
|
||||||
withRule(input -> RegexTools.matchesOne(input, regexs), exceptionCreator);
|
withRule(input -> RegexTools.matchesOne(input, regexs), exceptionCreator);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringValidator<DTO> matchesOne(List<Pattern> regexs, String errMsg) {
|
public StringPropertyValidator<DTO> matchesOne(List<Pattern> regexs, String errMsg) {
|
||||||
return matchesOne(regexs, convertExceptionCreator(errMsg));
|
return matchesOne(regexs, convertExceptionCreator(errMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> matchesOne(
|
public <E extends RuntimeException> StringPropertyValidator<DTO> matchesOne(
|
||||||
List<Pattern> regexs,
|
List<Pattern> regexs,
|
||||||
Supplier<E> exceptionCreator) {
|
Supplier<E> exceptionCreator) {
|
||||||
return matchesOne(regexs, convertExceptionCreator(exceptionCreator));
|
return matchesOne(regexs, convertExceptionCreator(exceptionCreator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> matchesOne(
|
public <E extends RuntimeException> StringPropertyValidator<DTO> matchesOne(
|
||||||
List<Pattern> regexs,
|
List<Pattern> regexs,
|
||||||
Function<String, E> exceptionCreator) {
|
Function<String, E> exceptionCreator) {
|
||||||
withRule(input -> RegexTools.matchesOne(input, regexs.toArray(new Pattern[regexs.size()])), exceptionCreator);
|
withRule(input -> RegexTools.matchesOne(input, regexs.toArray(new Pattern[regexs.size()])), exceptionCreator);
|
||||||
@ -97,34 +97,34 @@ public class StringValidator<DTO> extends ValidatorOfComparable<DTO, String, Str
|
|||||||
// #region - matchesAll
|
// #region - matchesAll
|
||||||
// ================================
|
// ================================
|
||||||
|
|
||||||
public StringValidator<DTO> matchesAll(Pattern[] regexs, String errMsg) {
|
public StringPropertyValidator<DTO> matchesAll(Pattern[] regexs, String errMsg) {
|
||||||
return matchesAll(regexs, convertExceptionCreator(errMsg));
|
return matchesAll(regexs, convertExceptionCreator(errMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> matchesAll(
|
public <E extends RuntimeException> StringPropertyValidator<DTO> matchesAll(
|
||||||
Pattern[] regexs,
|
Pattern[] regexs,
|
||||||
Supplier<E> exceptionCreator) {
|
Supplier<E> exceptionCreator) {
|
||||||
return matchesAll(regexs, convertExceptionCreator(exceptionCreator));
|
return matchesAll(regexs, convertExceptionCreator(exceptionCreator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> matchesAll(
|
public <E extends RuntimeException> StringPropertyValidator<DTO> matchesAll(
|
||||||
Pattern[] regexs,
|
Pattern[] regexs,
|
||||||
Function<String, E> exceptionCreator) {
|
Function<String, E> exceptionCreator) {
|
||||||
withRule(input -> RegexTools.matchesAll(input, regexs), exceptionCreator);
|
withRule(input -> RegexTools.matchesAll(input, regexs), exceptionCreator);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringValidator<DTO> matchesAll(Collection<Pattern> regexs, String errMsg) {
|
public StringPropertyValidator<DTO> matchesAll(Collection<Pattern> regexs, String errMsg) {
|
||||||
return matchesAll(regexs, convertExceptionCreator(errMsg));
|
return matchesAll(regexs, convertExceptionCreator(errMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> matchesAll(
|
public <E extends RuntimeException> StringPropertyValidator<DTO> matchesAll(
|
||||||
Collection<Pattern> regexs,
|
Collection<Pattern> regexs,
|
||||||
Supplier<E> exceptionCreator) {
|
Supplier<E> exceptionCreator) {
|
||||||
return matchesAll(regexs, convertExceptionCreator(exceptionCreator));
|
return matchesAll(regexs, convertExceptionCreator(exceptionCreator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> matchesAll(
|
public <E extends RuntimeException> StringPropertyValidator<DTO> matchesAll(
|
||||||
Collection<Pattern> regexs,
|
Collection<Pattern> regexs,
|
||||||
Function<String, E> exceptionCreator) {
|
Function<String, E> exceptionCreator) {
|
||||||
withRule(input -> RegexTools.matchesAll(input, regexs.toArray(new Pattern[regexs.size()])), exceptionCreator);
|
withRule(input -> RegexTools.matchesAll(input, regexs.toArray(new Pattern[regexs.size()])), exceptionCreator);
|
||||||
@ -139,19 +139,19 @@ public class StringValidator<DTO> extends ValidatorOfComparable<DTO, String, Str
|
|||||||
// #region - notBlank
|
// #region - notBlank
|
||||||
// ================================
|
// ================================
|
||||||
|
|
||||||
public StringValidator<DTO> notBlank() {
|
public StringPropertyValidator<DTO> notBlank() {
|
||||||
return notBlank("This String argument must have text; it must not be null, empty, or blank");
|
return notBlank("This String argument must have text; it must not be null, empty, or blank");
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringValidator<DTO> notBlank(String errMsg) {
|
public StringPropertyValidator<DTO> notBlank(String errMsg) {
|
||||||
return notBlank(convertExceptionCreator(errMsg));
|
return notBlank(convertExceptionCreator(errMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> notBlank(Supplier<E> exceptionCreator) {
|
public <E extends RuntimeException> StringPropertyValidator<DTO> notBlank(Supplier<E> exceptionCreator) {
|
||||||
return notBlank(convertExceptionCreator(exceptionCreator));
|
return notBlank(convertExceptionCreator(exceptionCreator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> notBlank(
|
public <E extends RuntimeException> StringPropertyValidator<DTO> notBlank(
|
||||||
Function<String, E> exceptionCreator) {
|
Function<String, E> exceptionCreator) {
|
||||||
withRule(StringTools::isNotBlank, exceptionCreator);
|
withRule(StringTools::isNotBlank, exceptionCreator);
|
||||||
return this;
|
return this;
|
||||||
@ -165,19 +165,19 @@ public class StringValidator<DTO> extends ValidatorOfComparable<DTO, String, Str
|
|||||||
// #region - email
|
// #region - email
|
||||||
// ================================
|
// ================================
|
||||||
|
|
||||||
public StringValidator<DTO> email() {
|
public StringPropertyValidator<DTO> email() {
|
||||||
return email("The value is not an email address.");
|
return email("The value is not an email address.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringValidator<DTO> email(String errMsg) {
|
public StringPropertyValidator<DTO> email(String errMsg) {
|
||||||
return email(convertExceptionCreator(errMsg));
|
return email(convertExceptionCreator(errMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> email(Supplier<E> exceptionCreator) {
|
public <E extends RuntimeException> StringPropertyValidator<DTO> email(Supplier<E> exceptionCreator) {
|
||||||
return email(convertExceptionCreator(exceptionCreator));
|
return email(convertExceptionCreator(exceptionCreator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> email(Function<String, E> exceptionCreator) {
|
public <E extends RuntimeException> StringPropertyValidator<DTO> email(Function<String, E> exceptionCreator) {
|
||||||
// TODO [优化] 优化 email 校验
|
// TODO [优化] 优化 email 校验
|
||||||
return matches(PatternConsts.EMAIL, exceptionCreator);
|
return matches(PatternConsts.EMAIL, exceptionCreator);
|
||||||
}
|
}
|
||||||
@ -190,15 +190,15 @@ public class StringValidator<DTO> extends ValidatorOfComparable<DTO, String, Str
|
|||||||
// #region - notEmpty
|
// #region - notEmpty
|
||||||
// ================================
|
// ================================
|
||||||
|
|
||||||
public StringValidator<DTO> notEmpty(String errMsg) {
|
public StringPropertyValidator<DTO> notEmpty(String errMsg) {
|
||||||
return notEmpty(convertExceptionCreator(errMsg));
|
return notEmpty(convertExceptionCreator(errMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> notEmpty(Supplier<E> exceptionCreator) {
|
public <E extends RuntimeException> StringPropertyValidator<DTO> notEmpty(Supplier<E> exceptionCreator) {
|
||||||
return notEmpty(convertExceptionCreator(exceptionCreator));
|
return notEmpty(convertExceptionCreator(exceptionCreator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> notEmpty(
|
public <E extends RuntimeException> StringPropertyValidator<DTO> notEmpty(
|
||||||
Function<String, E> exceptionCreator) {
|
Function<String, E> exceptionCreator) {
|
||||||
withRule(s -> s != null && !s.isEmpty(), exceptionCreator);
|
withRule(s -> s != null && !s.isEmpty(), exceptionCreator);
|
||||||
return this;
|
return this;
|
||||||
@ -212,15 +212,15 @@ public class StringValidator<DTO> extends ValidatorOfComparable<DTO, String, Str
|
|||||||
// #region - isNullOrEmpty
|
// #region - isNullOrEmpty
|
||||||
// ================================
|
// ================================
|
||||||
|
|
||||||
public StringValidator<DTO> isNullOrEmpty(String errMsg) {
|
public StringPropertyValidator<DTO> isNullOrEmpty(String errMsg) {
|
||||||
return isNullOrEmpty(convertExceptionCreator(errMsg));
|
return isNullOrEmpty(convertExceptionCreator(errMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> isNullOrEmpty(Supplier<E> exceptionCreator) {
|
public <E extends RuntimeException> StringPropertyValidator<DTO> isNullOrEmpty(Supplier<E> exceptionCreator) {
|
||||||
return isNullOrEmpty(convertExceptionCreator(exceptionCreator));
|
return isNullOrEmpty(convertExceptionCreator(exceptionCreator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> isNullOrEmpty(
|
public <E extends RuntimeException> StringPropertyValidator<DTO> isNullOrEmpty(
|
||||||
Function<String, E> exceptionCreator) {
|
Function<String, E> exceptionCreator) {
|
||||||
withRule(s -> s == null || s.isEmpty(), exceptionCreator);
|
withRule(s -> s == null || s.isEmpty(), exceptionCreator);
|
||||||
return this;
|
return this;
|
||||||
@ -234,16 +234,16 @@ public class StringValidator<DTO> extends ValidatorOfComparable<DTO, String, Str
|
|||||||
// #region - length
|
// #region - length
|
||||||
// ================================
|
// ================================
|
||||||
|
|
||||||
public StringValidator<DTO> length(int length, String errMsg) {
|
public StringPropertyValidator<DTO> length(int length, String errMsg) {
|
||||||
return length(length, convertExceptionCreator(errMsg));
|
return length(length, convertExceptionCreator(errMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> length(int length,
|
public <E extends RuntimeException> StringPropertyValidator<DTO> length(int length,
|
||||||
Supplier<E> exceptionCreator) {
|
Supplier<E> exceptionCreator) {
|
||||||
return length(length, convertExceptionCreator(exceptionCreator));
|
return length(length, convertExceptionCreator(exceptionCreator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> length(int length,
|
public <E extends RuntimeException> StringPropertyValidator<DTO> length(int length,
|
||||||
Function<String, E> exceptionCreator) {
|
Function<String, E> exceptionCreator) {
|
||||||
AssertTools.checkArgument(length >= 0, "The minimum value must be less than the maximum value.");
|
AssertTools.checkArgument(length >= 0, "The minimum value must be less than the maximum value.");
|
||||||
withRule(s -> s != null && s.length() == length, exceptionCreator);
|
withRule(s -> s != null && s.length() == length, exceptionCreator);
|
||||||
@ -258,16 +258,16 @@ public class StringValidator<DTO> extends ValidatorOfComparable<DTO, String, Str
|
|||||||
return len >= min && len < max;
|
return len >= min && len < max;
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringValidator<DTO> length(int min, int max, String errMsg) {
|
public StringPropertyValidator<DTO> length(int min, int max, String errMsg) {
|
||||||
return length(min, max, convertExceptionCreator(errMsg));
|
return length(min, max, convertExceptionCreator(errMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> length(int min, int max,
|
public <E extends RuntimeException> StringPropertyValidator<DTO> length(int min, int max,
|
||||||
Supplier<E> exceptionCreator) {
|
Supplier<E> exceptionCreator) {
|
||||||
return length(min, max, convertExceptionCreator(exceptionCreator));
|
return length(min, max, convertExceptionCreator(exceptionCreator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringValidator<DTO> length(int min, int max,
|
public <E extends RuntimeException> StringPropertyValidator<DTO> length(int min, int max,
|
||||||
Function<String, E> exceptionCreator) {
|
Function<String, E> exceptionCreator) {
|
||||||
AssertTools.checkArgument(min >= 0, "The minimum value must be greater than equal to 0.");
|
AssertTools.checkArgument(min >= 0, "The minimum value must be greater than equal to 0.");
|
||||||
AssertTools.checkArgument(min < max, "The minimum value must be less than the maximum value.");
|
AssertTools.checkArgument(min < max, "The minimum value must be less than the maximum value.");
|
||||||
@ -280,7 +280,7 @@ public class StringValidator<DTO> extends ValidatorOfComparable<DTO, String, Str
|
|||||||
// ================================
|
// ================================
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected StringValidator<DTO> thisObject() {
|
protected StringPropertyValidator<DTO> thisObject() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user