software.amazon.awssdk.services.route53domains.model.DomainPrice Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of route53domains Show documentation
Show all versions of route53domains Show documentation
The AWS Java SDK for Amazon Route53 module holds the client classes that are used for communicating
with Amazon Route53 Domain Service
/*
* Copyright Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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 software.amazon.awssdk.services.route53domains.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Information about the domain price associated with a TLD.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class DomainPrice implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
.getter(getter(DomainPrice::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();
private static final SdkField REGISTRATION_PRICE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("RegistrationPrice")
.getter(getter(DomainPrice::registrationPrice)).setter(setter(Builder::registrationPrice))
.constructor(PriceWithCurrency::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RegistrationPrice").build()).build();
private static final SdkField TRANSFER_PRICE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("TransferPrice")
.getter(getter(DomainPrice::transferPrice)).setter(setter(Builder::transferPrice))
.constructor(PriceWithCurrency::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TransferPrice").build()).build();
private static final SdkField RENEWAL_PRICE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("RenewalPrice")
.getter(getter(DomainPrice::renewalPrice)).setter(setter(Builder::renewalPrice))
.constructor(PriceWithCurrency::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RenewalPrice").build()).build();
private static final SdkField CHANGE_OWNERSHIP_PRICE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ChangeOwnershipPrice")
.getter(getter(DomainPrice::changeOwnershipPrice)).setter(setter(Builder::changeOwnershipPrice))
.constructor(PriceWithCurrency::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ChangeOwnershipPrice").build())
.build();
private static final SdkField RESTORATION_PRICE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("RestorationPrice")
.getter(getter(DomainPrice::restorationPrice)).setter(setter(Builder::restorationPrice))
.constructor(PriceWithCurrency::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RestorationPrice").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD,
REGISTRATION_PRICE_FIELD, TRANSFER_PRICE_FIELD, RENEWAL_PRICE_FIELD, CHANGE_OWNERSHIP_PRICE_FIELD,
RESTORATION_PRICE_FIELD));
private static final long serialVersionUID = 1L;
private final String name;
private final PriceWithCurrency registrationPrice;
private final PriceWithCurrency transferPrice;
private final PriceWithCurrency renewalPrice;
private final PriceWithCurrency changeOwnershipPrice;
private final PriceWithCurrency restorationPrice;
private DomainPrice(BuilderImpl builder) {
this.name = builder.name;
this.registrationPrice = builder.registrationPrice;
this.transferPrice = builder.transferPrice;
this.renewalPrice = builder.renewalPrice;
this.changeOwnershipPrice = builder.changeOwnershipPrice;
this.restorationPrice = builder.restorationPrice;
}
/**
*
* The name of the TLD for which the prices apply.
*
*
* @return The name of the TLD for which the prices apply.
*/
public final String name() {
return name;
}
/**
*
* The price for domain registration with Route 53.
*
*
* @return The price for domain registration with Route 53.
*/
public final PriceWithCurrency registrationPrice() {
return registrationPrice;
}
/**
*
* The price for transferring the domain registration to Route 53.
*
*
* @return The price for transferring the domain registration to Route 53.
*/
public final PriceWithCurrency transferPrice() {
return transferPrice;
}
/**
*
* The price for renewing domain registration with Route 53.
*
*
* @return The price for renewing domain registration with Route 53.
*/
public final PriceWithCurrency renewalPrice() {
return renewalPrice;
}
/**
*
* The price for changing domain ownership.
*
*
* @return The price for changing domain ownership.
*/
public final PriceWithCurrency changeOwnershipPrice() {
return changeOwnershipPrice;
}
/**
*
* The price for restoring the domain with Route 53.
*
*
* @return The price for restoring the domain with Route 53.
*/
public final PriceWithCurrency restorationPrice() {
return restorationPrice;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(registrationPrice());
hashCode = 31 * hashCode + Objects.hashCode(transferPrice());
hashCode = 31 * hashCode + Objects.hashCode(renewalPrice());
hashCode = 31 * hashCode + Objects.hashCode(changeOwnershipPrice());
hashCode = 31 * hashCode + Objects.hashCode(restorationPrice());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DomainPrice)) {
return false;
}
DomainPrice other = (DomainPrice) obj;
return Objects.equals(name(), other.name()) && Objects.equals(registrationPrice(), other.registrationPrice())
&& Objects.equals(transferPrice(), other.transferPrice()) && Objects.equals(renewalPrice(), other.renewalPrice())
&& Objects.equals(changeOwnershipPrice(), other.changeOwnershipPrice())
&& Objects.equals(restorationPrice(), other.restorationPrice());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("DomainPrice").add("Name", name()).add("RegistrationPrice", registrationPrice())
.add("TransferPrice", transferPrice()).add("RenewalPrice", renewalPrice())
.add("ChangeOwnershipPrice", changeOwnershipPrice()).add("RestorationPrice", restorationPrice()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "RegistrationPrice":
return Optional.ofNullable(clazz.cast(registrationPrice()));
case "TransferPrice":
return Optional.ofNullable(clazz.cast(transferPrice()));
case "RenewalPrice":
return Optional.ofNullable(clazz.cast(renewalPrice()));
case "ChangeOwnershipPrice":
return Optional.ofNullable(clazz.cast(changeOwnershipPrice()));
case "RestorationPrice":
return Optional.ofNullable(clazz.cast(restorationPrice()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function