diff --git a/src/main/java/org/springframework/data/aerospike/query/FilterOperation.java b/src/main/java/org/springframework/data/aerospike/query/FilterOperation.java index 08eeac9d..35d9aa16 100644 --- a/src/main/java/org/springframework/data/aerospike/query/FilterOperation.java +++ b/src/main/java/org/springframework/data/aerospike/query/FilterOperation.java @@ -59,7 +59,6 @@ import static org.springframework.data.aerospike.util.Utils.ctxArrToString; import static org.springframework.data.aerospike.util.Utils.getExpType; import static org.springframework.data.aerospike.util.Utils.getExpValOrFail; -import static org.springframework.data.aerospike.util.Utils.objectToBoolean; public enum FilterOperation { /** @@ -2015,6 +2014,6 @@ protected Filter geoWithinRadius(IndexCollectionType collectionType, Map qualifierMap) { - return objectToBoolean(qualifierMap.get(MAP_KEY_PLACEHOLDER)); + return (Boolean) qualifierMap.getOrDefault(MAP_KEY_PLACEHOLDER, false); } } diff --git a/src/main/java/org/springframework/data/aerospike/query/qualifier/BaseQualifierBuilder.java b/src/main/java/org/springframework/data/aerospike/query/qualifier/BaseQualifierBuilder.java index 4eb640f6..dc513985 100644 --- a/src/main/java/org/springframework/data/aerospike/query/qualifier/BaseQualifierBuilder.java +++ b/src/main/java/org/springframework/data/aerospike/query/qualifier/BaseQualifierBuilder.java @@ -12,7 +12,6 @@ import static org.springframework.data.aerospike.query.qualifier.QualifierKey.PATH; import static org.springframework.data.aerospike.query.qualifier.QualifierKey.SECOND_VALUE; import static org.springframework.data.aerospike.query.qualifier.QualifierKey.VALUE; -import static org.springframework.data.aerospike.util.Utils.objectToBoolean; @SuppressWarnings("unchecked") public abstract class BaseQualifierBuilder> implements IQualifierBuilder { @@ -20,7 +19,7 @@ public abstract class BaseQualifierBuilder> im protected final Map map = new HashMap<>(); public boolean getIgnoreCase() { - return objectToBoolean(map.get(IGNORE_CASE)); + return (Boolean) map.getOrDefault(IGNORE_CASE, false); } public FilterOperation getFilterOperation() { diff --git a/src/main/java/org/springframework/data/aerospike/util/Utils.java b/src/main/java/org/springframework/data/aerospike/util/Utils.java index 5d16a8ef..cba7e81f 100644 --- a/src/main/java/org/springframework/data/aerospike/util/Utils.java +++ b/src/main/java/org/springframework/data/aerospike/util/Utils.java @@ -321,14 +321,4 @@ public static void setIntFromConfig(Consumer setter, Environment enviro String value = getProperty(environment, prefix, propertyName); if (value != null) setter.accept(Integer.parseInt(value)); } - - /** - * Convert an Object to boolean. - * - * @param object Can be null - * @return The given object cast to boolean, or false if it is null - */ - public static boolean objectToBoolean(@Nullable Object object) { - return object != null && (boolean) object; - } }