From 4f6f7286c053330f4b2251b6f2ce5a1f415c5f5a Mon Sep 17 00:00:00 2001 From: Willem Date: Sun, 27 Dec 2015 16:44:23 +0100 Subject: [PATCH] shorted the validator check classes to normal length. --- ... => AbstractTPQCheckParameterPattern.java} | 4 +-- ....java => TPQCheckDescriptionNotBlank.java} | 2 +- ...ePattern.java => TPQCheckNamePattern.java} | 4 +-- ...PQCheckParameterDefaultValueNotBlank.java} | 2 +- ...java => TPQCheckParameterNamePattern.java} | 4 +-- ...java => TPQCheckParameterTypePattern.java} | 4 +-- ...=> TPQCheckParameterValueTypePattern.java} | 4 +-- .../TPQueryStoreConfigValidatorTest.java | 28 +++++++++---------- 8 files changed, 26 insertions(+), 26 deletions(-) rename ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/{AbstractTPQConfigValidatorParameterPattern.java => AbstractTPQCheckParameterPattern.java} (91%) rename ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/{TPQConfigValidatorCheckDescriptionNotBlank.java => TPQCheckDescriptionNotBlank.java} (94%) rename ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/{TPQConfigValidatorCheckNamePattern.java => TPQCheckNamePattern.java} (92%) rename ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/{TPQConfigValidatorCheckParameterDefaultValueNotBlank.java => TPQCheckParameterDefaultValueNotBlank.java} (94%) rename ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/{TPQConfigValidatorCheckParameterNamePattern.java => TPQCheckParameterNamePattern.java} (90%) rename ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/{TPQConfigValidatorCheckParameterTypePattern.java => TPQCheckParameterTypePattern.java} (90%) rename ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/{TPQConfigValidatorCheckParameterValueTypePattern.java => TPQCheckParameterValueTypePattern.java} (89%) diff --git a/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/AbstractTPQConfigValidatorParameterPattern.java b/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/AbstractTPQCheckParameterPattern.java similarity index 91% rename from ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/AbstractTPQConfigValidatorParameterPattern.java rename to ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/AbstractTPQCheckParameterPattern.java index 806c61e..0e8285c 100644 --- a/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/AbstractTPQConfigValidatorParameterPattern.java +++ b/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/AbstractTPQCheckParameterPattern.java @@ -35,7 +35,7 @@ import net.forwardfire.tpquery.model.TPQueryParameter; * @author Willem Cazander * @version 1.0 June 1, 2015 */ -public abstract class AbstractTPQConfigValidatorParameterPattern implements TPQConfigValidatorCheck { +public abstract class AbstractTPQCheckParameterPattern implements TPQConfigValidatorCheck { private final String pattern; private final Function patternValue; @@ -45,7 +45,7 @@ public abstract class AbstractTPQConfigValidatorParameterPattern implements TPQC * @param pattern The pattern to check. * @param patternValue The function to get value to check. */ - public AbstractTPQConfigValidatorParameterPattern(String pattern,Function patternValue) { + public AbstractTPQCheckParameterPattern(String pattern,Function patternValue) { Validate.notNull(patternValue); this.pattern=pattern; this.patternValue=patternValue; diff --git a/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQConfigValidatorCheckDescriptionNotBlank.java b/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQCheckDescriptionNotBlank.java similarity index 94% rename from ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQConfigValidatorCheckDescriptionNotBlank.java rename to ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQCheckDescriptionNotBlank.java index 9f8d61b..d554585 100644 --- a/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQConfigValidatorCheckDescriptionNotBlank.java +++ b/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQCheckDescriptionNotBlank.java @@ -32,7 +32,7 @@ import net.forwardfire.tpquery.model.TPQuery; * @author Willem Cazander * @version 1.0 June 1, 2015 */ -public final class TPQConfigValidatorCheckDescriptionNotBlank implements TPQConfigValidatorCheck { +public final class TPQCheckDescriptionNotBlank implements TPQConfigValidatorCheck { @Override public void validateQuery(TPQuery query) { diff --git a/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQConfigValidatorCheckNamePattern.java b/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQCheckNamePattern.java similarity index 92% rename from ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQConfigValidatorCheckNamePattern.java rename to ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQCheckNamePattern.java index 979d77a..60463a8 100644 --- a/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQConfigValidatorCheckNamePattern.java +++ b/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQCheckNamePattern.java @@ -32,7 +32,7 @@ import net.forwardfire.tpquery.model.TPQuery; * @author Willem Cazander * @version 1.0 June 1, 2015 */ -public final class TPQConfigValidatorCheckNamePattern implements TPQConfigValidatorCheck { +public final class TPQCheckNamePattern implements TPQConfigValidatorCheck { private final String pattern; @@ -40,7 +40,7 @@ public final class TPQConfigValidatorCheckNamePattern implements TPQConfigValida * Creates an name pattern checker. * @param pattern The pattern to check the name against. */ - public TPQConfigValidatorCheckNamePattern(String pattern) { + public TPQCheckNamePattern(String pattern) { Validate.matchesPattern("", pattern); this.pattern=pattern; } diff --git a/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQConfigValidatorCheckParameterDefaultValueNotBlank.java b/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQCheckParameterDefaultValueNotBlank.java similarity index 94% rename from ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQConfigValidatorCheckParameterDefaultValueNotBlank.java rename to ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQCheckParameterDefaultValueNotBlank.java index fe2cf7c..451bd8f 100644 --- a/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQConfigValidatorCheckParameterDefaultValueNotBlank.java +++ b/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQCheckParameterDefaultValueNotBlank.java @@ -32,7 +32,7 @@ import net.forwardfire.tpquery.model.TPQuery; * @author Willem Cazander * @version 1.0 June 1, 2015 */ -public final class TPQConfigValidatorCheckParameterDefaultValueNotBlank implements TPQConfigValidatorCheck { +public final class TPQCheckParameterDefaultValueNotBlank implements TPQConfigValidatorCheck { @Override public void validateQuery(TPQuery query) { diff --git a/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQConfigValidatorCheckParameterNamePattern.java b/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQCheckParameterNamePattern.java similarity index 90% rename from ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQConfigValidatorCheckParameterNamePattern.java rename to ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQCheckParameterNamePattern.java index bbfe640..30c27d8 100644 --- a/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQConfigValidatorCheckParameterNamePattern.java +++ b/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQCheckParameterNamePattern.java @@ -28,13 +28,13 @@ package net.forwardfire.tpquery.config.validate; * @author Willem Cazander * @version 1.0 June 1, 2015 */ -public final class TPQConfigValidatorCheckParameterNamePattern extends AbstractTPQConfigValidatorParameterPattern { +public final class TPQCheckParameterNamePattern extends AbstractTPQCheckParameterPattern { /** * Creates an name pattern checker. * @param pattern The pattern to check the name against. */ - public TPQConfigValidatorCheckParameterNamePattern(String pattern) { + public TPQCheckParameterNamePattern(String pattern) { super(pattern,p -> p.getName()); } } diff --git a/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQConfigValidatorCheckParameterTypePattern.java b/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQCheckParameterTypePattern.java similarity index 90% rename from ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQConfigValidatorCheckParameterTypePattern.java rename to ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQCheckParameterTypePattern.java index 96b4a05..7f9e591 100644 --- a/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQConfigValidatorCheckParameterTypePattern.java +++ b/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQCheckParameterTypePattern.java @@ -28,13 +28,13 @@ package net.forwardfire.tpquery.config.validate; * @author Willem Cazander * @version 1.0 June 1, 2015 */ -public final class TPQConfigValidatorCheckParameterTypePattern extends AbstractTPQConfigValidatorParameterPattern { +public final class TPQCheckParameterTypePattern extends AbstractTPQCheckParameterPattern { /** * Creates an type pattern checker. * @param pattern The pattern to check the type against. */ - public TPQConfigValidatorCheckParameterTypePattern(String pattern) { + public TPQCheckParameterTypePattern(String pattern) { super(pattern,p -> p.getType()); } } diff --git a/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQConfigValidatorCheckParameterValueTypePattern.java b/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQCheckParameterValueTypePattern.java similarity index 89% rename from ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQConfigValidatorCheckParameterValueTypePattern.java rename to ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQCheckParameterValueTypePattern.java index f3b0bff..b6ca372 100644 --- a/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQConfigValidatorCheckParameterValueTypePattern.java +++ b/ff-tpquery-store/src/main/java/net/forwardfire/tpquery/config/validate/TPQCheckParameterValueTypePattern.java @@ -28,13 +28,13 @@ package net.forwardfire.tpquery.config.validate; * @author Willem Cazander * @version 1.0 June 1, 2015 */ -public final class TPQConfigValidatorCheckParameterValueTypePattern extends AbstractTPQConfigValidatorParameterPattern { +public final class TPQCheckParameterValueTypePattern extends AbstractTPQCheckParameterPattern { /** * Creates an value type pattern checker. * @param pattern The pattern to check the value type against. */ - public TPQConfigValidatorCheckParameterValueTypePattern(String pattern) { + public TPQCheckParameterValueTypePattern(String pattern) { super(pattern,p -> p.getValueType()); } } diff --git a/ff-tpquery-store/src/test/java/net/forwardfire/tpquery/config/TPQueryStoreConfigValidatorTest.java b/ff-tpquery-store/src/test/java/net/forwardfire/tpquery/config/TPQueryStoreConfigValidatorTest.java index e24e3c1..28ca4ef 100644 --- a/ff-tpquery-store/src/test/java/net/forwardfire/tpquery/config/TPQueryStoreConfigValidatorTest.java +++ b/ff-tpquery-store/src/test/java/net/forwardfire/tpquery/config/TPQueryStoreConfigValidatorTest.java @@ -8,12 +8,12 @@ import net.forwardfire.tpquery.TPQManager; import net.forwardfire.tpquery.TPQFactory; import net.forwardfire.tpquery.config.validate.TPQConfigValidator; import net.forwardfire.tpquery.config.validate.TPQConfigValidatorCheck; -import net.forwardfire.tpquery.config.validate.TPQConfigValidatorCheckDescriptionNotBlank; -import net.forwardfire.tpquery.config.validate.TPQConfigValidatorCheckNamePattern; -import net.forwardfire.tpquery.config.validate.TPQConfigValidatorCheckParameterDefaultValueNotBlank; -import net.forwardfire.tpquery.config.validate.TPQConfigValidatorCheckParameterNamePattern; -import net.forwardfire.tpquery.config.validate.TPQConfigValidatorCheckParameterTypePattern; -import net.forwardfire.tpquery.config.validate.TPQConfigValidatorCheckParameterValueTypePattern; +import net.forwardfire.tpquery.config.validate.TPQCheckDescriptionNotBlank; +import net.forwardfire.tpquery.config.validate.TPQCheckNamePattern; +import net.forwardfire.tpquery.config.validate.TPQCheckParameterDefaultValueNotBlank; +import net.forwardfire.tpquery.config.validate.TPQCheckParameterNamePattern; +import net.forwardfire.tpquery.config.validate.TPQCheckParameterTypePattern; +import net.forwardfire.tpquery.config.validate.TPQCheckParameterValueTypePattern; import net.forwardfire.tpquery.model.TPQuery; public class TPQueryStoreConfigValidatorTest { @@ -41,10 +41,10 @@ public class TPQueryStoreConfigValidatorTest { .build() .build(); - config.addConfigValidator(".*", new TPQConfigValidatorCheckNamePattern(".*")); - config.addConfigValidator(".*", new TPQConfigValidatorCheckParameterNamePattern(".*")); - config.addConfigValidator(".*", new TPQConfigValidatorCheckParameterTypePattern(".*")); - config.addConfigValidator(".*", new TPQConfigValidatorCheckParameterValueTypePattern(".*")); + config.addConfigValidator(".*", new TPQCheckNamePattern(".*")); + config.addConfigValidator(".*", new TPQCheckParameterNamePattern(".*")); + config.addConfigValidator(".*", new TPQCheckParameterTypePattern(".*")); + config.addConfigValidator(".*", new TPQCheckParameterValueTypePattern(".*")); config.addConfigValidator(".*", new TPQConfigValidatorCheck() { @Override public void validateQuery(TPQuery query) { @@ -70,10 +70,10 @@ public class TPQueryStoreConfigValidatorTest { .build() .build(); - TPQConfigValidator t = config.addConfigValidator("junit.test", new TPQConfigValidatorCheckDescriptionNotBlank()); + TPQConfigValidator t = config.addConfigValidator("junit.test", new TPQCheckDescriptionNotBlank()); config.removeConfigValidator(t); - config.addConfigValidator(".*", new TPQConfigValidatorCheckDescriptionNotBlank()); + config.addConfigValidator(".*", new TPQCheckDescriptionNotBlank()); TPQManager manager = TPQFactory.createManager(config); assertNotNull(manager); } @@ -98,7 +98,7 @@ public class TPQueryStoreConfigValidatorTest { .build() .build() .build(); - config.addConfigValidator(".*", new TPQConfigValidatorCheckParameterDefaultValueNotBlank()); + config.addConfigValidator(".*", new TPQCheckParameterDefaultValueNotBlank()); TPQManager manager = TPQFactory.createManager(config); assertNotNull(manager); } @@ -123,7 +123,7 @@ public class TPQueryStoreConfigValidatorTest { .build() .build() .build(); - config.addConfigValidator("junit.test-f.*", new TPQConfigValidatorCheckParameterTypePattern("!RAW")); + config.addConfigValidator("junit.test-f.*", new TPQCheckParameterTypePattern("!RAW")); TPQManager manager = TPQFactory.createManager(config); assertNotNull(manager); }