| /******************************************************************************* |
| * Copyright (c) 2012 SAP AG 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: |
| * SAP AG - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.platform.discovery.destprefs.internal.prefpage.ui; |
| |
| import org.eclipse.platform.discovery.runtime.internal.model.descriptions.IDestinationCategoryDescription; |
| import org.eclipse.platform.discovery.runtime.internal.model.descriptions.IDestinationsProviderDescription; |
| |
| public class CategoryDestinationProviderPair { |
| public final IDestinationCategoryDescription category; |
| public final IDestinationsProviderDescription destinationProvider; |
| |
| private final String catId; |
| private final String providerId; |
| |
| public CategoryDestinationProviderPair(final IDestinationCategoryDescription category, final IDestinationsProviderDescription destinationProvider) { |
| this.category = category; |
| this.destinationProvider = destinationProvider; |
| |
| this.catId = category.getId(); |
| this.providerId = destinationProvider.getId(); |
| } |
| |
| @Override |
| public int hashCode() { |
| final int prime = 31; |
| int result = 1; |
| result = prime * result + ((catId == null) ? 0 : catId.hashCode()); |
| result = prime * result |
| + ((providerId == null) ? 0 : providerId.hashCode()); |
| return result; |
| } |
| |
| @Override |
| public boolean equals(Object obj) { |
| if (this == obj) |
| return true; |
| if (obj == null) |
| return false; |
| if (getClass() != obj.getClass()) |
| return false; |
| CategoryDestinationProviderPair other = (CategoryDestinationProviderPair) obj; |
| if (catId == null) { |
| if (other.catId != null) |
| return false; |
| } else if (!catId.equals(other.catId)) |
| return false; |
| if (providerId == null) { |
| if (other.providerId != null) |
| return false; |
| } else if (!providerId.equals(other.providerId)) |
| return false; |
| return true; |
| } |
| |
| } |