// Copyright 2017 The Nomulus Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package google.registry.model.domain.fee; import static com.google.common.base.MoreObjects.firstNonNull; import static com.google.common.base.Preconditions.checkState; import static com.google.common.collect.ImmutableList.toImmutableList; import com.google.common.base.Ascii; import com.google.common.collect.ImmutableList; import com.google.common.collect.Range; import google.registry.model.ImmutableObject; import google.registry.xml.PeriodAdapter; import java.math.BigDecimal; import java.util.stream.Stream; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlValue; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import org.joda.time.DateTime; import org.joda.time.Period; /** Base class for the fee and credit types. */ @XmlTransient public abstract class BaseFee extends ImmutableObject { /** Enum for when a fee is applied. */ public enum AppliedType { @XmlEnumValue("immediate") IMMEDIATE, @XmlEnumValue("delayed") DELAYED } /** Enum for the type of the fee. */ public enum FeeType { CREATE("create"), EAP("Early Access Period, fee expires: %s", "Early Access Period"), RENEW("renew"), RESTORE("restore"), /** * A transfer fee. * *
These are not used by the default system, in which the only fee associated with a transfer
* is the RENEW fee. These exist so that custom pricing logic can create a custom transfer fee
* if desired.
*/
TRANSFER("transfer"),
UPDATE("update"),
CREDIT("%s credit");
private final String formatString;
private final ImmutableList A {@link FeeType} is a match when its {@code formatString} contains the description, case
* insensitively.
*/
public ImmutableList