Class TupleBackedMap
java.lang.Object
org.springframework.data.jpa.util.TupleBackedMap
A
Map
implementation which delegates all calls to a Tuple
. Depending on the provided Tuple
implementation it might return the same value for various keys of which only one will appear in the key/entry set.- Since:
- 4.0
- Author:
- Jens Schauder
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) If the key is not aString
or not a key of the backingTuple
this returnsfalse
.boolean
containsValue
(Object value) entrySet()
@Nullable Object
If the key is not aString
or not a key of the backingTuple
this returnsnull
.boolean
isEmpty()
keySet()
void
int
size()
static jakarta.persistence.Tuple
underscoreAware
(jakarta.persistence.Tuple delegate) Creates a underscore-awareTuple
wrapper applyingJdbcUtils.convertPropertyNameToUnderscoreName(java.lang.String)
conversion to leniently look up properties from query results whose columns follow snake-case syntax.values()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
TupleBackedMap
public TupleBackedMap(jakarta.persistence.Tuple tuple)
-
-
Method Details
-
underscoreAware
public static jakarta.persistence.Tuple underscoreAware(jakarta.persistence.Tuple delegate) Creates a underscore-awareTuple
wrapper applyingJdbcUtils.convertPropertyNameToUnderscoreName(java.lang.String)
conversion to leniently look up properties from query results whose columns follow snake-case syntax.- Parameters:
delegate
- the tuple to wrap.- Returns:
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
If the key is not aString
or not a key of the backingTuple
this returnsfalse
. Otherwise this returnstrue
even when the value from the backingTuple
isnull
.- Specified by:
containsKey
in interfaceMap<String,
Object> - Parameters:
key
- the key for which to get the value from the map.- Returns:
- whether the key is an element of the backing tuple.
-
containsValue
- Specified by:
containsValue
in interfaceMap<String,
Object>
-
get
If the key is not aString
or not a key of the backingTuple
this returnsnull
. Otherwise the value from the backingTuple
is returned, which also might benull
. -
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-