Package org.neo4j.gds.core
Interface CypherMapAccess
- All Known Implementing Classes:
CypherMapWrapper
public interface CypherMapAccess
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(String key) Checks if the given key exists in the configuration.static @NotNull String
failOnBlank
(String key, @Nullable String value) static <T> T
failOnNull
(String key, T value) default boolean
default <V> V
getChecked
(String key, V defaultValue, Class<V> expectedType) default double
default int
default long
int
getLongAsInt
(String key) default Number
default <E> Optional<E>
getOptional
(String key, Class<E> clazz) default @Nullable String
keySet()
default IllegalArgumentException
missingValueFor
(String key) default boolean
requireBool
(String key) default <V> V
requireChecked
(String key, Class<V> expectedType) default double
requireDouble
(String key) default int
requireInt
(String key) default long
requireLong
(String key) default Number
requireNumber
(String key) default void
requireOnlyKeysFrom
(Collection<String> allowedKeys) default String
requireString
(String key) toMap()
Returns a copy of the internal Map.<V> V
typedValue
(String key, Class<V> expectedType) static double
validateDoubleRange
(String key, double value, double min, double max, boolean minInclusive, boolean maxInclusive) static int
validateIntegerRange
(String key, int value, int min, int max, boolean minInclusive, boolean maxInclusive) static long
validateLongRange
(String key, long value, long min, long max, boolean minInclusive, boolean maxInclusive) default CypherMapAccess.PairResult
verifyMutuallyExclusivePairs
(String firstPairKeyOne, String firstPairKeyTwo, String secondPairKeyOne, String secondPairKeyTwo, String errorPrefix) Verifies that only one of two mutually exclusive pairs of configuration keys is present.
-
Method Details
-
failOnNull
-
failOnBlank
-
validateIntegerRange
static int validateIntegerRange(String key, int value, int min, int max, boolean minInclusive, boolean maxInclusive) -
validateLongRange
static long validateLongRange(String key, long value, long min, long max, boolean minInclusive, boolean maxInclusive) -
validateDoubleRange
static double validateDoubleRange(String key, double value, double min, double max, boolean minInclusive, boolean maxInclusive) -
missingValueFor
-
requireOnlyKeysFrom
-
containsKey
Checks if the given key exists in the configuration.- Parameters:
key
- key to look for- Returns:
- true, iff the key exists
-
keySet
Collection<String> keySet() -
getString
-
requireString
-
getOptional
-
getString
-
getBool
-
requireBool
-
getNumber
-
requireNumber
-
getLong
-
requireLong
-
getInt
-
requireInt
-
getLongAsInt
-
getDouble
-
requireDouble
-
getChecked
-
requireChecked
-
typedValue
-
toMap
Returns a copy of the internal Map. -
verifyMutuallyExclusivePairs
default CypherMapAccess.PairResult verifyMutuallyExclusivePairs(String firstPairKeyOne, String firstPairKeyTwo, String secondPairKeyOne, String secondPairKeyTwo, String errorPrefix) throws IllegalArgumentException Verifies that only one of two mutually exclusive pairs of configuration keys is present. More precisely, the following condition is checked:(firstPairKeyOne AND firstPairKeyTwo) XOR (secondPairKeyOne AND secondPairKeyTwo)
If the condition is verified, the return value will identify which one of the pairs is present. In the error case where the condition is violated, anIllegalArgumentException
is thrown. The message of that exception depends on which keys are present, possible mis-spelled, or absent.- Throws:
IllegalArgumentException
-