/** * Returns a {@link TypeCodec codec} that accepts the given {@link DataType CQL type}. * * <p>This method returns the first matching codec, regardless of its accepted Java type. It * should be reserved for situations where the Java type is not available or unknown. In the Java * driver, this happens mainly when deserializing a value using the {@link * GettableByIndexData#getObject(int) getObject} method. * * <p>Codecs returned by this method are cached (see the {@link CodecRegistry top-level * documentation} of this class for more explanations about caching). * * @param cqlType The {@link DataType CQL type} the codec should accept; must not be {@code null}. * @return A suitable codec. * @throws CodecNotFoundException if a suitable codec cannot be found. */ public <T> TypeCodec<T> codecFor(DataType cqlType) throws CodecNotFoundException { return lookupCodec(cqlType, null); }
/** * Returns a {@link TypeCodec codec} that accepts the given {@link DataType CQL type} and the * given Java type. * * <p>This method handles parameterized types thanks to Guava's {@link TypeToken} API. * * <p>Codecs returned by this method are cached (see the {@link CodecRegistry top-level * documentation} of this class for more explanations about caching). * * @param cqlType The {@link DataType CQL type} the codec should accept; must not be {@code null}. * @param javaType The {@link TypeToken Java type} the codec should accept; can be {@code null}. * @return A suitable codec. * @throws CodecNotFoundException if a suitable codec cannot be found. */ public <T> TypeCodec<T> codecFor(DataType cqlType, TypeToken<T> javaType) throws CodecNotFoundException { return lookupCodec(cqlType, javaType); }
/** * Returns a {@link TypeCodec codec} that accepts the given {@link DataType CQL type} * and the given Java type. * <p/> * This method handles parameterized types thanks to Guava's {@link TypeToken} API. * <p/> * Codecs returned by this method are cached (see the {@link CodecRegistry top-level documentation} * of this class for more explanations about caching). * * @param cqlType The {@link DataType CQL type} the codec should accept; must not be {@code null}. * @param javaType The {@link TypeToken Java type} the codec should accept; can be {@code null}. * @return A suitable codec. * @throws CodecNotFoundException if a suitable codec cannot be found. */ public <T> TypeCodec<T> codecFor(DataType cqlType, TypeToken<T> javaType) throws CodecNotFoundException { return lookupCodec(cqlType, javaType); }
/** * Returns a {@link TypeCodec codec} that accepts the given {@link DataType CQL type}. * <p/> * This method returns the first matching codec, regardless of its accepted Java type. * It should be reserved for situations where the Java type is not available or unknown. * In the Java driver, this happens mainly when deserializing a value using the * {@link GettableByIndexData#getObject(int) getObject} method. * <p/> * Codecs returned by this method are cached (see the {@link CodecRegistry top-level documentation} * of this class for more explanations about caching). * * @param cqlType The {@link DataType CQL type} the codec should accept; must not be {@code null}. * @return A suitable codec. * @throws CodecNotFoundException if a suitable codec cannot be found. */ public <T> TypeCodec<T> codecFor(DataType cqlType) throws CodecNotFoundException { return lookupCodec(cqlType, null); }
/** * Returns a {@link TypeCodec codec} that accepts the given {@link DataType CQL type}. * <p/> * This method returns the first matching codec, regardless of its accepted Java type. * It should be reserved for situations where the Java type is not available or unknown. * In the Java driver, this happens mainly when deserializing a value using the * {@link GettableByIndexData#getObject(int) getObject} method. * <p/> * Codecs returned by this method are cached (see the {@link CodecRegistry top-level documentation} * of this class for more explanations about caching). * * @param cqlType The {@link DataType CQL type} the codec should accept; must not be {@code null}. * @return A suitable codec. * @throws CodecNotFoundException if a suitable codec cannot be found. */ public <T> TypeCodec<T> codecFor(DataType cqlType) throws CodecNotFoundException { return lookupCodec(cqlType, null); }
/** * Returns a {@link TypeCodec codec} that accepts the given {@link DataType CQL type} * and the given Java type. * <p/> * This method handles parameterized types thanks to Guava's {@link TypeToken} API. * <p/> * Codecs returned by this method are cached (see the {@link CodecRegistry top-level documentation} * of this class for more explanations about caching). * * @param cqlType The {@link DataType CQL type} the codec should accept; must not be {@code null}. * @param javaType The {@link TypeToken Java type} the codec should accept; can be {@code null}. * @return A suitable codec. * @throws CodecNotFoundException if a suitable codec cannot be found. */ public <T> TypeCodec<T> codecFor(DataType cqlType, TypeToken<T> javaType) throws CodecNotFoundException { return lookupCodec(cqlType, javaType); }
/** * Returns a {@link TypeCodec codec} that accepts the given {@link DataType CQL type} * and the given Java type. * <p/> * This method handles parameterized types thanks to Guava's {@link TypeToken} API. * <p/> * Codecs returned by this method are cached (see the {@link CodecRegistry top-level documentation} * of this class for more explanations about caching). * * @param cqlType The {@link DataType CQL type} the codec should accept; must not be {@code null}. * @param javaType The {@link TypeToken Java type} the codec should accept; can be {@code null}. * @return A suitable codec. * @throws CodecNotFoundException if a suitable codec cannot be found. */ public <T> TypeCodec<T> codecFor(DataType cqlType, TypeToken<T> javaType) throws CodecNotFoundException { return lookupCodec(cqlType, javaType); }
/** * Returns a {@link TypeCodec codec} that accepts the given {@link DataType CQL type}. * <p/> * This method returns the first matching codec, regardless of its accepted Java type. * It should be reserved for situations where the Java type is not available or unknown. * In the Java driver, this happens mainly when deserializing a value using the * {@link GettableByIndexData#getObject(int) getObject} method. * <p/> * Codecs returned by this method are cached (see the {@link CodecRegistry top-level documentation} * of this class for more explanations about caching). * * @param cqlType The {@link DataType CQL type} the codec should accept; must not be {@code null}. * @return A suitable codec. * @throws CodecNotFoundException if a suitable codec cannot be found. */ public <T> TypeCodec<T> codecFor(DataType cqlType) throws CodecNotFoundException { return lookupCodec(cqlType, null); }