blob: 8b421c01132f3f31ff0e20556ce631be9e1f626c [file] [log] [blame]
Simon Huntf679c4e2016-04-01 17:02:24 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Simon Huntf679c4e2016-04-01 17:02:24 -07003 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17package org.onosproject.ui.model.topo;
18
19import org.onosproject.net.region.Region;
20
21/**
22 * Represents a specific "subset" of the UI model of the network topology
23 * that a user might wish to view. Backed by a {@link Region}.
24 */
25public class UiTopoLayout {
26
Thomas Vachuska4d66d0a2016-04-15 15:48:13 -070027 private final UiTopoLayoutId id;
28 private final Region region;
Thomas Vachuska92b016b2016-05-20 11:37:57 -070029 private final UiTopoLayoutId parent;
Simon Huntf679c4e2016-04-01 17:02:24 -070030
Thomas Vachuska4d66d0a2016-04-15 15:48:13 -070031 /**
32 * Created a new UI topology layout.
33 *
34 * @param id layout identifier
35 * @param region backing region
Thomas Vachuska92b016b2016-05-20 11:37:57 -070036 * @param parent identifier of the parent layout
Thomas Vachuska4d66d0a2016-04-15 15:48:13 -070037 */
Thomas Vachuska92b016b2016-05-20 11:37:57 -070038 public UiTopoLayout(UiTopoLayoutId id, Region region, UiTopoLayoutId parent) {
Thomas Vachuska4d66d0a2016-04-15 15:48:13 -070039 this.id = id;
40 this.region = region;
Thomas Vachuska92b016b2016-05-20 11:37:57 -070041 this.parent = parent;
Thomas Vachuska4d66d0a2016-04-15 15:48:13 -070042 }
43
44 /**
45 * Returns the UI layout identifier.
46 *
47 * @return identifier of the layout
48 */
49 public UiTopoLayoutId id() {
50 return id;
51 }
52
53 /**
54 * Returns the backing region with which this layout is associated.
55 *
56 * @return backing region
57 */
58 public Region region() {
59 return region;
60 }
61
Thomas Vachuska92b016b2016-05-20 11:37:57 -070062 /**
63 * Returns the parent layout identifier.
64 *
65 * @return parent layout identifier
66 */
67 public UiTopoLayoutId parent() {
68 return parent;
69 }
70
Thomas Vachuska4d66d0a2016-04-15 15:48:13 -070071 // TODO: additional properties pertinent to the layout
Simon Huntf679c4e2016-04-01 17:02:24 -070072}