Class Account

  • All Implemented Interfaces:
    java.io.Serializable

    public class Account
    extends java.lang.Object
    implements java.io.Serializable
    An account in JaBudGet.
    The Account is identified by its id.
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Account.Builder
      Builder for Accounts.
    • Constructor Summary

      Constructors 
      Constructor Description
      Account​(java.lang.String id)
      Create an account.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      java.lang.String getId()
      Gets the identity of the Account.
      java.lang.String getName()
      Gets the given name of the Account.
      int hashCode()
      void setName​(java.lang.String name)
      Sets the given name of the Account.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

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

      • Account

        public Account​(java.lang.String id)
        Create an account.
        Parameters:
        id - the id. MUST NOT be null.
    • Method Detail

      • getId

        public java.lang.String getId()
        Gets the identity of the Account.
        Returns:
        the identity of an Account.
      • getName

        public java.lang.String getName()
        Gets the given name of the Account.
        Returns:
        the given name. If no name is given returns an empty String.
      • setName

        public void setName​(java.lang.String name)
        Sets the given name of the Account.
        Parameters:
        name - the new given name. SHOULD NOT BE null.
      • hashCode

        public int hashCode()

        This implementation uses just id.

        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)

        This implementation uses just id.

        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()

        This implementation shows all fields.

        Overrides:
        toString in class java.lang.Object