PageRenderTime 38ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/Ipv6Range.java

https://github.com/aws/aws-sdk-java
Java | 214 lines | 74 code | 22 blank | 118 comment | 26 complexity | ec74cd298e382ac32c517bdafac6e5e0 MD5 | raw file
  1. /*
  2. * Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
  5. * the License. A copy of the License is located at
  6. *
  7. * http://aws.amazon.com/apache2.0
  8. *
  9. * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
  10. * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
  11. * and limitations under the License.
  12. */
  13. package com.amazonaws.services.ec2.model;
  14. import java.io.Serializable;
  15. import javax.annotation.Generated;
  16. /**
  17. * <p>
  18. * [EC2-VPC only] Describes an IPv6 range.
  19. * </p>
  20. *
  21. * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Ipv6Range" target="_top">AWS API
  22. * Documentation</a>
  23. */
  24. @Generated("com.amazonaws:aws-java-sdk-code-generator")
  25. public class Ipv6Range implements Serializable, Cloneable {
  26. /**
  27. * <p>
  28. * The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a
  29. * single IPv6 address, use the /128 prefix length.
  30. * </p>
  31. */
  32. private String cidrIpv6;
  33. /**
  34. * <p>
  35. * A description for the security group rule that references this IPv6 address range.
  36. * </p>
  37. * <p>
  38. * Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and
  39. * ._-:/()#,@[]+=&amp;;{}!$*
  40. * </p>
  41. */
  42. private String description;
  43. /**
  44. * <p>
  45. * The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a
  46. * single IPv6 address, use the /128 prefix length.
  47. * </p>
  48. *
  49. * @param cidrIpv6
  50. * The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify
  51. * a single IPv6 address, use the /128 prefix length.
  52. */
  53. public void setCidrIpv6(String cidrIpv6) {
  54. this.cidrIpv6 = cidrIpv6;
  55. }
  56. /**
  57. * <p>
  58. * The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a
  59. * single IPv6 address, use the /128 prefix length.
  60. * </p>
  61. *
  62. * @return The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify
  63. * a single IPv6 address, use the /128 prefix length.
  64. */
  65. public String getCidrIpv6() {
  66. return this.cidrIpv6;
  67. }
  68. /**
  69. * <p>
  70. * The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a
  71. * single IPv6 address, use the /128 prefix length.
  72. * </p>
  73. *
  74. * @param cidrIpv6
  75. * The IPv6 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify
  76. * a single IPv6 address, use the /128 prefix length.
  77. * @return Returns a reference to this object so that method calls can be chained together.
  78. */
  79. public Ipv6Range withCidrIpv6(String cidrIpv6) {
  80. setCidrIpv6(cidrIpv6);
  81. return this;
  82. }
  83. /**
  84. * <p>
  85. * A description for the security group rule that references this IPv6 address range.
  86. * </p>
  87. * <p>
  88. * Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and
  89. * ._-:/()#,@[]+=&amp;;{}!$*
  90. * </p>
  91. *
  92. * @param description
  93. * A description for the security group rule that references this IPv6 address range.</p>
  94. * <p>
  95. * Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and
  96. * ._-:/()#,@[]+=&amp;;{}!$
  97. **/
  98. public void setDescription(String description) {
  99. this.description = description;
  100. }
  101. /**
  102. * <p>
  103. * A description for the security group rule that references this IPv6 address range.
  104. * </p>
  105. * <p>
  106. * Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and
  107. * ._-:/()#,@[]+=&amp;;{}!$*
  108. * </p>
  109. *
  110. * @return A description for the security group rule that references this IPv6 address range.</p>
  111. * <p>
  112. * Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and
  113. * ._-:/()#,@[]+=&amp;;{}!$
  114. **/
  115. public String getDescription() {
  116. return this.description;
  117. }
  118. /**
  119. * <p>
  120. * A description for the security group rule that references this IPv6 address range.
  121. * </p>
  122. * <p>
  123. * Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and
  124. * ._-:/()#,@[]+=&amp;;{}!$*
  125. * </p>
  126. *
  127. * @param description
  128. * A description for the security group rule that references this IPv6 address range.</p>
  129. * <p>
  130. * Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and
  131. * ._-:/()#,@[]+=&amp;;{}!$*
  132. * @return Returns a reference to this object so that method calls can be chained together.
  133. */
  134. public Ipv6Range withDescription(String description) {
  135. setDescription(description);
  136. return this;
  137. }
  138. /**
  139. * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
  140. * redacted from this string using a placeholder value.
  141. *
  142. * @return A string representation of this object.
  143. *
  144. * @see java.lang.Object#toString()
  145. */
  146. @Override
  147. public String toString() {
  148. StringBuilder sb = new StringBuilder();
  149. sb.append("{");
  150. if (getCidrIpv6() != null)
  151. sb.append("CidrIpv6: ").append(getCidrIpv6()).append(",");
  152. if (getDescription() != null)
  153. sb.append("Description: ").append(getDescription());
  154. sb.append("}");
  155. return sb.toString();
  156. }
  157. @Override
  158. public boolean equals(Object obj) {
  159. if (this == obj)
  160. return true;
  161. if (obj == null)
  162. return false;
  163. if (obj instanceof Ipv6Range == false)
  164. return false;
  165. Ipv6Range other = (Ipv6Range) obj;
  166. if (other.getCidrIpv6() == null ^ this.getCidrIpv6() == null)
  167. return false;
  168. if (other.getCidrIpv6() != null && other.getCidrIpv6().equals(this.getCidrIpv6()) == false)
  169. return false;
  170. if (other.getDescription() == null ^ this.getDescription() == null)
  171. return false;
  172. if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
  173. return false;
  174. return true;
  175. }
  176. @Override
  177. public int hashCode() {
  178. final int prime = 31;
  179. int hashCode = 1;
  180. hashCode = prime * hashCode + ((getCidrIpv6() == null) ? 0 : getCidrIpv6().hashCode());
  181. hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
  182. return hashCode;
  183. }
  184. @Override
  185. public Ipv6Range clone() {
  186. try {
  187. return (Ipv6Range) super.clone();
  188. } catch (CloneNotSupportedException e) {
  189. throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
  190. }
  191. }
  192. }