68 lines
1.4 KiB
Java
68 lines
1.4 KiB
Java
|
package org.gcube.smartgears.security;
|
||
|
|
||
|
import org.gcube.common.validator.annotations.NotEmpty;
|
||
|
import org.gcube.common.validator.annotations.NotNull;
|
||
|
|
||
|
public class SimpleCredentials implements Credentials{
|
||
|
|
||
|
@NotNull @NotEmpty
|
||
|
String clientID;
|
||
|
|
||
|
@NotNull @NotEmpty
|
||
|
String secret;
|
||
|
|
||
|
public String getClientID() {
|
||
|
return clientID;
|
||
|
}
|
||
|
|
||
|
public void setClientID(String clientID) {
|
||
|
this.clientID = clientID;
|
||
|
}
|
||
|
|
||
|
public String getSecret() {
|
||
|
return secret;
|
||
|
}
|
||
|
|
||
|
public void setSecret(String secret) {
|
||
|
this.secret = secret;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public int hashCode() {
|
||
|
final int prime = 31;
|
||
|
int result = 1;
|
||
|
result = prime * result + ((clientID == null) ? 0 : clientID.hashCode());
|
||
|
result = prime * result + ((secret == null) ? 0 : secret.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;
|
||
|
SimpleCredentials other = (SimpleCredentials) obj;
|
||
|
if (clientID == null) {
|
||
|
if (other.clientID != null)
|
||
|
return false;
|
||
|
} else if (!clientID.equals(other.clientID))
|
||
|
return false;
|
||
|
if (secret == null) {
|
||
|
if (other.secret != null)
|
||
|
return false;
|
||
|
} else if (!secret.equals(other.secret))
|
||
|
return false;
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public String toString() {
|
||
|
return "SimpleCredentials [clientID=" + clientID + ", secret=" + secret + "]";
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|