Simplify the use of the fee extension a little

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133149148
This commit is contained in:
cgoldfeder 2016-09-14 11:16:35 -07:00 committed by Ben McIlwain
parent 1ee02108ae
commit 01e2e0141d
11 changed files with 57 additions and 92 deletions

View file

@ -24,7 +24,7 @@ import org.joda.money.CurrencyUnit;
* of items requesting the fees for particular commands and domains. For some versions of the fee
* extension, the currency is also specified here; for other versions it is contained in the
* individual items.
*
*
* @type C the type of extension item used by this command (e.g. v6 items for a v6 extension)
* @type R the type of response returned for for this command (e.g. v6 responses for a v6 extension)
*/
@ -33,13 +33,14 @@ public interface FeeCheckCommandExtension<
R extends FeeCheckResponseExtension<?>>
extends CommandExtension {
/** True if this version of the fee extension specifies the currency at the top level. */
public boolean isCurrencySupported();
/**
* Three-character ISO4217 currency code.
*
* <p>Returns null if this version of the fee extension doesn't specify currency at the top level.
*/
public CurrencyUnit getCurrency();
/** Three-character currency code; throws an exception if currency is not supported. */
public CurrencyUnit getCurrency() throws UnsupportedOperationException;
public ImmutableSet<C> getItems();
public R createResponse(ImmutableList<? extends FeeCheckResponseExtensionItem> items);
}