public class Name
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Name.Serializer
For internal use only.
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
abbreviatedName |
protected java.lang.String |
displayName |
protected java.lang.String |
familiarName |
protected java.lang.String |
givenName |
protected java.lang.String |
surname |
Constructor and Description |
---|
Name(java.lang.String givenName,
java.lang.String surname,
java.lang.String familiarName,
java.lang.String displayName,
java.lang.String abbreviatedName)
Representations for a person's name to assist with internationalization.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getAbbreviatedName()
An abbreviated form of the person's name.
|
java.lang.String |
getDisplayName()
A name that can be used directly to represent the name of a user's
Dropbox account.
|
java.lang.String |
getFamiliarName()
Locale-dependent name.
|
java.lang.String |
getGivenName()
Also known as a first name.
|
java.lang.String |
getSurname()
Also known as a last name or family name.
|
int |
hashCode() |
java.lang.String |
toString() |
java.lang.String |
toStringMultiline()
Returns a String representation of this object formatted for easier
readability.
|
protected final java.lang.String givenName
protected final java.lang.String surname
protected final java.lang.String familiarName
protected final java.lang.String displayName
protected final java.lang.String abbreviatedName
public Name(java.lang.String givenName, java.lang.String surname, java.lang.String familiarName, java.lang.String displayName, java.lang.String abbreviatedName)
givenName
- Also known as a first name. Must not be null
.surname
- Also known as a last name or family name. Must not be
null
.familiarName
- Locale-dependent name. In the US, a person's
familiar name is their getGivenName()
, but elsewhere, it
could be any combination of a person's getGivenName()
and
getSurname()
. Must not be null
.displayName
- A name that can be used directly to represent the
name of a user's Dropbox account. Must not be null
.abbreviatedName
- An abbreviated form of the person's name. Their
initials in most locales. Must not be null
.java.lang.IllegalArgumentException
- If any argument does not meet its
preconditions.public java.lang.String getGivenName()
null
.public java.lang.String getSurname()
null
.public java.lang.String getFamiliarName()
getGivenName()
, but elsewhere, it could be any combination of
a person's getGivenName()
and getSurname()
.null
.public java.lang.String getDisplayName()
null
.public java.lang.String getAbbreviatedName()
null
.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringMultiline()
The returned String may contain newlines.