Class Account.Name
- java.lang.Object
-
- com.aoindustries.aoserv.client.account.Account.Name
-
- All Implemented Interfaces:
DtoFactory<AccountName>,FastExternalizable,Internable<Account.Name>,Externalizable,Serializable,Comparable<Account.Name>
- Enclosing class:
- Account
public static final class Account.Name extends Object implements Comparable<Account.Name>, FastExternalizable, DtoFactory<AccountName>, Internable<Account.Name>
The unique, case-insensitive identifier for anAccount. Account names must:- Be non-null
- Be non-empty
- Be between 2 and 32 characters
- Must start with
[a-z,A-Z] - Must end with
[a-z,A-Z,0-9] - Must contain only
[a-z,A-Z,0-9,_] - May not have consecutive underscores
- Author:
- AO Industries, Inc.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_LENGTHstatic intMIN_LENGTH
-
Constructor Summary
Constructors Constructor Description Name()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Account.Name other)booleanequals(Object O)AccountNamegetDto()longgetSerialVersionUID()inthashCode()Account.Nameintern()Interns this name much in the same fashion asString.intern().voidreadExternal(ObjectInput in)StringtoString()StringtoUpperCase()Gets the upper-case form of the code.static ValidationResultvalidate(String name)Validates a name.static Account.NamevalueOf(String name)voidwriteExternal(ObjectOutput out)
-
-
-
Field Detail
-
MIN_LENGTH
public static final int MIN_LENGTH
- See Also:
- Constant Field Values
-
MAX_LENGTH
public static final int MAX_LENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
validate
public static ValidationResult validate(String name)
Validates a name.
-
valueOf
public static Account.Name valueOf(String name) throws ValidationException
- Parameters:
name- whennull, returnsnull- Throws:
ValidationException
-
compareTo
public int compareTo(Account.Name other)
- Specified by:
compareToin interfaceComparable<Account.Name>
-
toUpperCase
public String toUpperCase()
Gets the upper-case form of the code. If two different names are interned and their toUpperCase is the same String instance, then they are equal in case-insensitive manner.
-
intern
public Account.Name intern()
Interns this name much in the same fashion asString.intern().- Specified by:
internin interfaceInternable<Account.Name>- See Also:
String.intern()
-
getDto
public AccountName getDto()
- Specified by:
getDtoin interfaceDtoFactory<AccountName>
-
getSerialVersionUID
public long getSerialVersionUID()
- Specified by:
getSerialVersionUIDin interfaceFastExternalizable
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
-