com.amazonaws.services.mediatailor.model.AudienceMedia Maven / Gradle / Ivy
Show all versions of aws-java-sdk-mediatailor Show documentation
/*
* 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.mediatailor.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* An AudienceMedia object contains an Audience and a list of AlternateMedia.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AudienceMedia implements Serializable, Cloneable, StructuredPojo {
/**
*
* The list of AlternateMedia defined in AudienceMedia.
*
*/
private java.util.List alternateMedia;
/**
*
* The Audience defined in AudienceMedia.
*
*/
private String audience;
/**
*
* The list of AlternateMedia defined in AudienceMedia.
*
*
* @return The list of AlternateMedia defined in AudienceMedia.
*/
public java.util.List getAlternateMedia() {
return alternateMedia;
}
/**
*
* The list of AlternateMedia defined in AudienceMedia.
*
*
* @param alternateMedia
* The list of AlternateMedia defined in AudienceMedia.
*/
public void setAlternateMedia(java.util.Collection alternateMedia) {
if (alternateMedia == null) {
this.alternateMedia = null;
return;
}
this.alternateMedia = new java.util.ArrayList(alternateMedia);
}
/**
*
* The list of AlternateMedia defined in AudienceMedia.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAlternateMedia(java.util.Collection)} or {@link #withAlternateMedia(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param alternateMedia
* The list of AlternateMedia defined in AudienceMedia.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AudienceMedia withAlternateMedia(AlternateMedia... alternateMedia) {
if (this.alternateMedia == null) {
setAlternateMedia(new java.util.ArrayList(alternateMedia.length));
}
for (AlternateMedia ele : alternateMedia) {
this.alternateMedia.add(ele);
}
return this;
}
/**
*
* The list of AlternateMedia defined in AudienceMedia.
*
*
* @param alternateMedia
* The list of AlternateMedia defined in AudienceMedia.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AudienceMedia withAlternateMedia(java.util.Collection alternateMedia) {
setAlternateMedia(alternateMedia);
return this;
}
/**
*
* The Audience defined in AudienceMedia.
*
*
* @param audience
* The Audience defined in AudienceMedia.
*/
public void setAudience(String audience) {
this.audience = audience;
}
/**
*
* The Audience defined in AudienceMedia.
*
*
* @return The Audience defined in AudienceMedia.
*/
public String getAudience() {
return this.audience;
}
/**
*
* The Audience defined in AudienceMedia.
*
*
* @param audience
* The Audience defined in AudienceMedia.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AudienceMedia withAudience(String audience) {
setAudience(audience);
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 (getAlternateMedia() != null)
sb.append("AlternateMedia: ").append(getAlternateMedia()).append(",");
if (getAudience() != null)
sb.append("Audience: ").append(getAudience());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AudienceMedia == false)
return false;
AudienceMedia other = (AudienceMedia) obj;
if (other.getAlternateMedia() == null ^ this.getAlternateMedia() == null)
return false;
if (other.getAlternateMedia() != null && other.getAlternateMedia().equals(this.getAlternateMedia()) == false)
return false;
if (other.getAudience() == null ^ this.getAudience() == null)
return false;
if (other.getAudience() != null && other.getAudience().equals(this.getAudience()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAlternateMedia() == null) ? 0 : getAlternateMedia().hashCode());
hashCode = prime * hashCode + ((getAudience() == null) ? 0 : getAudience().hashCode());
return hashCode;
}
@Override
public AudienceMedia clone() {
try {
return (AudienceMedia) 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.mediatailor.model.transform.AudienceMediaMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}