/* * * Panbox - encryption for cloud storage * Copyright (C) 2014-2015 by Fraunhofer SIT and Sirrix AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * Additonally, third party code may be provided with notices and open source * licenses from communities and third parties that govern the use of those * portions, and any licenses granted hereunder do not alter any rights and * obligations you may have under such open source licenses, however, the * disclaimer of warranty and limitation of liability provisions of the GPLv3 * will apply to all the product. * */ package org.panbox.core.identitymgmt; public class CloudProviderInfo { private int id = -1; protected String providerName; protected String username; @SuppressWarnings("unused") private CloudProviderInfo() {} public CloudProviderInfo(String providerName, String userName) { this.providerName = providerName; this.username = userName; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getProviderName() { return providerName; } public void setProviderName(String providerName) { this.providerName = providerName; } public int getId() { return id; } public void setId(int id) { this.id = id; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + id; result = prime * result + ((providerName == null) ? 0 : providerName.hashCode()); result = prime * result + ((username == null) ? 0 : username.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; CloudProviderInfo other = (CloudProviderInfo) obj; if (id != other.id) return false; if (providerName == null) { if (other.providerName != null) return false; } else if (!providerName.equals(other.providerName)) return false; if (username == null) { if (other.username != null) return false; } else if (!username.equals(other.username)) return false; return true; } }