Class IdpAdapterName
- java.lang.Object
-
- com.inductiveautomation.ignition.gateway.auth.idp.IdpAdapterName
-
- All Implemented Interfaces:
java.lang.Comparable<IdpAdapterName>
public class IdpAdapterName extends java.lang.Object implements java.lang.Comparable<IdpAdapterName>
Wrapper around a raw IdP Adapter name
String
. Sanitizes the raw name such that:- The first character is replaced with an underscore if it is not an underscore or alphabetical
- Any remaining characters are replaced with underscores if they are not underscores, alphabetical or numeric
An IdpAdapaterName is equal to another if its sanitized name is equal to (ignoring case) the other's sanitized name.
Makes for good consistent hash keys as the hash code is based on the sanitized name converted to all lowercase characters.
When one IdpAdapterName is compared with another, the result is the same as if their sanitized names are compared with each other (ignoring case).
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(IdpAdapterName that)
boolean
equals(java.lang.Object o)
java.lang.String
getName()
int
hashCode()
static IdpAdapterName
of(java.lang.String name)
Create a newIdpAdapterName
given the raw name as aString
java.lang.String
toString()
-
-
-
Method Detail
-
getName
@Nonnull public java.lang.String getName()
- Returns:
- the raw un-sanitized name
-
of
@Nonnull public static IdpAdapterName of(@Nonnull java.lang.String name)
Create a newIdpAdapterName
given the raw name as aString
- Parameters:
name
- the raw name as aString
- Returns:
- the
IdpAdapterName
composed of the raw name as aString
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Returns:
- the sanitized name (preserving case)
-
compareTo
public int compareTo(@Nonnull IdpAdapterName that)
- Specified by:
compareTo
in interfacejava.lang.Comparable<IdpAdapterName>
-
-