mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Add billing account map to Registrar entity
A CurrencyUnit-to-BillingAccountEntry map is persisted in the Registrar entity. It provides flexibility for billing systems that assign different account ids for accounts under different currencies of the same registrar. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=151022753
This commit is contained in:
parent
ab9b7c613d
commit
d7e2009ddf
8 changed files with 225 additions and 39 deletions
|
@ -18,6 +18,7 @@ import com.google.common.base.Splitter;
|
|||
import com.google.common.base.Strings;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.util.Map;
|
||||
import org.joda.money.CurrencyUnit;
|
||||
|
||||
/**
|
||||
* Combined converter and validator class for key-value map JCommander argument strings.
|
||||
|
@ -93,4 +94,17 @@ public abstract class KeyValueMapParameter<K, V>
|
|||
return Integer.parseInt(value);
|
||||
}
|
||||
}
|
||||
|
||||
/** Combined converter and validator class for currency unit-to-string Map argument strings. */
|
||||
public static class CurrencyUnitToStringMap extends KeyValueMapParameter<CurrencyUnit, String> {
|
||||
@Override
|
||||
protected CurrencyUnit parseKey(String rawKey) {
|
||||
return CurrencyUnit.of(rawKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String parseValue(String value) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue