Committed by
Gerrit Code Review
Review comment fixes : FLow CLassifier.
Change-Id: I4aeeaf5e9ec9b4bdbfba67da9558410ee44a9333
Showing
1 changed file
with
4 additions
and
12 deletions
... | @@ -43,6 +43,8 @@ public final class DefaultFlowClassifier implements FlowClassifier { | ... | @@ -43,6 +43,8 @@ public final class DefaultFlowClassifier implements FlowClassifier { |
43 | private static final int NULL_PORT = 0; | 43 | private static final int NULL_PORT = 0; |
44 | private static final String FLOW_CLASSIFIER_ID_NOT_NULL = "FlowClassifier id can not be null."; | 44 | private static final String FLOW_CLASSIFIER_ID_NOT_NULL = "FlowClassifier id can not be null."; |
45 | private static final String TENANT_ID_NOT_NULL = "Tenant id can not be null."; | 45 | private static final String TENANT_ID_NOT_NULL = "Tenant id can not be null."; |
46 | + private static final String NAME_NOT_NULL = "Name can not be null."; | ||
47 | + private static final String ETHER_TYPE_NOT_NULL = "Ether Type can not be null."; | ||
46 | 48 | ||
47 | /** | 49 | /** |
48 | * Constructor to create default flow classifier. | 50 | * Constructor to create default flow classifier. |
... | @@ -160,11 +162,9 @@ public final class DefaultFlowClassifier implements FlowClassifier { | ... | @@ -160,11 +162,9 @@ public final class DefaultFlowClassifier implements FlowClassifier { |
160 | private FlowClassifierId flowClassifierId; | 162 | private FlowClassifierId flowClassifierId; |
161 | private TenantId tenantId; | 163 | private TenantId tenantId; |
162 | private String name; | 164 | private String name; |
163 | - private boolean isFlowClassifierNameSet = false; | ||
164 | private String description; | 165 | private String description; |
165 | private boolean isFlowClassifierDescriptionSet = false; | 166 | private boolean isFlowClassifierDescriptionSet = false; |
166 | private String etherType; | 167 | private String etherType; |
167 | - private boolean isEtherTypeSet = false; | ||
168 | private String protocol; | 168 | private String protocol; |
169 | private boolean isProtocolSet = false; | 169 | private boolean isProtocolSet = false; |
170 | private int minSrcPortRange; | 170 | private int minSrcPortRange; |
... | @@ -189,9 +189,9 @@ public final class DefaultFlowClassifier implements FlowClassifier { | ... | @@ -189,9 +189,9 @@ public final class DefaultFlowClassifier implements FlowClassifier { |
189 | 189 | ||
190 | checkNotNull(flowClassifierId, FLOW_CLASSIFIER_ID_NOT_NULL); | 190 | checkNotNull(flowClassifierId, FLOW_CLASSIFIER_ID_NOT_NULL); |
191 | checkNotNull(tenantId, TENANT_ID_NOT_NULL); | 191 | checkNotNull(tenantId, TENANT_ID_NOT_NULL); |
192 | - String name = null; | 192 | + checkNotNull(name, NAME_NOT_NULL); |
193 | + checkNotNull(etherType, ETHER_TYPE_NOT_NULL); | ||
193 | String description = null; | 194 | String description = null; |
194 | - String etherType = null; | ||
195 | String protocol = null; | 195 | String protocol = null; |
196 | int minSrcPortRange = NULL_PORT; | 196 | int minSrcPortRange = NULL_PORT; |
197 | int maxSrcPortRange = NULL_PORT; | 197 | int maxSrcPortRange = NULL_PORT; |
... | @@ -202,15 +202,9 @@ public final class DefaultFlowClassifier implements FlowClassifier { | ... | @@ -202,15 +202,9 @@ public final class DefaultFlowClassifier implements FlowClassifier { |
202 | VirtualPortId srcPort = null; | 202 | VirtualPortId srcPort = null; |
203 | VirtualPortId dstPort = null; | 203 | VirtualPortId dstPort = null; |
204 | 204 | ||
205 | - if (isFlowClassifierNameSet) { | ||
206 | - name = this.name; | ||
207 | - } | ||
208 | if (isFlowClassifierDescriptionSet) { | 205 | if (isFlowClassifierDescriptionSet) { |
209 | description = this.description; | 206 | description = this.description; |
210 | } | 207 | } |
211 | - if (isEtherTypeSet) { | ||
212 | - etherType = this.etherType; | ||
213 | - } | ||
214 | if (isProtocolSet) { | 208 | if (isProtocolSet) { |
215 | protocol = this.protocol; | 209 | protocol = this.protocol; |
216 | } | 210 | } |
... | @@ -259,7 +253,6 @@ public final class DefaultFlowClassifier implements FlowClassifier { | ... | @@ -259,7 +253,6 @@ public final class DefaultFlowClassifier implements FlowClassifier { |
259 | @Override | 253 | @Override |
260 | public Builder setName(String name) { | 254 | public Builder setName(String name) { |
261 | this.name = name; | 255 | this.name = name; |
262 | - this.isFlowClassifierNameSet = true; | ||
263 | return this; | 256 | return this; |
264 | } | 257 | } |
265 | 258 | ||
... | @@ -273,7 +266,6 @@ public final class DefaultFlowClassifier implements FlowClassifier { | ... | @@ -273,7 +266,6 @@ public final class DefaultFlowClassifier implements FlowClassifier { |
273 | @Override | 266 | @Override |
274 | public Builder setEtherType(String etherType) { | 267 | public Builder setEtherType(String etherType) { |
275 | this.etherType = etherType; | 268 | this.etherType = etherType; |
276 | - this.isEtherTypeSet = true; | ||
277 | return this; | 269 | return this; |
278 | } | 270 | } |
279 | 271 | ... | ... |
-
Please register or login to post a comment