Review comment fixes : FLow CLassifier.
Change-Id: I4aeeaf5e9ec9b4bdbfba67da9558410ee44a9333
diff --git a/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/DefaultFlowClassifier.java b/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/DefaultFlowClassifier.java
index 39df2cf..7915ce0 100644
--- a/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/DefaultFlowClassifier.java
+++ b/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/DefaultFlowClassifier.java
@@ -43,6 +43,8 @@
private static final int NULL_PORT = 0;
private static final String FLOW_CLASSIFIER_ID_NOT_NULL = "FlowClassifier id can not be null.";
private static final String TENANT_ID_NOT_NULL = "Tenant id can not be null.";
+ private static final String NAME_NOT_NULL = "Name can not be null.";
+ private static final String ETHER_TYPE_NOT_NULL = "Ether Type can not be null.";
/**
* Constructor to create default flow classifier.
@@ -160,11 +162,9 @@
private FlowClassifierId flowClassifierId;
private TenantId tenantId;
private String name;
- private boolean isFlowClassifierNameSet = false;
private String description;
private boolean isFlowClassifierDescriptionSet = false;
private String etherType;
- private boolean isEtherTypeSet = false;
private String protocol;
private boolean isProtocolSet = false;
private int minSrcPortRange;
@@ -189,9 +189,9 @@
checkNotNull(flowClassifierId, FLOW_CLASSIFIER_ID_NOT_NULL);
checkNotNull(tenantId, TENANT_ID_NOT_NULL);
- String name = null;
+ checkNotNull(name, NAME_NOT_NULL);
+ checkNotNull(etherType, ETHER_TYPE_NOT_NULL);
String description = null;
- String etherType = null;
String protocol = null;
int minSrcPortRange = NULL_PORT;
int maxSrcPortRange = NULL_PORT;
@@ -202,15 +202,9 @@
VirtualPortId srcPort = null;
VirtualPortId dstPort = null;
- if (isFlowClassifierNameSet) {
- name = this.name;
- }
if (isFlowClassifierDescriptionSet) {
description = this.description;
}
- if (isEtherTypeSet) {
- etherType = this.etherType;
- }
if (isProtocolSet) {
protocol = this.protocol;
}
@@ -259,7 +253,6 @@
@Override
public Builder setName(String name) {
this.name = name;
- this.isFlowClassifierNameSet = true;
return this;
}
@@ -273,7 +266,6 @@
@Override
public Builder setEtherType(String etherType) {
this.etherType = etherType;
- this.isEtherTypeSet = true;
return this;
}