Yuta HIGUCHI | 39ede6a | 2014-10-03 15:23:33 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net; |
| 2 | |
| 3 | public final class AnnotationsUtil { |
| 4 | |
| 5 | public static boolean isEqual(Annotations lhs, Annotations rhs) { |
| 6 | if (lhs == rhs) { |
| 7 | return true; |
| 8 | } |
| 9 | if (lhs == null || rhs == null) { |
| 10 | return false; |
| 11 | } |
| 12 | |
| 13 | if (!lhs.keys().equals(rhs.keys())) { |
| 14 | return false; |
| 15 | } |
| 16 | |
| 17 | for (String key : lhs.keys()) { |
| 18 | if (!lhs.value(key).equals(rhs.value(key))) { |
| 19 | return false; |
| 20 | } |
| 21 | } |
| 22 | return true; |
| 23 | } |
| 24 | |
| 25 | // not to be instantiated |
| 26 | private AnnotationsUtil() {} |
| 27 | } |