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.openstackswitching;
18 import static com.google.common.base.Preconditions.checkNotNull;
22 * Represents the network information given by Neutron.
24 public final class OpenstackNetwork {
27 private String tenantId;
28 private String segmentId;
29 private String networkType;
33 * Returns the builder object of the OpenstackNetwork class.
35 * @return OpenstackNetwork builder object
37 public static OpenstackNetwork.Builder builder() {
41 private OpenstackNetwork(String name, String tenantId, String id, String sid,
43 this.name = checkNotNull(name);
44 this.tenantId = checkNotNull(tenantId);
45 this.segmentId = checkNotNull(sid);
46 this.id = checkNotNull(id);
47 this.networkType = checkNotNull(type);
50 public String name() {
54 public String tenantId() {
62 public String segmentId() {
63 return this.segmentId;
66 public String networkType() {
67 return this.networkType;
70 public static final class Builder {
72 private String tenantId;
75 private String networkType;
77 public Builder name(String name) {
83 public Builder tenantId(String tenantId) {
84 this.tenantId = tenantId;
89 public Builder id(String id) {
95 public Builder segmentId(String sid) {
101 public Builder networkType(String type) {
102 this.networkType = type;
107 public OpenstackNetwork build() {
108 return new OpenstackNetwork(name, tenantId, id, sid, networkType);