Package google.registry.model.domain.fee
Class BaseFee
- java.lang.Object
-
- google.registry.model.ImmutableObject
-
- google.registry.model.domain.fee.BaseFee
-
- All Implemented Interfaces:
java.lang.Cloneable
public abstract class BaseFee extends ImmutableObject
Base class for the fee and credit types.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BaseFee.AppliedType
Enum for when a fee is applied.static class
BaseFee.FeeType
Enum for the type of the fee.-
Nested classes/interfaces inherited from class google.registry.model.ImmutableObject
ImmutableObject.DoNotHydrate, ImmutableObject.IgnoredInDiffableMap, ImmutableObject.Insignificant
-
-
Field Summary
-
Fields inherited from class google.registry.model.ImmutableObject
hashCode
-
-
Constructor Summary
Constructors Constructor Description BaseFee()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BaseFee.AppliedType
getApplied()
java.math.BigDecimal
getCost()
According to the fee extension specification, a fee must always be non-negative, while a credit must always be negative.java.lang.String
getDescription()
org.joda.time.Period
getGracePeriod()
java.lang.Boolean
getRefundable()
BaseFee.FeeType
getType()
com.google.common.collect.Range<org.joda.time.DateTime>
getValidDateRange()
boolean
hasDefaultAttributes()
boolean
hasValidDateRange()
boolean
hasZeroCost()
boolean
isPremium()
Returns whether the fee in question is a premium price.com.google.common.collect.ImmutableList<BaseFee.FeeType>
parseDescriptionForTypes()
Parses the description field and returnsBaseFee.FeeType
s that match the description.-
Methods inherited from class google.registry.model.ImmutableObject
clone, cloneEmptyToNull, createVKey, equals, getSignificantFields, hashCode, toDiffableFieldMap, toHydratedString, toString, toStringHelper
-
-
-
-
Method Detail
-
getDescription
public java.lang.String getDescription()
-
getApplied
public BaseFee.AppliedType getApplied()
-
getGracePeriod
public org.joda.time.Period getGracePeriod()
-
getRefundable
public java.lang.Boolean getRefundable()
-
isPremium
public boolean isPremium()
Returns whether the fee in question is a premium price.
-
getCost
public java.math.BigDecimal getCost()
According to the fee extension specification, a fee must always be non-negative, while a credit must always be negative. Essentially, they are the same thing, just with different sign. However, we need them to be separate classes for proper JAXB handling.
-
getType
public BaseFee.FeeType getType()
-
hasValidDateRange
public boolean hasValidDateRange()
-
getValidDateRange
public com.google.common.collect.Range<org.joda.time.DateTime> getValidDateRange()
-
hasZeroCost
public boolean hasZeroCost()
-
hasDefaultAttributes
public boolean hasDefaultAttributes()
-
parseDescriptionForTypes
public com.google.common.collect.ImmutableList<BaseFee.FeeType> parseDescriptionForTypes()
Parses the description field and returnsBaseFee.FeeType
s that match the description.A
BaseFee.FeeType
is a match when itsformatString
contains the description, case insensitively.
-
-