import org.opendaylight.ovsdb.lib.notation.Row;
import org.opendaylight.ovsdb.lib.notation.UUID;
import org.opendaylight.ovsdb.lib.operations.Insert;
+import org.opendaylight.yangtools.util.CollectionWrappers;
public abstract class TableSchema<E extends TableSchema<E>> {
private static final AtomicColumnType UUID_COLUMN_TYPE = new AtomicColumnType(UuidBaseType.SINGLETON);
private final String name;
private final ImmutableMap<String, ColumnSchema> columns;
+ private volatile List<String> columnList;
+
protected TableSchema(final String name) {
this(name, ImmutableMap.of());
}
return columns.keySet();
}
+ public List<String> getColumnList() {
+ final List<String> local = columnList;
+ return local != null ? local : populateColumnList();
+ }
+
+ private synchronized List<String> populateColumnList() {
+ List<String> local = columnList;
+ if (local == null) {
+ columnList = local = CollectionWrappers.wrapAsList(columns.keySet());
+ }
+ return local;
+ }
+
public Map<String, ColumnSchema> getColumnSchemas() {
return columns;
}