Class PremiumList
Note that the primary key of this entity is BaseDomainLabelList.revisionId
, which is auto-generated by
the database. So, if a retry of insertion happens after the previous attempt unexpectedly
succeeds, we will end up with having two exact same premium lists that differ only by revisionId.
This is fine though, because we only use the list with the highest revisionId.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A builder for constructingPremiumList
objects, since they are immutable.static class
A premium list entry entity, persisted to Cloud SQL.Nested classes/interfaces inherited from class google.registry.model.ImmutableObject
ImmutableObject.DoNotHydrate, ImmutableObject.IgnoredInDiffableMap, ImmutableObject.Insignificant
Nested classes/interfaces inherited from interface google.registry.model.Buildable
Buildable.GenericBuilder<S,
B extends Buildable.GenericBuilder<?, ?>>, Buildable.Overlayable<T> -
Field Summary
Fields inherited from class google.registry.model.ImmutableObject
hashCode
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.joda.money.Money
convertAmountToMoney
(BigDecimal amount) Converts a rawBigDecimal
amount to aMoney
by applying the list's currency.com.google.common.hash.BloomFilter
<String> Returns a Bloom filter to determine whether a label might be premium, or is definitely not.org.joda.money.CurrencyUnit
Returns theCurrencyUnit
used for this list.com.google.common.collect.ImmutableMap
<String, BigDecimal> Returns aMap
of domain labels to prices.boolean
refersToList
(Tld tld, String name) Methods inherited from class google.registry.model.tld.label.BaseDomainLabelList
getCreationTimestamp, getName, getReferencingTlds, getRevisionId, parse, splitOnComment
Methods inherited from class google.registry.model.ImmutableObject
clone, cloneEmptyToNull, createVKey, equals, getSignificantFields, hashCode, toDiffableFieldMap, toHydratedString, toString, toStringHelper
-
Constructor Details
-
PremiumList
public PremiumList()
-
-
Method Details
-
getCurrency
public org.joda.money.CurrencyUnit getCurrency()Returns theCurrencyUnit
used for this list. -
getLabelsToPrices
Returns aMap
of domain labels to prices.Note that this is lazily loaded and thus must be called inside a transaction. You generally should not be using this anyway as it's inefficient to load all of the PremiumEntry rows if you don't need them. To check prices, use
PremiumListDao.getPremiumPrice(java.lang.String, java.lang.String)
instead. -
convertAmountToMoney
Converts a rawBigDecimal
amount to aMoney
by applying the list's currency. -
getBloomFilter
Returns a Bloom filter to determine whether a label might be premium, or is definitely not.If the domain label might be premium, then the next step is to check for the existence of a corresponding row in the PremiumListEntry table. Otherwise, we know for sure it's not premium, and no DB load is required.
-
refersToList
- Specified by:
refersToList
in classBaseDomainLabelList<BigDecimal,
PremiumList.PremiumEntry>
-
asBuilder
-