Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
Merge d26efc5 into 2b33060
Browse files Browse the repository at this point in the history
  • Loading branch information
hechaoli committed Apr 23, 2018
2 parents 2b33060 + d26efc5 commit 3c04c7a
Show file tree
Hide file tree
Showing 47 changed files with 629 additions and 430 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,8 @@
*/
public class JsonRpcConnectionClosedException extends JsonRpcException {

public JsonRpcConnectionClosedException() {
super();
}

public JsonRpcConnectionClosedException(String message) {
super(message);
}

public JsonRpcConnectionClosedException(Throwable cause) {
super(cause);
}

public JsonRpcConnectionClosedException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,8 @@
*/
public class JsonRpcDuplicateIdException extends JsonRpcException {

public JsonRpcDuplicateIdException() {
super();
}

public JsonRpcDuplicateIdException(String message) {
super(message);
}

public JsonRpcDuplicateIdException(Throwable cause) {
super(cause);
}

public JsonRpcDuplicateIdException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
*/
public class JsonRpcException extends Exception {

public JsonRpcException() {
super();
}

public JsonRpcException(String message) {
super(message);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@
*/
public class JsonRpcInvalidResponseException extends JsonRpcException {

public JsonRpcInvalidResponseException() {
super();
}

public JsonRpcInvalidResponseException(String message) {
super(message);
}

public JsonRpcInvalidResponseException(Throwable cause) {
super(cause);
}

public JsonRpcInvalidResponseException(String message, Throwable cause) {
super(message, cause);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@
*/
public class JsonRpcResultTypeMismatchException extends JsonRpcException {

public JsonRpcResultTypeMismatchException() {
super();
}

public JsonRpcResultTypeMismatchException(String message) {
super(message);
}

public JsonRpcResultTypeMismatchException(Throwable cause) {
super(cause);
}

public JsonRpcResultTypeMismatchException(String message, Throwable cause) {
super(message, cause);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
*/
public class JsonRpcTransportException extends JsonRpcException {

public JsonRpcTransportException() {
super();
}

public JsonRpcTransportException(String message) {
super(message);
}
Expand All @@ -31,7 +27,4 @@ public JsonRpcTransportException(Throwable cause) {
super(cause);
}

public JsonRpcTransportException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@

public class OvsdbClientException extends Exception {

public OvsdbClientException() {
super();
}

public OvsdbClientException(String message) {
super(message);
}
Expand All @@ -28,7 +24,4 @@ public OvsdbClientException(Throwable cause) {
super(cause);
}

public OvsdbClientException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.List;
import java.util.Objects;

/**
* Representation of {@literal <monitor-request>}.
Expand All @@ -31,16 +32,34 @@
public class MonitorRequest {

@JsonInclude(JsonInclude.Include.NON_NULL)
private List<String> columns;
private final List<String> columns;

@JsonInclude(JsonInclude.Include.NON_NULL)
private MonitorSelect select;
private final MonitorSelect select;

/**
* Create an {@link MonitorRequest} object with all fields being default values.
*/
public MonitorRequest() {
this(null, null);
}

/**
* Create an {@link MonitorRequest} object with select being default value.
*
* @param columns value of the "columns" field
*/
public MonitorRequest(List<String> columns) {
this(columns, null);
}

/**
* Create an {@link MonitorRequest} object with columns being default value.
*
* @param select value of the "select" field
*/
public MonitorRequest(MonitorSelect select) {
this(null, select);
}

/**
Expand All @@ -58,16 +77,26 @@ public List<String> getColumns() {
return columns;
}

public void setColumns(List<String> columns) {
this.columns = columns;
}

public MonitorSelect getSelect() {
return select;
}

public void setSelect(MonitorSelect select) {
this.select = select;
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (!(other instanceof MonitorRequest)) {
return false;
}
MonitorRequest that = (MonitorRequest) other;
return Objects.equals(columns, that.getColumns())
&& Objects.equals(select, that.getSelect());
}

@Override
public int hashCode() {
return Objects.hash(columns, select);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.vmware.ovsdb.protocol.operation.notation.serializer.MonitorRequestsSerializer;

import java.util.Map;
import java.util.Objects;

/**
* The {@literal <monitor-requests>} object maps the name of the table to be monitored to an array
Expand All @@ -36,6 +37,23 @@ public Map<String, MonitorRequest> getMonitorRequests() {
return monitorRequests;
}

@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (!(other instanceof MonitorRequests)) {
return false;
}
MonitorRequests that = (MonitorRequests) other;
return Objects.equals(monitorRequests, that.getMonitorRequests());
}

@Override
public int hashCode() {
return Objects.hash(monitorRequests);
}

@Override
public String toString() {
return getClass().getSimpleName() + " ["
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.Objects;

/**
* Representation of {@literal <monitor-select>}.
*
Expand Down Expand Up @@ -64,36 +66,60 @@ public MonitorSelect(Boolean initial, Boolean insert, Boolean delete, Boolean mo
this.modify = modify;
}

public Boolean isInitial() {
public Boolean getInitial() {
return initial;
}

public void setInitial(Boolean initial) {
public MonitorSelect setInitial(Boolean initial) {
this.initial = initial;
return this;
}

public Boolean isInsert() {
public Boolean getInsert() {
return insert;
}

public void setInsert(Boolean insert) {
public MonitorSelect setInsert(Boolean insert) {
this.insert = insert;
return this;
}

public Boolean isDelete() {
public Boolean getDelete() {
return delete;
}

public void setDelete(Boolean delete) {
public MonitorSelect setDelete(Boolean delete) {
this.delete = delete;
return this;
}

public Boolean isModify() {
public Boolean getModify() {
return modify;
}

public void setModify(Boolean modify) {
public MonitorSelect setModify(Boolean modify) {
this.modify = modify;
return this;
}

@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (!(other instanceof MonitorSelect)) {
return false;
}
MonitorSelect that = (MonitorSelect) other;
return Objects.equals(initial, that.getInitial())
&& Objects.equals(insert, that.getInsert())
&& Objects.equals(delete, that.getDelete())
&& Objects.equals(modify, that.getModify());
}

@Override
public int hashCode() {
return Objects.hash(initial, insert, delete, modify);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.vmware.ovsdb.protocol.operation.notation.Row;

import java.util.Objects;

public class RowUpdate {

private Row oldRow;
Expand All @@ -36,27 +38,18 @@ public Row getOld() {
return oldRow;
}

public void setOld(Row oldRow) {
public RowUpdate setOld(Row oldRow) {
this.oldRow = oldRow;
return this;
}

public Row getNew() {
return newRow;
}

public void setNew(Row newRow) {
public RowUpdate setNew(Row newRow) {
this.newRow = newRow;
}

@Override
public int hashCode() {
int result = oldRow != null
? oldRow.hashCode()
: 0;
result = 31 * result + (newRow != null
? newRow.hashCode()
: 0);
return result;
return this;
}

@Override
Expand All @@ -67,17 +60,14 @@ public boolean equals(Object other) {
if (!(other instanceof RowUpdate)) {
return false;
}

RowUpdate rowUpdate = (RowUpdate) other;
return Objects.equals(oldRow, rowUpdate.getOld())
&& Objects.equals(newRow, rowUpdate.getNew());
}

if (oldRow != null
? !oldRow.equals(rowUpdate.oldRow)
: rowUpdate.oldRow != null) {
return false;
}
return newRow != null
? newRow.equals(rowUpdate.newRow)
: rowUpdate.newRow == null;
@Override
public int hashCode() {
return Objects.hash(oldRow, newRow);
}

@Override
Expand Down
Loading

0 comments on commit 3c04c7a

Please sign in to comment.