Interface AccountRepository

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      de.japrost.jabudget.domain.account.Account create​(de.japrost.jabudget.domain.account.Account account)
      Create a new Account with the given values.
      java.lang.Boolean delete​(java.lang.String accountId)
      Delete an Account by its id.
      java.util.Set<de.japrost.jabudget.domain.account.Account> findAll()
      Find all Accounts.
      java.util.Optional<de.japrost.jabudget.domain.account.Account> findById​(java.lang.String id)
      Find an Account by id.
      void replaceAll​(java.util.Set<de.japrost.jabudget.domain.account.Account> accounts)
      Replace all Accounts with the given.
      de.japrost.jabudget.domain.account.Account update​(de.japrost.jabudget.domain.account.Account account)
      Update an existing Account.
    • Method Detail

      • create

        de.japrost.jabudget.domain.account.Account create​(de.japrost.jabudget.domain.account.Account account)
                                                   throws de.japrost.jabudget.domain.DomainException
        Create a new Account with the given values.
        Parameters:
        account - the Account to create.
        Returns:
        The account as stored in the repository.
        Throws:
        de.japrost.jabudget.domain.DomainException - with DomainFailure.DUPLICATE_ENTITY if the given account already exists.
      • update

        de.japrost.jabudget.domain.account.Account update​(de.japrost.jabudget.domain.account.Account account)
                                                   throws de.japrost.jabudget.domain.DomainException
        Update an existing Account.
        Parameters:
        account - the Account to update.
        Returns:
        The account as stored in the repository.
        Throws:
        de.japrost.jabudget.domain.DomainException - with DomainFailure.MISSING_ENTITY if the given account does not exist.
      • replaceAll

        void replaceAll​(java.util.Set<de.japrost.jabudget.domain.account.Account> accounts)
        Replace all Accounts with the given. Intended for imports.
        Parameters:
        accounts - the Accounts to fill the repository.
      • findAll

        java.util.Set<de.japrost.jabudget.domain.account.Account> findAll()
        Find all Accounts.
        Returns:
        all available Accounts.
      • findById

        java.util.Optional<de.japrost.jabudget.domain.account.Account> findById​(java.lang.String id)
        Find an Account by id.
        Parameters:
        id - the Account id.
        Returns:
        the Account with the id. An empty Optional if no Account is available for the given id.
      • delete

        java.lang.Boolean delete​(java.lang.String accountId)
        Delete an Account by its id.
        Parameters:
        accountId - the id of the Account to delete.
        Returns:
        Boolean.TRUE if the Account does not exist after this operation. It does not indicate that the entity to delete did exist. Returns Boolean.FALSE if the entity could not be deleted.