[ONOS-2499]update accordingly for ONOS-2408's review recommendation
Change-Id: I24e7c4acbe38e4286b994c5bf50d22def945fb29
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/MonitorRequest.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/MonitorRequest.java
index e2176ae..e7f5eae 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/MonitorRequest.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/MonitorRequest.java
@@ -42,9 +42,9 @@
*/
public MonitorRequest(String tableName, Set<String> columns,
MonitorSelect select) {
- checkNotNull(tableName, "tableName is not null");
- checkNotNull(columns, "columns is not null");
- checkNotNull(select, "select is not null");
+ checkNotNull(tableName, "table name cannot be null");
+ checkNotNull(columns, "columns cannot be null");
+ checkNotNull(select, "select cannot be null");
this.tableName = tableName;
this.columns = columns;
this.select = select;
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/OperationResult.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/OperationResult.java
index 7f2cb6c..7709236 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/OperationResult.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/OperationResult.java
@@ -50,7 +50,7 @@
* @param rows List of Row entity
*/
public OperationResult(List<Row> rows) {
- checkNotNull(rows, "rows is not null");
+ checkNotNull(rows, "rows cannot be null");
this.rows = rows;
}
@@ -64,10 +64,10 @@
*/
public OperationResult(int count, UUID uuid, List<Row> rows, String error,
String details) {
- checkNotNull(uuid, "uuid is not null");
- checkNotNull(rows, "rows is not null");
- checkNotNull(error, "error is not null");
- checkNotNull(details, "details is not null");
+ checkNotNull(uuid, "uuid cannot be null");
+ checkNotNull(rows, "rows cannot be null");
+ checkNotNull(error, "error cannot be null");
+ checkNotNull(details, "details cannot be null");
this.count = count;
this.uuid = uuid;
this.rows = rows;
@@ -105,7 +105,7 @@
* @param uuid the Operation message of uuid
*/
public void setUuid(String uuid) {
- checkNotNull(uuid, "uuid is not null");
+ checkNotNull(uuid, "uuid cannot be null");
this.uuid = UUID.uuid(uuid);
}
@@ -122,7 +122,7 @@
* @param rows the Operation message of rows
*/
public void setRows(List<Row> rows) {
- checkNotNull(rows, "rows is not null");
+ checkNotNull(rows, "rows cannot be null");
this.rows = rows;
}
@@ -139,7 +139,7 @@
* @param error the Operation message of error
*/
public void setError(String error) {
- checkNotNull(error, "error is not null");
+ checkNotNull(error, "error cannot be null");
this.error = error;
}
@@ -156,7 +156,7 @@
* @param details the Operation message of details
*/
public void setDetails(String details) {
- checkNotNull(details, "details is not null");
+ checkNotNull(details, "details cannot be null");
this.details = details;
}
}
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/RowUpdate.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/RowUpdate.java
index db11edd..221206e 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/RowUpdate.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/RowUpdate.java
@@ -40,7 +40,7 @@
* @param newRow present for "initial", "insert", and "modify" updates
*/
public RowUpdate(UUID uuid, Row oldRow, Row newRow) {
- checkNotNull(uuid, "uuid is not null");
+ checkNotNull(uuid, "uuid cannot be null");
this.uuid = uuid;
this.oldRow = oldRow;
this.newRow = newRow;
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/TableUpdate.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/TableUpdate.java
index 5228490..812a034 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/TableUpdate.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/TableUpdate.java
@@ -16,6 +16,7 @@
package org.onosproject.ovsdb.rfc.message;
import static com.google.common.base.MoreObjects.toStringHelper;
+import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Map;
import java.util.Objects;
@@ -44,6 +45,7 @@
* @return TableUpdate entity
*/
public static TableUpdate tableUpdate(Map<UUID, RowUpdate> rows) {
+ checkNotNull(rows, "rows cannot be null");
return new TableUpdate(rows);
}
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/TableUpdates.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/TableUpdates.java
index 46d3245..8938bee 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/TableUpdates.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/TableUpdates.java
@@ -44,7 +44,7 @@
* @return TableUpdates
*/
public static TableUpdates tableUpdates(Map<String, TableUpdate> result) {
- checkNotNull(result, "result is not null");
+ checkNotNull(result, "result cannot be null");
return new TableUpdates(result);
}
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/UpdateNotification.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/UpdateNotification.java
index c97396e..74dd2a6 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/UpdateNotification.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/UpdateNotification.java
@@ -41,8 +41,8 @@
* @param tbUpdatesJsonNode the "table-updates" in "params" of the result JsonNode
*/
public UpdateNotification(Object context, JsonNode tbUpdatesJsonNode) {
- checkNotNull(context, "context is not null");
- checkNotNull(tbUpdatesJsonNode, "tbUpdatesJsonNode is not null");
+ checkNotNull(context, "context cannot be null");
+ checkNotNull(tbUpdatesJsonNode, "tablebUpdates JsonNode cannot be null");
this.context = context;
this.tbUpdatesJsonNode = tbUpdatesJsonNode;
}
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/Column.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/Column.java
index e6e6a05..d2cce63 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/Column.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/Column.java
@@ -38,8 +38,8 @@
* @param obj the data of the column
*/
public Column(ColumnSchema schema, Object obj) {
- checkNotNull(schema, "schema is not null");
- checkNotNull(obj, "data is not null");
+ checkNotNull(schema, "schema cannot be null");
+ checkNotNull(obj, "data cannot be null");
this.schema = schema;
this.data = obj;
}
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/Condition.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/Condition.java
index 40aab68..cbf3542 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/Condition.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/Condition.java
@@ -64,9 +64,9 @@
* @param value column data
*/
public Condition(String column, Function function, Object value) {
- checkNotNull(column, "column is not null");
- checkNotNull(function, "function is not null");
- checkNotNull(value, "value is not null");
+ checkNotNull(column, "column cannot be null");
+ checkNotNull(function, "function cannot be null");
+ checkNotNull(value, "value cannot be null");
this.column = column;
this.function = function;
this.value = value;
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/Mutation.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/Mutation.java
index aaad796..5b5293c 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/Mutation.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/Mutation.java
@@ -65,9 +65,9 @@
* @param value column data
*/
public Mutation(String column, Mutator mutator, Object value) {
- checkNotNull(column, "column is not null");
- checkNotNull(mutator, "mutator is not null");
- checkNotNull(value, "value is not null");
+ checkNotNull(column, "column cannot be null");
+ checkNotNull(mutator, "mutator cannot be null");
+ checkNotNull(value, "value cannot be null");
this.column = column;
this.mutator = mutator;
this.value = value;
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/OvsdbMap.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/OvsdbMap.java
index beb9222..fce3f69 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/OvsdbMap.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/OvsdbMap.java
@@ -38,7 +38,7 @@
* @param map java.util.Map
*/
private OvsdbMap(Map map) {
- checkNotNull(map, "map is not null");
+ checkNotNull(map, "map cannot be null");
this.map = map;
}
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/OvsdbSet.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/OvsdbSet.java
index db54906..fa5abe8 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/OvsdbSet.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/OvsdbSet.java
@@ -40,7 +40,7 @@
* @param set java.util.Set
*/
private OvsdbSet(Set set) {
- checkNotNull(set, "set is not null");
+ checkNotNull(set, "set cannot be null");
this.set = set;
}
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/RefTableRow.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/RefTableRow.java
index c3a245d..1b22a42 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/RefTableRow.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/RefTableRow.java
@@ -36,8 +36,8 @@
* @param jsonNode JsonNode
*/
public RefTableRow(String refTable, JsonNode jsonNode) {
- checkNotNull(refTable, "refTable is not null");
- checkNotNull(jsonNode, "jsonNode is not null");
+ checkNotNull(refTable, "refTable cannot be null");
+ checkNotNull(jsonNode, "jsonNode cannot be null");
this.refTable = refTable;
this.jsonNode = jsonNode;
}
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/Row.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/Row.java
index 3c2e53d..27a4f54 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/Row.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/Row.java
@@ -49,7 +49,7 @@
* @param tableSchema TableSchema entity
*/
public Row(TableSchema tableSchema) {
- checkNotNull(tableSchema, "tableSchema is not null");
+ checkNotNull(tableSchema, "tableSchema cannot be null");
this.tableSchema = tableSchema;
this.columns = Maps.newHashMap();
}
@@ -60,8 +60,8 @@
* @param columns List of Column entity
*/
public Row(TableSchema tableSchema, List<Column> columns) {
- checkNotNull(tableSchema, "tableSchema is not null");
- checkNotNull(columns, "columns is not null");
+ checkNotNull(tableSchema, "tableSchema cannot be null");
+ checkNotNull(columns, "columns cannot be null");
this.tableSchema = tableSchema;
this.columns = Maps.newHashMap();
for (Column column : columns) {
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/UUID.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/UUID.java
index a0dd08e..5077863 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/UUID.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/UUID.java
@@ -36,7 +36,7 @@
* @param value UUID value
*/
private UUID(String value) {
- checkNotNull(value, "value is not null");
+ checkNotNull(value, "value cannot be null");
this.value = value;
}
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/json/UUIDSerializer.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/json/UUIDSerializer.java
index ab2621d..8fb5c49 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/json/UUIDSerializer.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/notation/json/UUIDSerializer.java
@@ -20,7 +20,6 @@
import org.onosproject.ovsdb.rfc.notation.UUID;
import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
@@ -30,13 +29,12 @@
public class UUIDSerializer extends JsonSerializer<UUID> {
@Override
public void serialize(UUID value, JsonGenerator generator,
- SerializerProvider provider)
- throws IOException, JsonProcessingException {
+ SerializerProvider provider) throws IOException {
generator.writeStartArray();
- try {
- java.util.UUID.fromString(value.value());
+ String reg = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$";
+ if (value.value().matches(reg)) {
generator.writeString("uuid");
- } catch (IllegalArgumentException ex) {
+ } else {
generator.writeString("named-uuid");
}
generator.writeString(value.value());
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Assert.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Assert.java
index 7a2f454..92a6336 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Assert.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Assert.java
@@ -32,7 +32,7 @@
* @param lock the lock member of assert operation
*/
public Assert(String lock) {
- checkNotNull(lock, "lock is not null");
+ checkNotNull(lock, "lock cannot be null");
this.op = Operations.ASSERT.op();
this.lock = lock;
}
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Comment.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Comment.java
index c27de6b..2853e1f 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Comment.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Comment.java
@@ -32,7 +32,7 @@
* @param comment the comment member of comment operation
*/
public Comment(String comment) {
- checkNotNull(comment, "comment is not null");
+ checkNotNull(comment, "comment cannot be null");
this.op = Operations.COMMENT.op();
this.comment = comment;
}
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Commit.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Commit.java
index f888986..c87fb6e 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Commit.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Commit.java
@@ -32,7 +32,7 @@
* @param durable the durable member of commit operation
*/
public Commit(Boolean durable) {
- checkNotNull(durable, "durable is not null");
+ checkNotNull(durable, "durable cannot be null");
this.op = Operations.COMMIT.op();
this.durable = durable;
}
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Delete.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Delete.java
index 2254aa0..05fa9b8 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Delete.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Delete.java
@@ -41,7 +41,7 @@
* @param where the List of Condition entity
*/
public Delete(TableSchema schema, List<Condition> where) {
- checkNotNull(schema, "TableSchema is not null");
+ checkNotNull(schema, "TableSchema cannot be null");
checkNotNull(where, "where is not null");
this.tableSchema = schema;
this.op = Operations.DELETE.op();
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Insert.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Insert.java
index 6b46195..4186945 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Insert.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Insert.java
@@ -49,9 +49,9 @@
* @param row Row entity
*/
public Insert(TableSchema schema, String uuidName, Row row) {
- checkNotNull(schema, "TableSchema is not null");
- checkNotNull(uuidName, "uuidName is not null");
- checkNotNull(row, "row is not null");
+ checkNotNull(schema, "TableSchema cannot be null");
+ checkNotNull(uuidName, "uuid name cannot be null");
+ checkNotNull(row, "row cannot be null");
this.tableSchema = schema;
this.op = Operations.INSERT.op();
this.uuidName = uuidName;
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Mutate.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Mutate.java
index fd077e2..7b5e0f7 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Mutate.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Mutate.java
@@ -45,9 +45,9 @@
*/
public Mutate(TableSchema schema, List<Condition> where,
List<Mutation> mutations) {
- checkNotNull(schema, "TableSchema is not null");
- checkNotNull(mutations, "mutations is not null");
- checkNotNull(where, "where is not null");
+ checkNotNull(schema, "TableSchema cannot be null");
+ checkNotNull(mutations, "mutations cannot be null");
+ checkNotNull(where, "where cannot be null");
this.tableSchema = schema;
this.op = Operations.MUTATE.op();
this.where = where;
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Select.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Select.java
index cb73ea7..a8571c9 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Select.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Select.java
@@ -43,9 +43,9 @@
* @param columns the List of column name
*/
public Select(TableSchema schema, List<Condition> where, List<String> columns) {
- checkNotNull(schema, "TableSchema is not null");
- checkNotNull(where, "where is not null");
- checkNotNull(columns, "columns is not null");
+ checkNotNull(schema, "TableSchema cannot be null");
+ checkNotNull(where, "where cannot be null");
+ checkNotNull(columns, "columns cannot be null");
this.tableSchema = schema;
this.op = Operations.SELECT.op();
this.where = where;
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Update.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Update.java
index 61e7e6f..839e834 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Update.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/operations/Update.java
@@ -50,9 +50,9 @@
* @param where the List of Condition entity
*/
public Update(TableSchema schema, Row row, List<Condition> where) {
- checkNotNull(schema, "TableSchema is not null");
- checkNotNull(row, "row is not null");
- checkNotNull(where, "where is not null");
+ checkNotNull(schema, "TableSchema cannot be null");
+ checkNotNull(row, "row cannot be null");
+ checkNotNull(where, "where cannot be null");
this.tableSchema = schema;
this.op = Operations.UPDATE.op();
this.row = Maps.newHashMap();
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/ColumnSchema.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/ColumnSchema.java
index 2997bae..23eb2be 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/ColumnSchema.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/ColumnSchema.java
@@ -35,8 +35,8 @@
* @param columnType the column type
*/
public ColumnSchema(String name, ColumnType columnType) {
- checkNotNull(name, "name is not null");
- checkNotNull(columnType, "columnType is not null");
+ checkNotNull(name, "name cannot be null");
+ checkNotNull(columnType, "column type cannot be null");
this.name = name;
this.type = columnType;
}
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/DatabaseSchema.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/DatabaseSchema.java
index 3c29139..298afc6 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/DatabaseSchema.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/DatabaseSchema.java
@@ -40,9 +40,9 @@
*/
public DatabaseSchema(String name, String version,
Map<String, TableSchema> tableSchemas) {
- checkNotNull(name, "name is not null");
- checkNotNull(version, "version is not null");
- checkNotNull(tableSchemas, "tableSchemas is not null");
+ checkNotNull(name, "name cannot be null");
+ checkNotNull(version, "version cannot be null");
+ checkNotNull(tableSchemas, "tableSchemas cannot be null");
this.name = name;
this.version = version;
this.tableSchemas = tableSchemas;
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/TableSchema.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/TableSchema.java
index caec2ed..248745d 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/TableSchema.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/TableSchema.java
@@ -40,8 +40,8 @@
* @param columnSchemas a map of ColumnSchema
*/
public TableSchema(String name, Map<String, ColumnSchema> columnSchemas) {
- checkNotNull(name, "name is not null");
- checkNotNull(columnSchemas, "columnSchemas is not null");
+ checkNotNull(name, "name cannot be null");
+ checkNotNull(columnSchemas, "columnSchemas cannot be null");
this.name = name;
this.columnSchemas = columnSchemas;
}
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/type/AtomicColumnType.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/type/AtomicColumnType.java
index e083754..881755a 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/type/AtomicColumnType.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/type/AtomicColumnType.java
@@ -34,7 +34,7 @@
* @param baseType BaseType entity
*/
public AtomicColumnType(BaseType baseType) {
- checkNotNull(baseType, "BaseType is not null");
+ checkNotNull(baseType, "BaseType cannot be null");
this.baseType = baseType;
this.min = 1;
this.max = 1;
@@ -47,7 +47,7 @@
* @param max max constraint
*/
public AtomicColumnType(BaseType baseType, int min, int max) {
- checkNotNull(baseType, "BaseType is not null");
+ checkNotNull(baseType, "BaseType cannot be null");
this.baseType = baseType;
this.min = min;
this.max = max;
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/type/KeyValuedColumnType.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/type/KeyValuedColumnType.java
index 2419cdd..8407457 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/type/KeyValuedColumnType.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/type/KeyValuedColumnType.java
@@ -39,8 +39,8 @@
*/
public KeyValuedColumnType(BaseType keyType, BaseType valueType, int min,
int max) {
- checkNotNull(keyType, "keyType is not null");
- checkNotNull(valueType, "valueType is not null");
+ checkNotNull(keyType, "keyType cannot be null");
+ checkNotNull(valueType, "valueType cannot be null");
this.keyType = keyType;
this.valueType = valueType;
this.min = min;
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/type/UuidBaseType.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/type/UuidBaseType.java
index 9824966..46e0d9f 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/type/UuidBaseType.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/schema/type/UuidBaseType.java
@@ -16,6 +16,7 @@
package org.onosproject.ovsdb.rfc.schema.type;
import static com.google.common.base.MoreObjects.toStringHelper;
+import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Objects;
@@ -62,6 +63,7 @@
* @param refType refType constraint
*/
public UuidBaseType(String refTable, String refType) {
+ checkNotNull(refType, "refType cannot be null");
this.refTable = refTable;
this.refType = refType;
}
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/utils/ObjectMapperUtil.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/utils/ObjectMapperUtil.java
index bc92fe0..e80a52b 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/utils/ObjectMapperUtil.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/utils/ObjectMapperUtil.java
@@ -33,7 +33,7 @@
/**
* Constructs a ObjectMapperUtil object. Utility classes should not have a
- * public or default constructor, otherwise it will compile failed. This
+ * public or default constructor, otherwise IDE will compile unsuccessfully. This
* class should not be instantiated.
*/
private ObjectMapperUtil() {
diff --git a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/utils/TransValueUtil.java b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/utils/TransValueUtil.java
index 62b9232..694fa8b 100644
--- a/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/utils/TransValueUtil.java
+++ b/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/utils/TransValueUtil.java
@@ -43,7 +43,7 @@
/**
* Constructs a TransValueUtil object. Utility classes should not have a
- * public or default constructor, otherwise it will compile failed.
+ * public or default constructor, otherwise IDE will compile unsuccessfully.
* This class should not be instantiated.
*/
private TransValueUtil() {
@@ -81,7 +81,12 @@
return null;
}
- // Convert AtomicColumnType JsonNode into OvsdbSet value
+ /**
+ * Convert AtomicColumnType JsonNode into OvsdbSet value.
+ * @param json AtomicColumnType JsonNode
+ * @param atoType AtomicColumnType entity
+ * @return Object OvsdbSet or the value of JsonNode
+ */
private static Object getValueFromAtoType(JsonNode json,
AtomicColumnType atoType) {
BaseType baseType = atoType.baseType();
@@ -112,7 +117,12 @@
}
}
- // Convert KeyValuedColumnType JsonNode into OvsdbMap value
+ /**
+ * Convert KeyValuedColumnType JsonNode into OvsdbMap value.
+ * @param json KeyValuedColumnType JsonNode
+ * @param kvType KeyValuedColumnType entity
+ * @return Object OvsdbMap
+ */
private static Object getValueFromKvType(JsonNode json,
KeyValuedColumnType kvType) {
if (json.isArray()) {