/* * Copyright 2010-2023 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 com.amazonaws.services.sns.model; import java.io.Serializable; /** *

* A list of phone numbers and their metadata. *

*/ public class PhoneNumberInformation implements Serializable { /** *

* The date and time when the phone number was created. *

*/ private java.util.Date createdAt; /** *

* The phone number. *

*/ private String phoneNumber; /** *

* The status of the phone number. *

*/ private String status; /** *

* The two-character code for the country or region, in ISO 3166-1 alpha-2 * format. *

*

* Constraints:
* Length: - 2
* Pattern: ^[A-Za-z]{2}$
*/ private String iso2CountryCode; /** *

* The list of supported routes. *

*

* Constraints:
* Allowed Values: Transactional, Promotional, Premium */ private String routeType; /** *

* The capabilities of each phone number. *

*/ private java.util.List numberCapabilities = new java.util.ArrayList(); /** *

* The date and time when the phone number was created. *

* * @return

* The date and time when the phone number was created. *

*/ public java.util.Date getCreatedAt() { return createdAt; } /** *

* The date and time when the phone number was created. *

* * @param createdAt

* The date and time when the phone number was created. *

*/ public void setCreatedAt(java.util.Date createdAt) { this.createdAt = createdAt; } /** *

* The date and time when the phone number was created. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param createdAt

* The date and time when the phone number was created. *

* @return A reference to this updated object so that method calls can be * chained together. */ public PhoneNumberInformation withCreatedAt(java.util.Date createdAt) { this.createdAt = createdAt; return this; } /** *

* The phone number. *

* * @return

* The phone number. *

*/ public String getPhoneNumber() { return phoneNumber; } /** *

* The phone number. *

* * @param phoneNumber

* The phone number. *

*/ public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } /** *

* The phone number. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param phoneNumber

* The phone number. *

* @return A reference to this updated object so that method calls can be * chained together. */ public PhoneNumberInformation withPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; return this; } /** *

* The status of the phone number. *

* * @return

* The status of the phone number. *

*/ public String getStatus() { return status; } /** *

* The status of the phone number. *

* * @param status

* The status of the phone number. *

*/ public void setStatus(String status) { this.status = status; } /** *

* The status of the phone number. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param status

* The status of the phone number. *

* @return A reference to this updated object so that method calls can be * chained together. */ public PhoneNumberInformation withStatus(String status) { this.status = status; return this; } /** *

* The two-character code for the country or region, in ISO 3166-1 alpha-2 * format. *

*

* Constraints:
* Length: - 2
* Pattern: ^[A-Za-z]{2}$
* * @return

* The two-character code for the country or region, in ISO 3166-1 * alpha-2 format. *

*/ public String getIso2CountryCode() { return iso2CountryCode; } /** *

* The two-character code for the country or region, in ISO 3166-1 alpha-2 * format. *

*

* Constraints:
* Length: - 2
* Pattern: ^[A-Za-z]{2}$
* * @param iso2CountryCode

* The two-character code for the country or region, in ISO * 3166-1 alpha-2 format. *

*/ public void setIso2CountryCode(String iso2CountryCode) { this.iso2CountryCode = iso2CountryCode; } /** *

* The two-character code for the country or region, in ISO 3166-1 alpha-2 * format. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: - 2
* Pattern: ^[A-Za-z]{2}$
* * @param iso2CountryCode

* The two-character code for the country or region, in ISO * 3166-1 alpha-2 format. *

* @return A reference to this updated object so that method calls can be * chained together. */ public PhoneNumberInformation withIso2CountryCode(String iso2CountryCode) { this.iso2CountryCode = iso2CountryCode; return this; } /** *

* The list of supported routes. *

*

* Constraints:
* Allowed Values: Transactional, Promotional, Premium * * @return

* The list of supported routes. *

* @see RouteType */ public String getRouteType() { return routeType; } /** *

* The list of supported routes. *

*

* Constraints:
* Allowed Values: Transactional, Promotional, Premium * * @param routeType

* The list of supported routes. *

* @see RouteType */ public void setRouteType(String routeType) { this.routeType = routeType; } /** *

* The list of supported routes. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: Transactional, Promotional, Premium * * @param routeType

* The list of supported routes. *

* @return A reference to this updated object so that method calls can be * chained together. * @see RouteType */ public PhoneNumberInformation withRouteType(String routeType) { this.routeType = routeType; return this; } /** *

* The list of supported routes. *

*

* Constraints:
* Allowed Values: Transactional, Promotional, Premium * * @param routeType

* The list of supported routes. *

* @see RouteType */ public void setRouteType(RouteType routeType) { this.routeType = routeType.toString(); } /** *

* The list of supported routes. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: Transactional, Promotional, Premium * * @param routeType

* The list of supported routes. *

* @return A reference to this updated object so that method calls can be * chained together. * @see RouteType */ public PhoneNumberInformation withRouteType(RouteType routeType) { this.routeType = routeType.toString(); return this; } /** *

* The capabilities of each phone number. *

* * @return

* The capabilities of each phone number. *

*/ public java.util.List getNumberCapabilities() { return numberCapabilities; } /** *

* The capabilities of each phone number. *

* * @param numberCapabilities

* The capabilities of each phone number. *

*/ public void setNumberCapabilities(java.util.Collection numberCapabilities) { if (numberCapabilities == null) { this.numberCapabilities = null; return; } this.numberCapabilities = new java.util.ArrayList(numberCapabilities); } /** *

* The capabilities of each phone number. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param numberCapabilities

* The capabilities of each phone number. *

* @return A reference to this updated object so that method calls can be * chained together. */ public PhoneNumberInformation withNumberCapabilities(String... numberCapabilities) { if (getNumberCapabilities() == null) { this.numberCapabilities = new java.util.ArrayList(numberCapabilities.length); } for (String value : numberCapabilities) { this.numberCapabilities.add(value); } return this; } /** *

* The capabilities of each phone number. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param numberCapabilities

* The capabilities of each phone number. *

* @return A reference to this updated object so that method calls can be * chained together. */ public PhoneNumberInformation withNumberCapabilities( java.util.Collection numberCapabilities) { setNumberCapabilities(numberCapabilities); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getCreatedAt() != null) sb.append("CreatedAt: " + getCreatedAt() + ","); if (getPhoneNumber() != null) sb.append("PhoneNumber: " + getPhoneNumber() + ","); if (getStatus() != null) sb.append("Status: " + getStatus() + ","); if (getIso2CountryCode() != null) sb.append("Iso2CountryCode: " + getIso2CountryCode() + ","); if (getRouteType() != null) sb.append("RouteType: " + getRouteType() + ","); if (getNumberCapabilities() != null) sb.append("NumberCapabilities: " + getNumberCapabilities()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode()); hashCode = prime * hashCode + ((getPhoneNumber() == null) ? 0 : getPhoneNumber().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getIso2CountryCode() == null) ? 0 : getIso2CountryCode().hashCode()); hashCode = prime * hashCode + ((getRouteType() == null) ? 0 : getRouteType().hashCode()); hashCode = prime * hashCode + ((getNumberCapabilities() == null) ? 0 : getNumberCapabilities().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof PhoneNumberInformation == false) return false; PhoneNumberInformation other = (PhoneNumberInformation) obj; if (other.getCreatedAt() == null ^ this.getCreatedAt() == null) return false; if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == false) return false; if (other.getPhoneNumber() == null ^ this.getPhoneNumber() == null) return false; if (other.getPhoneNumber() != null && other.getPhoneNumber().equals(this.getPhoneNumber()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getIso2CountryCode() == null ^ this.getIso2CountryCode() == null) return false; if (other.getIso2CountryCode() != null && other.getIso2CountryCode().equals(this.getIso2CountryCode()) == false) return false; if (other.getRouteType() == null ^ this.getRouteType() == null) return false; if (other.getRouteType() != null && other.getRouteType().equals(this.getRouteType()) == false) return false; if (other.getNumberCapabilities() == null ^ this.getNumberCapabilities() == null) return false; if (other.getNumberCapabilities() != null && other.getNumberCapabilities().equals(this.getNumberCapabilities()) == false) return false; return true; } }