/** * ============================================================================= * * ORCID (R) Open Source * http://orcid.org * * Copyright (c) 2012-2014 ORCID, Inc. * Licensed under an MIT-Style License (MIT) * http://orcid.org/open-source-license * * This copyright and license information (including a link to the full license) * shall be included in its entirety in all copies or substantial portion of * the software. * * ============================================================================= */ package org.orcid.persistence.jpa.entities.keys; import java.io.Serializable; import org.orcid.persistence.jpa.entities.ProfileEntity; /** * @author Will Simpson */ public class WebhookEntityPk implements Serializable { private static final long serialVersionUID = 1L; private ProfileEntity profile; private String uri; public WebhookEntityPk() { } public WebhookEntityPk(ProfileEntity profile, String uri) { this.profile = profile; this.uri = uri; } public ProfileEntity getProfile() { return profile; } public void setProfile(ProfileEntity profile) { this.profile = profile; } public String getUri() { return uri; } public void setUri(String uri) { this.uri = uri; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((profile == null) ? 0 : profile.hashCode()); result = prime * result + ((uri == null) ? 0 : uri.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; WebhookEntityPk other = (WebhookEntityPk) obj; if (profile == null) { if (other.profile != null) return false; } else if (!profile.equals(other.profile)) return false; if (uri == null) { if (other.uri != null) return false; } else if (!uri.equals(other.uri)) return false; return true; } }