2 * Copyright 2015 Open Networking Laboratory
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.onosproject.vtnrsc.sfc;
18 import java.util.Objects;
19 import java.util.UUID;
20 import com.google.common.base.MoreObjects;
23 * flow classification identifier.
25 public final class FlowClassifierId {
27 private final UUID flowClassifierId;
30 * Constructor to create flow classifier id.
32 * @param flowClassifierId flow classifier id.
34 private FlowClassifierId(final UUID flowClassifierId) {
35 this.flowClassifierId = flowClassifierId;
39 * Returns new flow classifier id.
41 * @param flowClassifierId flow classifier id
42 * @return new flow classifier id
44 public static FlowClassifierId flowClassifierId(final UUID flowClassifierId) {
45 return new FlowClassifierId(flowClassifierId);
49 public int hashCode() {
50 return Objects.hashCode(this.flowClassifierId);
54 public boolean equals(Object obj) {
58 if (obj instanceof FlowClassifierId) {
59 final FlowClassifierId other = (FlowClassifierId) obj;
60 return Objects.equals(this.flowClassifierId, other.flowClassifierId);
66 public String toString() {
67 return MoreObjects.toStringHelper(getClass())
68 .add("FlowClassifierId", flowClassifierId)