Mohamed Rahil | a3b9e99 | 2016-02-16 20:26:49 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 Open Networking Laboratory |
| 3 | * |
| 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 | package org.onosproject.ospf.protocol.lsa.subtypes; |
| 17 | |
| 18 | import com.google.common.base.MoreObjects; |
| 19 | |
| 20 | /** |
| 21 | * Representation of an OSPF LSA link. |
| 22 | */ |
| 23 | public class OspfLsaLink { |
| 24 | |
| 25 | public String linkId; |
| 26 | public String linkData; |
| 27 | public int linkType; |
| 28 | public int metric; |
| 29 | public int tos; |
| 30 | |
| 31 | /** |
| 32 | * Gets link id. |
| 33 | * |
| 34 | * @return link id |
| 35 | */ |
| 36 | public String linkId() { |
| 37 | return linkId; |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Sets link id. |
| 42 | * |
| 43 | * @param linkId link id |
| 44 | */ |
| 45 | public void setLinkId(String linkId) { |
| 46 | this.linkId = linkId; |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Gets link data. |
| 51 | * |
| 52 | * @return link data |
| 53 | */ |
| 54 | public String linkData() { |
| 55 | return linkData; |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Sets link data. |
| 60 | * |
| 61 | * @param linkData link data |
| 62 | */ |
| 63 | public void setLinkData(String linkData) { |
| 64 | this.linkData = linkData; |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Gets link type. |
| 69 | * |
| 70 | * @return link type |
| 71 | */ |
| 72 | public int linkType() { |
| 73 | return linkType; |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Sets link type. |
| 78 | * |
| 79 | * @param linkType link type |
| 80 | */ |
| 81 | public void setLinkType(int linkType) { |
| 82 | this.linkType = linkType; |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * Gets metric value. |
| 87 | * |
| 88 | * @return metric. |
| 89 | */ |
| 90 | public int metric() { |
| 91 | return metric; |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Sets metric value. |
| 96 | * |
| 97 | * @param metric metric |
| 98 | */ |
| 99 | public void setMetric(int metric) { |
| 100 | this.metric = metric; |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * Gets tos. |
| 105 | * |
| 106 | * @return tos |
| 107 | */ |
| 108 | public int tos() { |
| 109 | return tos; |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | * Sets tos. |
| 114 | * |
| 115 | * @param tos tos |
| 116 | */ |
| 117 | public void setTos(int tos) { |
| 118 | this.tos = tos; |
| 119 | } |
| 120 | |
| 121 | @Override |
| 122 | public String toString() { |
| 123 | return MoreObjects.toStringHelper(getClass()) |
| 124 | .omitNullValues() |
| 125 | .add("linkID", linkId) |
| 126 | .add("linkData", linkData) |
| 127 | .add("linkType", linkType) |
| 128 | .add("metric", metric) |
| 129 | .add("tos", tos) |
| 130 | .toString(); |
| 131 | } |
| 132 | } |