org.apache.cassandra.db.marshal

## Class MapType<K,V>

- java.lang.Object
- - org.apache.cassandra.db.marshal.AbstractType<T>
  - - org.apache.cassandra.db.marshal.CollectionType<java.util.Map<K,V>>
    - - org.apache.cassandra.db.marshal.MapType<K,V>

- All Implemented Interfaces:
    java.util.Comparator<java.nio.ByteBuffer>

      public class MapType<K,V>
      extends CollectionType<java.util.Map<K,V>>

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.cassandra.db.marshal.CollectionType

      `CollectionType.Kind`

  - ### Field Summary

    - ### Fields inherited from class org.apache.cassandra.db.marshal.CollectionType

      `kind, MAX_ELEMENTS`

    - ### Fields inherited from class org.apache.cassandra.db.marshal.AbstractType

      `reverseComparator`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compare(java.nio.ByteBuffer o1, java.nio.ByteBuffer o2)`
    `static int` | `compareMaps(AbstractType<?> keysComparator, AbstractType<?> valuesComparator, java.nio.ByteBuffer o1, java.nio.ByteBuffer o2)`
    `AbstractType<?>` | `freeze()`
    `Term` | `fromJSONObject(java.lang.Object parsed)` Given a parsed JSON string, return a byte representation of the object.
    `static <K,V> MapType<K,V>` | `getInstance(AbstractType<K> keys, AbstractType<V> values, boolean isMultiCell)`
    `static MapType<?,?>` | `getInstance(TypeParser parser)`
    `AbstractType<K>` | `getKeysType()`
    `MapSerializer<K,V>` | `getSerializer()`
    `AbstractType<V>` | `getValuesType()`
    `boolean` | `isByteOrderComparable()`
    `boolean` | `isCompatibleWithFrozen(CollectionType<?> previous)` A version of isCompatibleWith() to deal with non-multicell (frozen) collections
    `boolean` | `isMultiCell()`
    `boolean` | `isValueCompatibleWithFrozen(CollectionType<?> previous)` A version of isValueCompatibleWith() to deal with non-multicell (frozen) collections
    `AbstractType<K>` | `nameComparator()`
    `boolean` | `references(AbstractType<?> check)` Checks whether this type or any of the types this type contains references the given type.
    `java.util.List<java.nio.ByteBuffer>` | `serializedValues(java.util.List<Cell> cells)`
    `java.lang.String` | `toJSONString(java.nio.ByteBuffer buffer, int protocolVersion)` Converts the specified value into its JSON representation.
    `java.lang.String` | `toString(boolean ignoreFreezing)`
    `AbstractType<V>` | `valueComparator()`

    - ### Methods inherited from class org.apache.cassandra.db.marshal.CollectionType

      `asCQL3Type, enforceLimit, fromString, getString, isCollection, isCompatibleWith, isMap, isValueCompatibleWithInternal, makeCollectionReceiver, serializeForNativeProtocol, toString, validateCellValue`

    - ### Methods inherited from class org.apache.cassandra.db.marshal.AbstractType

      `asCQLTypeStringList, compareCollectionMembers, componentsCount, compose, decompose, getComponents, getString, isCounter, isEmptyValueMeaningless, isFrozenCollection, isReversed, isValueCompatibleWith, parseDefaultParameters, validate, validateCollectionMember`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Comparator

      `comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

- - ### Method Detail

    - #### getInstance

          public static MapType<?,?> getInstance(TypeParser parser)
                                          throws ConfigurationException,
                                                 SyntaxException

      Throws:
        `ConfigurationException`
        `SyntaxException`

    - #### getInstance

          public static <K,V> MapType<K,V> getInstance(AbstractType<K> keys,
                                                       AbstractType<V> values,
                                                       boolean isMultiCell)

    - #### references

          public boolean references(AbstractType<?> check)

      Description copied from class: `AbstractType`
      Checks whether this type or any of the types this type contains references the given type.
      Overrides:
        `references` in class `AbstractType<java.util.Map<K,V>>`

    - #### getKeysType

          public AbstractType<K> getKeysType()

    - #### getValuesType

          public AbstractType<V> getValuesType()

    - #### nameComparator

          public AbstractType<K> nameComparator()

      Specified by:
        `nameComparator` in class `CollectionType<java.util.Map<K,V>>`

    - #### valueComparator

          public AbstractType<V> valueComparator()

      Specified by:
        `valueComparator` in class `CollectionType<java.util.Map<K,V>>`

    - #### isMultiCell

          public boolean isMultiCell()

      Overrides:
        `isMultiCell` in class `AbstractType<java.util.Map<K,V>>`

    - #### freeze

          public AbstractType<?> freeze()

      Overrides:
        `freeze` in class `AbstractType<java.util.Map<K,V>>`

    - #### isCompatibleWithFrozen

          public boolean isCompatibleWithFrozen(CollectionType<?> previous)

      Description copied from class: `CollectionType`
      A version of isCompatibleWith() to deal with non-multicell (frozen) collections
      Specified by:
        `isCompatibleWithFrozen` in class `CollectionType<java.util.Map<K,V>>`

    - #### isValueCompatibleWithFrozen

          public boolean isValueCompatibleWithFrozen(CollectionType<?> previous)

      Description copied from class: `CollectionType`
      A version of isValueCompatibleWith() to deal with non-multicell (frozen) collections
      Specified by:
        `isValueCompatibleWithFrozen` in class `CollectionType<java.util.Map<K,V>>`

    - #### compare

          public int compare(java.nio.ByteBuffer o1,
                             java.nio.ByteBuffer o2)

    - #### compareMaps

          public static int compareMaps(AbstractType<?> keysComparator,
                                        AbstractType<?> valuesComparator,
                                        java.nio.ByteBuffer o1,
                                        java.nio.ByteBuffer o2)

    - #### getSerializer

          public MapSerializer<K,V> getSerializer()

      Specified by:
        `getSerializer` in class `CollectionType<java.util.Map<K,V>>`

    - #### isByteOrderComparable

          public boolean isByteOrderComparable()

      Overrides:
        `isByteOrderComparable` in class `AbstractType<java.util.Map<K,V>>`
      Returns:
        true IFF the byte representation of this type can be compared unsigned and always return the same result as calling this object's compare or compareCollectionMembers methods

    - #### toString

          public java.lang.String toString(boolean ignoreFreezing)

      Overrides:
        `toString` in class `AbstractType<java.util.Map<K,V>>`
      Parameters:
        `ignoreFreezing` - if true, the type string will not be wrapped with FrozenType(...), even if this type is frozen.

    - #### serializedValues

          public java.util.List<java.nio.ByteBuffer> serializedValues(java.util.List<Cell> cells)

      Specified by:
        `serializedValues` in class `CollectionType<java.util.Map<K,V>>`

    - #### fromJSONObject

          public Term fromJSONObject(java.lang.Object parsed)
                              throws MarshalException

      Description copied from class: `AbstractType`
      Given a parsed JSON string, return a byte representation of the object.
      Specified by:
        `fromJSONObject` in class `AbstractType<java.util.Map<K,V>>`
      Parameters:
        `parsed` - the result of parsing a json string
      Throws:
        `MarshalException`

    - #### toJSONString

          public java.lang.String toJSONString(java.nio.ByteBuffer buffer,
                                               int protocolVersion)

      Description copied from class: `AbstractType`
      Converts the specified value into its JSON representation.

      The buffer position will stay the same.

      Overrides:
        `toJSONString` in class `AbstractType<java.util.Map<K,V>>`
      Parameters:
        `buffer` - the value to convert
        `protocolVersion` - the protocol version to use for the conversion
      Returns:
        a JSON string representing the specified value

Copyright © 2018 The Apache Software Foundation