/* * Copyright 2010-2020 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.kinesisvideosignaling.model; import java.io.Serializable; /** *

* A structure for the ICE server connection data. *

*/ public class IceServer implements Serializable { /** *

* An array of URIs, in the form specified in the I-D.petithuguenin-behave-turn-uris spec. These URIs provide the * different addresses and/or protocols that can be used to reach the TURN * server. *

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

* A username to login to the ICE server. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
*/ private String username; /** *

* A password to login to the ICE server. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
*/ private String password; /** *

* The period of time, in seconds, during which the username and password * are valid. *

*

* Constraints:
* Range: 30 - 86400
*/ private Integer ttl; /** *

* An array of URIs, in the form specified in the I-D.petithuguenin-behave-turn-uris spec. These URIs provide the * different addresses and/or protocols that can be used to reach the TURN * server. *

* * @return

* An array of URIs, in the form specified in the I-D.petithuguenin-behave-turn-uris spec. These URIs provide * the different addresses and/or protocols that can be used to * reach the TURN server. *

*/ public java.util.List getUris() { return uris; } /** *

* An array of URIs, in the form specified in the I-D.petithuguenin-behave-turn-uris spec. These URIs provide the * different addresses and/or protocols that can be used to reach the TURN * server. *

* * @param uris

* An array of URIs, in the form specified in the I-D.petithuguenin-behave-turn-uris spec. These URIs * provide the different addresses and/or protocols that can be * used to reach the TURN server. *

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

* An array of URIs, in the form specified in the I-D.petithuguenin-behave-turn-uris spec. These URIs provide the * different addresses and/or protocols that can be used to reach the TURN * server. *

*

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

* An array of URIs, in the form specified in the I-D.petithuguenin-behave-turn-uris spec. These URIs * provide the different addresses and/or protocols that can be * used to reach the TURN server. *

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

* An array of URIs, in the form specified in the I-D.petithuguenin-behave-turn-uris spec. These URIs provide the * different addresses and/or protocols that can be used to reach the TURN * server. *

*

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

* An array of URIs, in the form specified in the I-D.petithuguenin-behave-turn-uris spec. These URIs * provide the different addresses and/or protocols that can be * used to reach the TURN server. *

* @return A reference to this updated object so that method calls can be * chained together. */ public IceServer withUris(java.util.Collection uris) { setUris(uris); return this; } /** *

* A username to login to the ICE server. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
* * @return

* A username to login to the ICE server. *

*/ public String getUsername() { return username; } /** *

* A username to login to the ICE server. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
* * @param username

* A username to login to the ICE server. *

*/ public void setUsername(String username) { this.username = username; } /** *

* A username to login to the ICE server. *

*

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

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
* * @param username

* A username to login to the ICE server. *

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

* A password to login to the ICE server. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
* * @return

* A password to login to the ICE server. *

*/ public String getPassword() { return password; } /** *

* A password to login to the ICE server. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
* * @param password

* A password to login to the ICE server. *

*/ public void setPassword(String password) { this.password = password; } /** *

* A password to login to the ICE server. *

*

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

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
* * @param password

* A password to login to the ICE server. *

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

* The period of time, in seconds, during which the username and password * are valid. *

*

* Constraints:
* Range: 30 - 86400
* * @return

* The period of time, in seconds, during which the username and * password are valid. *

*/ public Integer getTtl() { return ttl; } /** *

* The period of time, in seconds, during which the username and password * are valid. *

*

* Constraints:
* Range: 30 - 86400
* * @param ttl

* The period of time, in seconds, during which the username and * password are valid. *

*/ public void setTtl(Integer ttl) { this.ttl = ttl; } /** *

* The period of time, in seconds, during which the username and password * are valid. *

*

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

* Constraints:
* Range: 30 - 86400
* * @param ttl

* The period of time, in seconds, during which the username and * password are valid. *

* @return A reference to this updated object so that method calls can be * chained together. */ public IceServer withTtl(Integer ttl) { this.ttl = ttl; 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 (getUris() != null) sb.append("Uris: " + getUris() + ","); if (getUsername() != null) sb.append("Username: " + getUsername() + ","); if (getPassword() != null) sb.append("Password: " + getPassword() + ","); if (getTtl() != null) sb.append("Ttl: " + getTtl()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getUris() == null) ? 0 : getUris().hashCode()); hashCode = prime * hashCode + ((getUsername() == null) ? 0 : getUsername().hashCode()); hashCode = prime * hashCode + ((getPassword() == null) ? 0 : getPassword().hashCode()); hashCode = prime * hashCode + ((getTtl() == null) ? 0 : getTtl().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof IceServer == false) return false; IceServer other = (IceServer) obj; if (other.getUris() == null ^ this.getUris() == null) return false; if (other.getUris() != null && other.getUris().equals(this.getUris()) == false) return false; if (other.getUsername() == null ^ this.getUsername() == null) return false; if (other.getUsername() != null && other.getUsername().equals(this.getUsername()) == false) return false; if (other.getPassword() == null ^ this.getPassword() == null) return false; if (other.getPassword() != null && other.getPassword().equals(this.getPassword()) == false) return false; if (other.getTtl() == null ^ this.getTtl() == null) return false; if (other.getTtl() != null && other.getTtl().equals(this.getTtl()) == false) return false; return true; } }