protected TypeCodec < ? > createCodec ( DataType cqlType ) { if ( cqlType instanceof ListType ) { DataType elementType = ( ( ListType ) cqlType ) . getElementType ( ) ; TypeCodec < Object > elementCodec = codecFor ( elementType ) ; return TypeCodecs . listOf ( elementCodec ) ; } else if ( cqlType instanceof SetType ) { DataType elementType = ( ( SetType ) cqlType ) . getElementType ( ) ; TypeCodec < Object > elementCodec = codecFor ( elementType ) ; return TypeCodecs . setOf ( elementCodec ) ; } else if ( cqlType instanceof MapType ) { DataType keyType = ( ( MapType ) cqlType ) . getKeyType ( ) ; DataType valueType = ( ( MapType ) cqlType ) . getValueType ( ) ; TypeCodec < Object > keyCodec = codecFor ( keyType ) ; TypeCodec < Object > valueCodec = codecFor ( valueType ) ; return TypeCodecs . mapOf ( keyCodec , valueCodec ) ; } else if ( cqlType instanceof TupleType ) { return TypeCodecs . tupleOf ( ( TupleType ) cqlType ) ; } else if ( cqlType instanceof UserDefinedType ) { return TypeCodecs . udtOf ( ( UserDefinedType ) cqlType ) ; } else if ( cqlType instanceof CustomType ) { return TypeCodecs . custom ( cqlType ) ; } throw new CodecNotFoundException ( cqlType , null ) ; }
Variant where the Java type is unknown .