com.amazonaws.services.ivsrealtime.model.Participant Maven / Gradle / Ivy
/*
* Copyright 2019-2024 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.ivsrealtime.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Object describing a participant that has joined a stage.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Participant implements Serializable, Cloneable, StructuredPojo {
/**
*
* Application-provided attributes to encode into the token and attach to a stage. Map keys and values can contain
* UTF-8 encoded text. The maximum length of this field is 1 KB total. This field is exposed to all stage
* participants and should not be used for personally identifying, confidential, or sensitive information.
*
*/
private java.util.Map attributes;
/**
*
* The participant’s browser.
*
*/
private String browserName;
/**
*
* The participant’s browser version.
*
*/
private String browserVersion;
/**
*
* ISO 8601 timestamp (returned as a string) when the participant first joined the stage session.
*
*/
private java.util.Date firstJoinTime;
/**
*
* The participant’s Internet Service Provider.
*
*/
private String ispName;
/**
*
* The participant’s operating system.
*
*/
private String osName;
/**
*
* The participant’s operating system version.
*
*/
private String osVersion;
/**
*
* Unique identifier for this participant, assigned by IVS.
*
*/
private String participantId;
/**
*
* Whether the participant ever published to the stage session.
*
*/
private Boolean published;
/**
*
* The participant’s SDK version.
*
*/
private String sdkVersion;
/**
*
* Whether the participant is connected to or disconnected from the stage.
*
*/
private String state;
/**
*
* Customer-assigned name to help identify the token; this can be used to link a participant to a user in the
* customer’s own systems. This can be any UTF-8 encoded text. This field is exposed to all stage participants
* and should not be used for personally identifying, confidential, or sensitive information.
*
*/
private String userId;
/**
*
* Application-provided attributes to encode into the token and attach to a stage. Map keys and values can contain
* UTF-8 encoded text. The maximum length of this field is 1 KB total. This field is exposed to all stage
* participants and should not be used for personally identifying, confidential, or sensitive information.
*
*
* @return Application-provided attributes to encode into the token and attach to a stage. Map keys and values can
* contain UTF-8 encoded text. The maximum length of this field is 1 KB total. This field is exposed to
* all stage participants and should not be used for personally identifying, confidential, or sensitive
* information.
*/
public java.util.Map getAttributes() {
return attributes;
}
/**
*
* Application-provided attributes to encode into the token and attach to a stage. Map keys and values can contain
* UTF-8 encoded text. The maximum length of this field is 1 KB total. This field is exposed to all stage
* participants and should not be used for personally identifying, confidential, or sensitive information.
*
*
* @param attributes
* Application-provided attributes to encode into the token and attach to a stage. Map keys and values can
* contain UTF-8 encoded text. The maximum length of this field is 1 KB total. This field is exposed to
* all stage participants and should not be used for personally identifying, confidential, or sensitive
* information.
*/
public void setAttributes(java.util.Map attributes) {
this.attributes = attributes;
}
/**
*
* Application-provided attributes to encode into the token and attach to a stage. Map keys and values can contain
* UTF-8 encoded text. The maximum length of this field is 1 KB total. This field is exposed to all stage
* participants and should not be used for personally identifying, confidential, or sensitive information.
*
*
* @param attributes
* Application-provided attributes to encode into the token and attach to a stage. Map keys and values can
* contain UTF-8 encoded text. The maximum length of this field is 1 KB total. This field is exposed to
* all stage participants and should not be used for personally identifying, confidential, or sensitive
* information.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Participant withAttributes(java.util.Map attributes) {
setAttributes(attributes);
return this;
}
/**
* Add a single Attributes entry
*
* @see Participant#withAttributes
* @returns a reference to this object so that method calls can be chained together.
*/
public Participant addAttributesEntry(String key, String value) {
if (null == this.attributes) {
this.attributes = new java.util.HashMap();
}
if (this.attributes.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.attributes.put(key, value);
return this;
}
/**
* Removes all the entries added into Attributes.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Participant clearAttributesEntries() {
this.attributes = null;
return this;
}
/**
*
* The participant’s browser.
*
*
* @param browserName
* The participant’s browser.
*/
public void setBrowserName(String browserName) {
this.browserName = browserName;
}
/**
*
* The participant’s browser.
*
*
* @return The participant’s browser.
*/
public String getBrowserName() {
return this.browserName;
}
/**
*
* The participant’s browser.
*
*
* @param browserName
* The participant’s browser.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Participant withBrowserName(String browserName) {
setBrowserName(browserName);
return this;
}
/**
*
* The participant’s browser version.
*
*
* @param browserVersion
* The participant’s browser version.
*/
public void setBrowserVersion(String browserVersion) {
this.browserVersion = browserVersion;
}
/**
*
* The participant’s browser version.
*
*
* @return The participant’s browser version.
*/
public String getBrowserVersion() {
return this.browserVersion;
}
/**
*
* The participant’s browser version.
*
*
* @param browserVersion
* The participant’s browser version.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Participant withBrowserVersion(String browserVersion) {
setBrowserVersion(browserVersion);
return this;
}
/**
*
* ISO 8601 timestamp (returned as a string) when the participant first joined the stage session.
*
*
* @param firstJoinTime
* ISO 8601 timestamp (returned as a string) when the participant first joined the stage session.
*/
public void setFirstJoinTime(java.util.Date firstJoinTime) {
this.firstJoinTime = firstJoinTime;
}
/**
*
* ISO 8601 timestamp (returned as a string) when the participant first joined the stage session.
*
*
* @return ISO 8601 timestamp (returned as a string) when the participant first joined the stage session.
*/
public java.util.Date getFirstJoinTime() {
return this.firstJoinTime;
}
/**
*
* ISO 8601 timestamp (returned as a string) when the participant first joined the stage session.
*
*
* @param firstJoinTime
* ISO 8601 timestamp (returned as a string) when the participant first joined the stage session.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Participant withFirstJoinTime(java.util.Date firstJoinTime) {
setFirstJoinTime(firstJoinTime);
return this;
}
/**
*
* The participant’s Internet Service Provider.
*
*
* @param ispName
* The participant’s Internet Service Provider.
*/
public void setIspName(String ispName) {
this.ispName = ispName;
}
/**
*
* The participant’s Internet Service Provider.
*
*
* @return The participant’s Internet Service Provider.
*/
public String getIspName() {
return this.ispName;
}
/**
*
* The participant’s Internet Service Provider.
*
*
* @param ispName
* The participant’s Internet Service Provider.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Participant withIspName(String ispName) {
setIspName(ispName);
return this;
}
/**
*
* The participant’s operating system.
*
*
* @param osName
* The participant’s operating system.
*/
public void setOsName(String osName) {
this.osName = osName;
}
/**
*
* The participant’s operating system.
*
*
* @return The participant’s operating system.
*/
public String getOsName() {
return this.osName;
}
/**
*
* The participant’s operating system.
*
*
* @param osName
* The participant’s operating system.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Participant withOsName(String osName) {
setOsName(osName);
return this;
}
/**
*
* The participant’s operating system version.
*
*
* @param osVersion
* The participant’s operating system version.
*/
public void setOsVersion(String osVersion) {
this.osVersion = osVersion;
}
/**
*
* The participant’s operating system version.
*
*
* @return The participant’s operating system version.
*/
public String getOsVersion() {
return this.osVersion;
}
/**
*
* The participant’s operating system version.
*
*
* @param osVersion
* The participant’s operating system version.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Participant withOsVersion(String osVersion) {
setOsVersion(osVersion);
return this;
}
/**
*
* Unique identifier for this participant, assigned by IVS.
*
*
* @param participantId
* Unique identifier for this participant, assigned by IVS.
*/
public void setParticipantId(String participantId) {
this.participantId = participantId;
}
/**
*
* Unique identifier for this participant, assigned by IVS.
*
*
* @return Unique identifier for this participant, assigned by IVS.
*/
public String getParticipantId() {
return this.participantId;
}
/**
*
* Unique identifier for this participant, assigned by IVS.
*
*
* @param participantId
* Unique identifier for this participant, assigned by IVS.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Participant withParticipantId(String participantId) {
setParticipantId(participantId);
return this;
}
/**
*
* Whether the participant ever published to the stage session.
*
*
* @param published
* Whether the participant ever published to the stage session.
*/
public void setPublished(Boolean published) {
this.published = published;
}
/**
*
* Whether the participant ever published to the stage session.
*
*
* @return Whether the participant ever published to the stage session.
*/
public Boolean getPublished() {
return this.published;
}
/**
*
* Whether the participant ever published to the stage session.
*
*
* @param published
* Whether the participant ever published to the stage session.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Participant withPublished(Boolean published) {
setPublished(published);
return this;
}
/**
*
* Whether the participant ever published to the stage session.
*
*
* @return Whether the participant ever published to the stage session.
*/
public Boolean isPublished() {
return this.published;
}
/**
*
* The participant’s SDK version.
*
*
* @param sdkVersion
* The participant’s SDK version.
*/
public void setSdkVersion(String sdkVersion) {
this.sdkVersion = sdkVersion;
}
/**
*
* The participant’s SDK version.
*
*
* @return The participant’s SDK version.
*/
public String getSdkVersion() {
return this.sdkVersion;
}
/**
*
* The participant’s SDK version.
*
*
* @param sdkVersion
* The participant’s SDK version.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Participant withSdkVersion(String sdkVersion) {
setSdkVersion(sdkVersion);
return this;
}
/**
*
* Whether the participant is connected to or disconnected from the stage.
*
*
* @param state
* Whether the participant is connected to or disconnected from the stage.
* @see ParticipantState
*/
public void setState(String state) {
this.state = state;
}
/**
*
* Whether the participant is connected to or disconnected from the stage.
*
*
* @return Whether the participant is connected to or disconnected from the stage.
* @see ParticipantState
*/
public String getState() {
return this.state;
}
/**
*
* Whether the participant is connected to or disconnected from the stage.
*
*
* @param state
* Whether the participant is connected to or disconnected from the stage.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ParticipantState
*/
public Participant withState(String state) {
setState(state);
return this;
}
/**
*
* Whether the participant is connected to or disconnected from the stage.
*
*
* @param state
* Whether the participant is connected to or disconnected from the stage.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ParticipantState
*/
public Participant withState(ParticipantState state) {
this.state = state.toString();
return this;
}
/**
*
* Customer-assigned name to help identify the token; this can be used to link a participant to a user in the
* customer’s own systems. This can be any UTF-8 encoded text. This field is exposed to all stage participants
* and should not be used for personally identifying, confidential, or sensitive information.
*
*
* @param userId
* Customer-assigned name to help identify the token; this can be used to link a participant to a user in the
* customer’s own systems. This can be any UTF-8 encoded text. This field is exposed to all stage
* participants and should not be used for personally identifying, confidential, or sensitive
* information.
*/
public void setUserId(String userId) {
this.userId = userId;
}
/**
*
* Customer-assigned name to help identify the token; this can be used to link a participant to a user in the
* customer’s own systems. This can be any UTF-8 encoded text. This field is exposed to all stage participants
* and should not be used for personally identifying, confidential, or sensitive information.
*
*
* @return Customer-assigned name to help identify the token; this can be used to link a participant to a user in
* the customer’s own systems. This can be any UTF-8 encoded text. This field is exposed to all stage
* participants and should not be used for personally identifying, confidential, or sensitive
* information.
*/
public String getUserId() {
return this.userId;
}
/**
*
* Customer-assigned name to help identify the token; this can be used to link a participant to a user in the
* customer’s own systems. This can be any UTF-8 encoded text. This field is exposed to all stage participants
* and should not be used for personally identifying, confidential, or sensitive information.
*
*
* @param userId
* Customer-assigned name to help identify the token; this can be used to link a participant to a user in the
* customer’s own systems. This can be any UTF-8 encoded text. This field is exposed to all stage
* participants and should not be used for personally identifying, confidential, or sensitive
* information.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Participant withUserId(String userId) {
setUserId(userId);
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getAttributes() != null)
sb.append("Attributes: ").append(getAttributes()).append(",");
if (getBrowserName() != null)
sb.append("BrowserName: ").append(getBrowserName()).append(",");
if (getBrowserVersion() != null)
sb.append("BrowserVersion: ").append(getBrowserVersion()).append(",");
if (getFirstJoinTime() != null)
sb.append("FirstJoinTime: ").append(getFirstJoinTime()).append(",");
if (getIspName() != null)
sb.append("IspName: ").append(getIspName()).append(",");
if (getOsName() != null)
sb.append("OsName: ").append(getOsName()).append(",");
if (getOsVersion() != null)
sb.append("OsVersion: ").append(getOsVersion()).append(",");
if (getParticipantId() != null)
sb.append("ParticipantId: ").append(getParticipantId()).append(",");
if (getPublished() != null)
sb.append("Published: ").append(getPublished()).append(",");
if (getSdkVersion() != null)
sb.append("SdkVersion: ").append(getSdkVersion()).append(",");
if (getState() != null)
sb.append("State: ").append(getState()).append(",");
if (getUserId() != null)
sb.append("UserId: ").append(getUserId());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Participant == false)
return false;
Participant other = (Participant) obj;
if (other.getAttributes() == null ^ this.getAttributes() == null)
return false;
if (other.getAttributes() != null && other.getAttributes().equals(this.getAttributes()) == false)
return false;
if (other.getBrowserName() == null ^ this.getBrowserName() == null)
return false;
if (other.getBrowserName() != null && other.getBrowserName().equals(this.getBrowserName()) == false)
return false;
if (other.getBrowserVersion() == null ^ this.getBrowserVersion() == null)
return false;
if (other.getBrowserVersion() != null && other.getBrowserVersion().equals(this.getBrowserVersion()) == false)
return false;
if (other.getFirstJoinTime() == null ^ this.getFirstJoinTime() == null)
return false;
if (other.getFirstJoinTime() != null && other.getFirstJoinTime().equals(this.getFirstJoinTime()) == false)
return false;
if (other.getIspName() == null ^ this.getIspName() == null)
return false;
if (other.getIspName() != null && other.getIspName().equals(this.getIspName()) == false)
return false;
if (other.getOsName() == null ^ this.getOsName() == null)
return false;
if (other.getOsName() != null && other.getOsName().equals(this.getOsName()) == false)
return false;
if (other.getOsVersion() == null ^ this.getOsVersion() == null)
return false;
if (other.getOsVersion() != null && other.getOsVersion().equals(this.getOsVersion()) == false)
return false;
if (other.getParticipantId() == null ^ this.getParticipantId() == null)
return false;
if (other.getParticipantId() != null && other.getParticipantId().equals(this.getParticipantId()) == false)
return false;
if (other.getPublished() == null ^ this.getPublished() == null)
return false;
if (other.getPublished() != null && other.getPublished().equals(this.getPublished()) == false)
return false;
if (other.getSdkVersion() == null ^ this.getSdkVersion() == null)
return false;
if (other.getSdkVersion() != null && other.getSdkVersion().equals(this.getSdkVersion()) == false)
return false;
if (other.getState() == null ^ this.getState() == null)
return false;
if (other.getState() != null && other.getState().equals(this.getState()) == false)
return false;
if (other.getUserId() == null ^ this.getUserId() == null)
return false;
if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode());
hashCode = prime * hashCode + ((getBrowserName() == null) ? 0 : getBrowserName().hashCode());
hashCode = prime * hashCode + ((getBrowserVersion() == null) ? 0 : getBrowserVersion().hashCode());
hashCode = prime * hashCode + ((getFirstJoinTime() == null) ? 0 : getFirstJoinTime().hashCode());
hashCode = prime * hashCode + ((getIspName() == null) ? 0 : getIspName().hashCode());
hashCode = prime * hashCode + ((getOsName() == null) ? 0 : getOsName().hashCode());
hashCode = prime * hashCode + ((getOsVersion() == null) ? 0 : getOsVersion().hashCode());
hashCode = prime * hashCode + ((getParticipantId() == null) ? 0 : getParticipantId().hashCode());
hashCode = prime * hashCode + ((getPublished() == null) ? 0 : getPublished().hashCode());
hashCode = prime * hashCode + ((getSdkVersion() == null) ? 0 : getSdkVersion().hashCode());
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode());
return hashCode;
}
@Override
public Participant clone() {
try {
return (Participant) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.ivsrealtime.model.transform.ParticipantMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}