Interface HasKeyValue

All Known Subinterfaces:
EntityWithKeyValue<T>

public interface HasKeyValue
entity/dto has key value capability
  • Method Details

    • getKeyValues

      @Nullable Map<String,String> getKeyValues()
      Returns:
      the internal map - changes should only be done by add/remove KeyValue
    • setKeyValues

      void setKeyValues(Map<String,String> keyValues)
    • hasKeyValue

      default boolean hasKeyValue(String key)
      checks if user has key
      Parameters:
      key - name of key
      Returns:
      true when exists
    • getKeyValue

      default String getKeyValue(String key)
      search for value of given key
      Parameters:
      key - name of key
      Returns:
      value or null when not found
    • getKeyValue

      default <T> T getKeyValue(String key, com.fasterxml.jackson.core.type.TypeReference<T> reference, T fallback)
      search for value of given key and parse json-string
      Parameters:
      key - name of key
      reference - used by objectMapper
      fallback - when key not found or not readable
      Returns:
      value or fallback
    • getKeyValueBoolean

      default Boolean getKeyValueBoolean(String key, Boolean fallback)
      search for value of given key and parse json-string
      Parameters:
      key - name of key
      fallback - when key not found or not readable
      Returns:
      value or fallback
    • getKeyValueLong

      default Long getKeyValueLong(String key, Long fallback)
      search for value of given key and parse json-string
      Parameters:
      key - name of key
      fallback - when key not found or not readable
      Returns:
      value or fallback
    • getKeyValueCollection

      default Collection<String> getKeyValueCollection(String key, Collection<String> fallback)
      search for value of given key and parse json-string
      Parameters:
      key - name of key
      fallback - when key not found or not readable
      Returns:
      value or fallback