use of org.apache.ignite.internal.schema.marshaller.BinaryMode in project ignite-3 by apache.
the class ColumnBinding method createIdentityBinding.
/**
* Binds a column with an object of given type.
*
* @param col Column.
* @param type Object type.
* @param converter Type converter or {@code null}.
* @return Column to object binding.
*/
@NotNull
static ColumnBinding createIdentityBinding(Column col, Class<?> type, @Nullable TypeConverter<?, ?> converter) {
final BinaryMode mode = MarshallerUtil.mode(type);
if (mode.typeSpec() != col.type().spec()) {
throw new SchemaMismatchException(String.format("Object can't be mapped to a column of incompatible type: columnType=%s, mappedType=%s", col.type().spec(), type.getName()));
}
final MethodHandle identityHandle = MethodHandles.identity(type);
return create(col, type, identityHandle, identityHandle, converter);
}
Aggregations