Package io.rocketbase.commons.model
Interface EntityWithKeyValue<T>
-
- All Superinterfaces:
HasKeyValue
public interface EntityWithKeyValue<T> extends HasKeyValue
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default TaddKeyValue(String key, Boolean value)default TaddKeyValue(String key, Number value)default TaddKeyValue(String key, String value)default TaddKeyValue(String key, Collection values)default voidcheckKeyValue(String key, String value)validate key and valuedefault voidremoveKeyValue(String key)default voidvalidateKeyValues()validate all keyValues
should be triggered before storing in database-
Methods inherited from interface io.rocketbase.commons.model.HasKeyValue
getKeyValue, getKeyValue, getKeyValueBoolean, getKeyValueCollection, getKeyValueLong, getKeyValues, hasKeyValue, setKeyValues
-
-
-
-
Method Detail
-
addKeyValue
default T addKeyValue(String key, String value)
- Parameters:
key- max length of 50 characters (Allowed key chars are a-Z, 0-9 and _-.#)
key with _ as prefix will not get displayed in REST_APIvalue- max length of 255 characters- Returns:
- itself for fluent api
-
addKeyValue
default T addKeyValue(String key, Number value)
- Parameters:
key- max length of 50 characters (Allowed key chars are a-Z, 0-9 and _-.#)
key with _ as prefix will not get displayed in REST_APIvalue- will get converted to String- Returns:
- itself for fluent api
-
addKeyValue
default T addKeyValue(String key, Boolean value)
- Parameters:
key- max length of 50 characters (Allowed key chars are a-Z, 0-9 and _-.#)
key with _ as prefix will not get displayed in REST_APIvalue- will get converted to String- Returns:
- itself for fluent api
-
addKeyValue
default T addKeyValue(String key, Collection values)
- Parameters:
key- max length of 50 characters (Allowed key chars are a-Z, 0-9 and _-.#)
key with _ as prefix will not get displayed in REST_APIvalues- will get converted via ObjectMapper as json array- Returns:
- itself for fluent api
-
removeKeyValue
default void removeKeyValue(String key)
-
checkKeyValue
default void checkKeyValue(String key, String value)
validate key and value- Parameters:
key- not empty and max 50 chars
Allowed key chars are a-Z, 0-9 and _-.#[]value- maximum length 255 chars
-
validateKeyValues
default void validateKeyValues()
validate all keyValues
should be triggered before storing in database
-
-