Interface CypherMapAccess

All Known Implementing Classes:
CypherMapWrapper

public interface CypherMapAccess
  • Method Details

    • failOnNull

      static <T> T failOnNull(String key, T value)
    • failOnBlank

      @NotNull static @NotNull String failOnBlank(String key, @Nullable @Nullable String value)
    • 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

      default IllegalArgumentException missingValueFor(String key)
    • requireOnlyKeysFrom

      default void requireOnlyKeysFrom(Collection<String> allowedKeys)
    • containsKey

      boolean containsKey(String key)
      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

      default Optional<String> getString(String key)
    • requireString

      default String requireString(String key)
    • getOptional

      default <E> Optional<E> getOptional(String key, Class<E> clazz)
    • getString

      @Contract("_, !null -> !null") @Nullable default @Nullable String getString(String key, @Nullable @Nullable String defaultValue)
    • getBool

      default boolean getBool(String key, boolean defaultValue)
    • requireBool

      default boolean requireBool(String key)
    • getNumber

      default Number getNumber(String key, Number defaultValue)
    • requireNumber

      default Number requireNumber(String key)
    • getLong

      default long getLong(String key, long defaultValue)
    • requireLong

      default long requireLong(String key)
    • getInt

      default int getInt(String key, int defaultValue)
    • requireInt

      default int requireInt(String key)
    • getLongAsInt

      int getLongAsInt(String key)
    • getDouble

      default double getDouble(String key, double defaultValue)
    • requireDouble

      default double requireDouble(String key)
    • getChecked

      @Contract("_, !null, _ -> !null") @Nullable default <V> V getChecked(String key, @Nullable V defaultValue, Class<V> expectedType)
    • requireChecked

      default <V> V requireChecked(String key, Class<V> expectedType)
    • typedValue

      @NotNull <V> V typedValue(String key, Class<V> expectedType)
    • toMap

      Map<String,Object> 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, an IllegalArgumentException is thrown. The message of that exception depends on which keys are present, possible mis-spelled, or absent.
      Throws:
      IllegalArgumentException