public abstract class Mechanism
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
OATH |
static java.lang.String |
PUSH |
| Modifier | Constructor and Description |
|---|---|
protected |
Mechanism(java.lang.String mechanismUID,
java.lang.String issuer,
java.lang.String accountName,
java.lang.String type,
java.lang.String secret,
java.util.Calendar timeAdded)
Base constructor which encapsulates common elements of all Mechanisms.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Mechanism another) |
static Mechanism |
deserialize(java.lang.String jsonString)
Deserializes the specified Json into an object of the
Mechanism object. |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getAccountName()
Returns the name of this Account.
|
java.lang.String |
getId()
Gets the storage id of the Mechanism.
|
java.lang.String |
getIssuer()
Gets the name of the IDP that issued this account.
|
java.lang.String |
getMechanismUID()
Get the mechanism unique Id.
|
java.util.Calendar |
getTimeAdded()
Get the Date and Time this mechanism was stored.
|
java.lang.String |
getType()
Get the string used to represent this type of mechanism.
|
int |
hashCode() |
boolean |
matches(Mechanism other)
Returns true if the two objects would conflict if added to a storage system.
|
abstract java.lang.String |
toJson()
Creates a JSON string representation of
T object. |
public static final java.lang.String PUSH
public static final java.lang.String OATH
protected Mechanism(java.lang.String mechanismUID,
java.lang.String issuer,
java.lang.String accountName,
java.lang.String type,
java.lang.String secret,
java.util.Calendar timeAdded)
mechanismUID - The ID used to identify the Mechanism to external systemsissuer - String value of issueraccountName - String value of accountName or usernametype - String value of the mechanism typesecret - String value of the shared secrettimeAdded - Date and Time this Mechanism was storedpublic java.lang.String getId()
public java.lang.String getMechanismUID()
public java.lang.String getIssuer()
public java.lang.String getAccountName()
public java.lang.String getType()
public java.util.Calendar getTimeAdded()
public abstract java.lang.String toJson()
T object. Sensitive information are not
exposed.public static Mechanism deserialize(java.lang.String jsonString)
Mechanism object.jsonString - the json string representing the object to be deserializedMechanism object from the string. Returns null if jsonString is null,
if jsonString is empty or not able to parse it.public final boolean matches(Mechanism other)
other - The object to compare.public int compareTo(Mechanism another)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object