diff options
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/spi/RepositoryReference.java')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/spi/RepositoryReference.java | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/spi/RepositoryReference.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/spi/RepositoryReference.java new file mode 100644 index 000000000..b50398f41 --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/spi/RepositoryReference.java @@ -0,0 +1,58 @@ +/******************************************************************************* + * Copyright (c) 2008, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.equinox.p2.repository.spi; + +import java.net.URI; + +/** + * Serialization helper class for repository references. + * @since 2.0 + */ +public class RepositoryReference { + public URI Location; + public int Type; + public int Options; + public String Nickname; + + public RepositoryReference(URI location, String nickname, int type, int options) { + this.Location = location; + this.Type = type; + this.Options = options; + this.Nickname = nickname; + } + + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + RepositoryReference other = (RepositoryReference) obj; + if (Location == null) { + if (other.Location != null) + return false; + } else if (!Location.equals(other.Location)) + return false; + if (Type != other.Type) + return false; + return true; + } + + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((Location == null) ? 0 : Location.hashCode()); + result = prime * result + Type; + return result; + } + +}
\ No newline at end of file |