From 4cfc8279234c1ac273458f589c45d83bc9209e77 Mon Sep 17 00:00:00 2001 From: MeetMaratha Date: Wed, 27 Nov 2024 15:05:55 -0400 Subject: [PATCH] refactor: removed complex conditional statement in toQueryConfig function in QueryOption class --- .../cli/operation/deleter/QueryOption.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/impexp-client-cli/src/main/java/org/citydb/cli/operation/deleter/QueryOption.java b/impexp-client-cli/src/main/java/org/citydb/cli/operation/deleter/QueryOption.java index a4126efe7..98cfbe70b 100644 --- a/impexp-client-cli/src/main/java/org/citydb/cli/operation/deleter/QueryOption.java +++ b/impexp-client-cli/src/main/java/org/citydb/cli/operation/deleter/QueryOption.java @@ -68,14 +68,20 @@ public class QueryOption implements CliOption { @CommandLine.ArgGroup private XMLQueryOption xmlQueryOption; + private boolean canCreateQueryConfig() { + return ( + typeNamesOption != null + || featureVersionOption != null + || resourceIdOption != null + || databaseIdOption != null + || boundingBoxOption != null + || counterOption != null + || sqlSelectOption != null + ); + } + public QueryConfig toQueryConfig() { - if (typeNamesOption != null - || featureVersionOption != null - || resourceIdOption != null - || databaseIdOption != null - || boundingBoxOption != null - || counterOption != null - || sqlSelectOption != null) { + if (canCreateQueryConfig()) { QueryConfig queryConfig = new QueryConfig(); List predicates = new ArrayList<>();