修改方法名。

This commit is contained in:
2023-01-05 14:56:17 +08:00
parent 2768e4eb2b
commit 40f30f88a1
9 changed files with 17 additions and 21 deletions

View File

@@ -50,7 +50,7 @@ public class BoolValidator<DTO> extends PropertyValidator<DTO, Boolean, BoolVali
}
@Override
protected BoolValidator<DTO> returnThis() {
protected BoolValidator<DTO> thisObject() {
return this;
}
}

View File

@@ -53,7 +53,7 @@ public class CollectionValidator<DTO, T> extends PropertyValidator<DTO, Collecti
}
@Override
protected CollectionValidator<DTO, T> returnThis() {
protected CollectionValidator<DTO, T> thisObject() {
return this;
}
}

View File

@@ -29,7 +29,7 @@ public class DoubleValidator<DTO> extends PropertyValidator<DTO, Double, DoubleV
}
@Override
protected DoubleValidator<DTO> returnThis() {
protected DoubleValidator<DTO> thisObject() {
return this;
}
}

View File

@@ -29,7 +29,7 @@ public class IntValidator<DTO> extends PropertyValidator<DTO, Integer, IntValida
}
@Override
protected IntValidator<DTO> returnThis() {
protected IntValidator<DTO> thisObject() {
return this;
}
}

View File

@@ -9,7 +9,7 @@ public class ObjectValidator<DTO, T> extends PropertyValidator<DTO, T, ObjectVal
}
@Override
protected ObjectValidator<DTO, T> returnThis() {
protected ObjectValidator<DTO, T> thisObject() {
return this;
}
}

View File

@@ -47,7 +47,7 @@ abstract class PropertyValidator<DTO, PROPERTY, THIS> {
public <E extends RuntimeException> THIS notNull(Function<PROPERTY, E> exceptionCreator) {
withRule(Objects::nonNull, exceptionCreator);
return returnThis();
return thisObject();
}
// ====== isNull =====
@@ -62,7 +62,7 @@ abstract class PropertyValidator<DTO, PROPERTY, THIS> {
public <E extends RuntimeException> THIS isNull(Function<PROPERTY, E> exceptionCreator) {
withRule(Objects::isNull, exceptionCreator);
return returnThis();
return thisObject();
}
// ===== equals =====
@@ -83,7 +83,7 @@ abstract class PropertyValidator<DTO, PROPERTY, THIS> {
public <E extends RuntimeException> THIS equalsThat(
Object that, Function<PROPERTY, E> exceptionCreator) {
withRule(value -> Objects.equals(value, that), exceptionCreator);
return returnThis();
return thisObject();
}
// ===== state =====
@@ -106,7 +106,7 @@ abstract class PropertyValidator<DTO, PROPERTY, THIS> {
Predicate<PROPERTY> condition,
Function<PROPERTY, E> exceptionCreator) {
withRule(condition, exceptionCreator);
return returnThis();
return thisObject();
}
// ========================================================================
@@ -125,5 +125,5 @@ abstract class PropertyValidator<DTO, PROPERTY, THIS> {
return value -> exceptionSupplier.get();
}
protected abstract THIS returnThis();
protected abstract THIS thisObject();
}

View File

@@ -173,7 +173,7 @@ public class StringValidator<DTO> extends PropertyValidator<DTO, String, StringV
}
@Override
protected StringValidator<DTO> returnThis() {
protected StringValidator<DTO> thisObject() {
return this;
}
}