import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.ovsdb.lib.OvsdbClient;
import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
+import org.opendaylight.ovsdb.lib.schema.typed.TypedBaseTable;
import org.opendaylight.ovsdb.lib.schema.typed.TyperUtils;
public class TransactionBuilder {
return databaseSchema;
}
- public <T> T getTypedRowWrapper(final Class<T> klazz) {
+ public <T extends TypedBaseTable<?>> T getTypedRowWrapper(final Class<T> klazz) {
return TyperUtils.getTypedRowWrapper(databaseSchema, klazz);
}
- public <T> T getTypedRowSchema(final Class<T> klazz) {
+ public <T extends TypedBaseTable<?>> T getTypedRowSchema(final Class<T> klazz) {
return TyperUtils.getTypedRowWrapper(databaseSchema, klazz, null);
}
}
*
* @param klazz Typed Class that represents a Table
*/
- default <T> T getTypedRowWrapper(final Class<T> klazz) {
+ default <T extends TypedBaseTable<?>> T getTypedRowWrapper(final Class<T> klazz) {
return getTypedRowWrapper(klazz, new Row<>());
}
* @param row The actual Row that the wrapper is operating on. It can be null if the caller
* is just interested in getting ColumnSchema.
*/
- <T> T getTypedRowWrapper(Class<T> klazz, Row<GenericTableSchema> row);
+ <T extends TypedBaseTable<?>> T getTypedRowWrapper(Class<T> klazz, Row<GenericTableSchema> row);
/**
* This method extracts all row updates of Class<T> klazz from a TableUpdates
* @param updates TableUpdates from which to extract rowUpdates
* @return Map<UUID,T> for the type of things being sought
*/
- <T> Map<UUID, T> extractRowsOld(Class<T> klazz, TableUpdates updates);
+ <T extends TypedBaseTable<?>> Map<UUID, T> extractRowsOld(Class<T> klazz, TableUpdates updates);
/**
* This method extracts all row updates of Class<T> klazz from a TableUpdates
* @param updates TableUpdates from which to extract rowUpdates
* @return Map<UUID,T> for the type of things being sought
*/
- <T> Map<UUID,T> extractRowsRemoved(Class<T> klazz, TableUpdates updates);
+ <T extends TypedBaseTable<?>> Map<UUID,T> extractRowsRemoved(Class<T> klazz, TableUpdates updates);
/**
* This method extracts all row updates of Class<T> klazz from a TableUpdates
* @param updates TableUpdates from which to extract rowUpdates
* @return Map<UUID,T> for the type of things being sought
*/
- <T> Map<UUID, T> extractRowsUpdated(Class<T> klazz, TableUpdates updates);
+ <T extends TypedBaseTable<?>> Map<UUID, T> extractRowsUpdated(Class<T> klazz, TableUpdates updates);
}
}
@Override
- public <T> T getTypedRowWrapper(final Class<T> klazz, final Row<GenericTableSchema> row) {
+ public <T extends TypedBaseTable<?>> T getTypedRowWrapper(final Class<T> klazz, final Row<GenericTableSchema> row) {
// Check validity of of the parameter passed to getTypedRowWrapper:
// - checks for a valid Database Schema matching the expected Database for a given table
// - checks for the presence of the Table in Database Schema.
}
@Override
- public <T> Map<UUID, T> extractRowsOld(final Class<T> klazz, final TableUpdates updates) {
+ public <T extends TypedBaseTable<?>> Map<UUID, T> extractRowsOld(final Class<T> klazz, final TableUpdates updates) {
Map<UUID,T> result = new HashMap<>();
for (RowUpdate<GenericTableSchema> rowUpdate : extractRowUpdates(klazz, updates).values()) {
if (rowUpdate != null && rowUpdate.getOld() != null) {
}
@Override
- public <T> Map<UUID, T> extractRowsUpdated(final Class<T> klazz, final TableUpdates updates) {
+ public <T extends TypedBaseTable<?>> Map<UUID, T> extractRowsUpdated(final Class<T> klazz,
+ final TableUpdates updates) {
final Map<UUID, T> result = new HashMap<>();
for (RowUpdate<GenericTableSchema> rowUpdate : extractRowUpdates(klazz, updates).values()) {
if (rowUpdate != null && rowUpdate.getNew() != null) {
}
@Override
- public <T> Map<UUID, T> extractRowsRemoved(final Class<T> klazz, final TableUpdates updates) {
+ public <T extends TypedBaseTable<?>> Map<UUID, T> extractRowsRemoved(final Class<T> klazz,
+ final TableUpdates updates) {
final Map<UUID, T> result = new HashMap<>();
for (RowUpdate<GenericTableSchema> rowUpdate : extractRowUpdates(klazz, updates).values()) {
if (rowUpdate != null && rowUpdate.getNew() == null && rowUpdate.getOld() != null) {
* @param klazz Typed Class that represents a Table
*/
@Deprecated
- public static <T> T getTypedRowWrapper(final DatabaseSchema dbSchema, final Class<T> klazz) {
+ public static <T extends TypedBaseTable<?>> T getTypedRowWrapper(final DatabaseSchema dbSchema,
+ final Class<T> klazz) {
return getTypedRowWrapper(dbSchema, klazz, new Row<>());
}
* is just interested in getting ColumnSchema.
*/
@Deprecated
- public static <T> T getTypedRowWrapper(final DatabaseSchema dbSchema, final Class<T> klazz,
- final Row<GenericTableSchema> row) {
+ public static <T extends TypedBaseTable<?>> T getTypedRowWrapper(final DatabaseSchema dbSchema,
+ final Class<T> klazz, final Row<GenericTableSchema> row) {
return dbSchema == null ? null : getTyped(dbSchema).getTypedRowWrapper(klazz, row);
}
* @param dbSchema Dbschema for the TableUpdates
* @return Map<UUID,T> for the type of things being sought
*/
- public static <T> Map<UUID,T> extractRowsUpdated(final Class<T> klazz, final TableUpdates updates,
- final DatabaseSchema dbSchema) {
+ public static <T extends TypedBaseTable<?>> Map<UUID,T> extractRowsUpdated(final Class<T> klazz,
+ final TableUpdates updates, final DatabaseSchema dbSchema) {
return getTyped(dbSchema).extractRowsUpdated(klazz, updates);
}
* @param dbSchema Dbschema for the TableUpdates
* @return Map<UUID,T> for the type of things being sought
*/
- public static <T> Map<UUID, T> extractRowsOld(final Class<T> klazz, final TableUpdates updates,
- final DatabaseSchema dbSchema) {
+ public static <T extends TypedBaseTable<?>> Map<UUID, T> extractRowsOld(final Class<T> klazz,
+ final TableUpdates updates, final DatabaseSchema dbSchema) {
return getTyped(dbSchema).extractRowsOld(klazz, updates);
}
* @param dbSchema Dbschema for the TableUpdates
* @return Map<UUID,T> for the type of things being sought
*/
- public static <T> Map<UUID,T> extractRowsRemoved(final Class<T> klazz, final TableUpdates updates,
- final DatabaseSchema dbSchema) {
+ public static <T extends TypedBaseTable<?>> Map<UUID,T> extractRowsRemoved(final Class<T> klazz,
+ final TableUpdates updates, final DatabaseSchema dbSchema) {
return getTyped(dbSchema).extractRowsRemoved(klazz, updates);
}