Package org.apache.flink.table.data
Class GenericMapData
- java.lang.Object
-
- org.apache.flink.table.data.GenericMapData
-
- All Implemented Interfaces:
MapData
@PublicEvolving public final class GenericMapData extends Object implements MapData
An internal data structure representing data ofMapType
orMultisetType
.GenericMapData
is a generic implementation ofMapData
which wraps regular Java maps.Note: All keys and values of this data structure must be internal data structures. All keys must be of the same type; same for values. See
RowData
for more information about internal data structures.Both keys and values can contain null for representing nullability.
-
-
Constructor Summary
Constructors Constructor Description GenericMapData(Map<?,?> map)
Creates an instance ofGenericMapData
using the given Java map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Object
get(Object key)
Returns the value to which the specified key is mapped, ornull
if this map contains no mapping for the key.int
hashCode()
ArrayData
keyArray()
Returns an array view of the keys contained in this map.int
size()
Returns the number of key-value mappings in this map.ArrayData
valueArray()
Returns an array view of the values contained in this map.
-
-
-
Constructor Detail
-
GenericMapData
public GenericMapData(Map<?,?> map)
Creates an instance ofGenericMapData
using the given Java map.Note: All keys and values of the map must be internal data structures.
-
-
Method Detail
-
get
public Object get(Object key)
Returns the value to which the specified key is mapped, ornull
if this map contains no mapping for the key. The returned value is in internal data structure.
-
size
public int size()
Description copied from interface:MapData
Returns the number of key-value mappings in this map.
-
keyArray
public ArrayData keyArray()
Description copied from interface:MapData
Returns an array view of the keys contained in this map.A key-value pair has the same index in the key array and value array.
-
valueArray
public ArrayData valueArray()
Description copied from interface:MapData
Returns an array view of the values contained in this map.A key-value pair has the same index in the key array and value array.
- Specified by:
valueArray
in interfaceMapData
-
-