Rework TypedRowInvocationHandler invocation path
[ovsdb.git] / library / impl / src / main / java / org / opendaylight / ovsdb / lib / schema / typed / GetTable.java
1 /*
2  * Copyright © 2019 PANTHEON.tech, s.r.o. and others. All rights reserved.
3  *
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
7  */
8 package org.opendaylight.ovsdb.lib.schema.typed;
9
10 import com.google.common.collect.Range;
11 import org.eclipse.jdt.annotation.Nullable;
12 import org.opendaylight.ovsdb.lib.notation.Row;
13 import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
14
15 public final class GetTable extends MethodDispatch.TablePrototype {
16     private static final class Invoker extends MethodDispatch.TableInvoker {
17         Invoker(final GenericTableSchema tableSchema) {
18             super(tableSchema);
19         }
20
21         @Override
22         @Nullable
23         Object invokeMethod(final Row<GenericTableSchema> row, final Object proxy, final Object[] args) {
24             return tableSchema();
25         }
26     }
27
28     GetTable(final String tableName) {
29         super(Range.all(), tableName);
30     }
31
32     @Override
33     Invoker bindToImpl(final TypedDatabaseSchema dbSchema) {
34         return new Invoker(findTableSchema(dbSchema));
35     }
36 }
37