Skip to content

Commit

Permalink
Add a way to get all unique and virtual accounts from the economy se…
Browse files Browse the repository at this point in the history
…rvice (#2152)

* Add a way to get all unique and virtual accounts from the economy service

* Add collection getters

* Use the same phrasing as the catalog registry

* Fix method names

* Remove unused import
  • Loading branch information
ImMorpheus authored Jul 8, 2020
1 parent 75ec550 commit 51a3b89
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
import org.spongepowered.api.service.economy.account.UniqueAccount;
import org.spongepowered.api.service.economy.account.VirtualAccount;

import java.util.Collection;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Stream;

/**
* Represents a service for managing a server economy.
Expand Down Expand Up @@ -108,6 +110,34 @@ public interface EconomyService extends ContextualService<Account> {
*/
Optional<Account> getOrCreateAccount(String identifier);

/**
* Gets a {@link Stream} of all available {@link UniqueAccount}s.
*
* @return A stream of all {@link UniqueAccount}s.
*/
Stream<UniqueAccount> streamUniqueAccounts();

/**
* Gets a {@link Collection} of all available {@link UniqueAccount}s.
*
* @return A Collection of all {@link UniqueAccount}s.
*/
Collection<UniqueAccount> getUniqueAccounts();

/**
* Gets a {@link Stream} of all available {@link VirtualAccount}s.
*
* @return A stream of all {@link VirtualAccount}s.
*/
Stream<VirtualAccount> streamVirtualAccounts();

/**
* Gets a {@link Collection} of all available {@link VirtualAccount}s.
*
* @return A Collection of all {@link VirtualAccount}s.
*/
Collection<VirtualAccount> getVirtualAccounts();

/**
* Deletes the account for the user with the specified {@link UUID}.
*
Expand Down

0 comments on commit 51a3b89

Please sign in to comment.