Class Name


  • public class Name
    extends java.lang.Object
    Representations for a person's name to assist with internationalization.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Name.Serializer
      For internal use only.
    • Constructor Summary

      Constructors 
      Constructor 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • givenName

        @Nonnull
        protected final java.lang.String givenName
      • surname

        @Nonnull
        protected final java.lang.String surname
      • familiarName

        @Nonnull
        protected final java.lang.String familiarName
      • displayName

        @Nonnull
        protected final java.lang.String displayName
      • abbreviatedName

        @Nonnull
        protected final java.lang.String abbreviatedName
    • Constructor Detail

      • Name

        public Name​(@Nonnull
                    java.lang.String givenName,
                    @Nonnull
                    java.lang.String surname,
                    @Nonnull
                    java.lang.String familiarName,
                    @Nonnull
                    java.lang.String displayName,
                    @Nonnull
                    java.lang.String abbreviatedName)
        Representations for a person's name to assist with internationalization.
        Parameters:
        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.
        Throws:
        java.lang.IllegalArgumentException - If any argument does not meet its preconditions.
    • Method Detail

      • getGivenName

        @Nonnull
        public java.lang.String getGivenName()
        Also known as a first name.
        Returns:
        value for this field, never null.
      • getSurname

        @Nonnull
        public java.lang.String getSurname()
        Also known as a last name or family name.
        Returns:
        value for this field, never null.
      • getFamiliarName

        @Nonnull
        public java.lang.String getFamiliarName()
        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().
        Returns:
        value for this field, never null.
      • getDisplayName

        @Nonnull
        public java.lang.String getDisplayName()
        A name that can be used directly to represent the name of a user's Dropbox account.
        Returns:
        value for this field, never null.
      • getAbbreviatedName

        @Nonnull
        public java.lang.String getAbbreviatedName()
        An abbreviated form of the person's name. Their initials in most locales.
        Returns:
        value for this field, never null.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toStringMultiline

        public java.lang.String toStringMultiline()
        Returns a String representation of this object formatted for easier readability.

        The returned String may contain newlines.

        Returns:
        Formatted, multiline String representation of this object