2 * Copyright (c) 2017 Red Hat, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.odlparent.bundlestest.lib;
10 import static java.util.Objects.requireNonNull;
12 import java.io.Serializable;
15 * Bundle's symbolic name + its version.
17 * @author Michael Vorburger.ch
19 public final class BundleSymbolicNameWithVersion implements Serializable {
20 private static final long serialVersionUID = 1L;
22 private final String symbolicName;
23 private final String version;
25 public BundleSymbolicNameWithVersion(String symbolicName, String version) {
26 this.symbolicName = requireNonNull(symbolicName, "symbolicName");
27 this.version = requireNonNull(version, "version");
30 public String getSymbolicName() {
34 public String getVersion() {
39 public int hashCode() {
42 result = prime * result + symbolicName.hashCode();
43 result = prime * result + version.hashCode();
48 public boolean equals(Object obj) {
55 if (!(obj instanceof BundleSymbolicNameWithVersion)) {
58 BundleSymbolicNameWithVersion other = (BundleSymbolicNameWithVersion) obj;
59 if (!symbolicName.equals(other.symbolicName)) {
62 if (!version.equals(other.version)) {
69 public String toString() {
70 return symbolicName + ":" + version;