Skip to content
Snippets Groups Projects
Commit 245ced3c authored by abat's avatar abat
Browse files

Merge into master from pull request #3271:

BVS known devices for sync and small change for SwitchPort (https://github.com/bigswitch/bigswitchcontroller/pull/3271)
parents 04af368c f759ce5d
No related branches found
No related tags found
No related merge requests found
/**
* Copyright 2012 Big Switch Networks, Inc.
* Copyright 2012 Big Switch Networks, Inc.
* Originally created by David Erickson, Stanford University
*
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
......@@ -24,6 +24,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
/**
* A simple switch DPID/port pair
* This class is immutable
* @author readams
*
*/
......@@ -31,12 +32,12 @@ public class SwitchPort {
@JsonSerialize(using=ToStringSerializer.class)
public enum ErrorStatus {
DUPLICATE_DEVICE("duplicate-device");
private String value;
ErrorStatus(String v) {
value = v;
}
@Override
public String toString() {
return value;
......@@ -51,10 +52,10 @@ public class SwitchPort {
return null;
}
}
protected long switchDPID;
protected int port;
ErrorStatus errorStatus;
private final long switchDPID;
private final int port;
private final ErrorStatus errorStatus;
/**
* Simple constructor
......@@ -80,7 +81,7 @@ public class SwitchPort {
this.port = port;
this.errorStatus = null;
}
// ***************
// Getters/Setters
// ***************
......@@ -89,11 +90,11 @@ public class SwitchPort {
public long getSwitchDPID() {
return switchDPID;
}
public int getPort() {
return port;
}
public ErrorStatus getErrorStatus() {
return errorStatus;
}
......@@ -101,7 +102,7 @@ public class SwitchPort {
// ******
// Object
// ******
@Override
public int hashCode() {
final int prime = 31;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment