2 * Copyright © 2019 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.ovsdb.lib.schema.typed;
10 import java.lang.reflect.Method;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.ovsdb.lib.notation.Column;
13 import org.opendaylight.ovsdb.lib.notation.Row;
14 import org.opendaylight.ovsdb.lib.schema.ColumnSchema;
15 import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
17 final class GetColumn<T> extends MethodDispatch.StrictColumnPrototype<T> {
18 private static final class Invoker<T> extends MethodDispatch.ColumnInvoker<T> {
19 Invoker(final @NonNull GenericTableSchema tableSchema,
20 final @NonNull ColumnSchema<GenericTableSchema, T> columnSchema) {
21 super(tableSchema, columnSchema);
25 Object invokeMethod(final Object proxy, final Object[] args) {
26 return new Column<>(columnSchema(), null);
30 Object invokeRowMethod(final Row<GenericTableSchema> row, final Object proxy, final Object[] args) {
31 return row.getColumn(columnSchema());
35 GetColumn(final Method method, final String tableName, final String columnName) {
36 super(method, tableName, columnName);
40 Invoker<T> bindToImpl(final GenericTableSchema tableSchema,
41 final ColumnSchema<GenericTableSchema, T> columnSchema) {
42 return new Invoker<>(tableSchema, columnSchema);