com.amazonaws.services.xray.model.TraceUser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-java-sdk-xray Show documentation
Show all versions of aws-java-sdk-xray Show documentation
The AWS Java SDK for AWS X-Ray module holds the client classes that are used for communicating with AWS X-Ray Service
/*
* Copyright 2012-2017 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.xray.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Information about a user recorded in segment documents.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class TraceUser implements Serializable, Cloneable {
/**
*
* The user's name.
*
*/
private String userName;
/**
*
* Services that the user's request hit.
*
*/
private java.util.List serviceIds;
/**
*
* The user's name.
*
*
* @param userName
* The user's name.
*/
public void setUserName(String userName) {
this.userName = userName;
}
/**
*
* The user's name.
*
*
* @return The user's name.
*/
public String getUserName() {
return this.userName;
}
/**
*
* The user's name.
*
*
* @param userName
* The user's name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TraceUser withUserName(String userName) {
setUserName(userName);
return this;
}
/**
*
* Services that the user's request hit.
*
*
* @return Services that the user's request hit.
*/
public java.util.List getServiceIds() {
return serviceIds;
}
/**
*
* Services that the user's request hit.
*
*
* @param serviceIds
* Services that the user's request hit.
*/
public void setServiceIds(java.util.Collection serviceIds) {
if (serviceIds == null) {
this.serviceIds = null;
return;
}
this.serviceIds = new java.util.ArrayList(serviceIds);
}
/**
*
* Services that the user's request hit.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setServiceIds(java.util.Collection)} or {@link #withServiceIds(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param serviceIds
* Services that the user's request hit.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TraceUser withServiceIds(ServiceId... serviceIds) {
if (this.serviceIds == null) {
setServiceIds(new java.util.ArrayList(serviceIds.length));
}
for (ServiceId ele : serviceIds) {
this.serviceIds.add(ele);
}
return this;
}
/**
*
* Services that the user's request hit.
*
*
* @param serviceIds
* Services that the user's request hit.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TraceUser withServiceIds(java.util.Collection serviceIds) {
setServiceIds(serviceIds);
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 (getUserName() != null)
sb.append("UserName: ").append(getUserName()).append(",");
if (getServiceIds() != null)
sb.append("ServiceIds: ").append(getServiceIds());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof TraceUser == false)
return false;
TraceUser other = (TraceUser) obj;
if (other.getUserName() == null ^ this.getUserName() == null)
return false;
if (other.getUserName() != null && other.getUserName().equals(this.getUserName()) == false)
return false;
if (other.getServiceIds() == null ^ this.getServiceIds() == null)
return false;
if (other.getServiceIds() != null && other.getServiceIds().equals(this.getServiceIds()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getUserName() == null) ? 0 : getUserName().hashCode());
hashCode = prime * hashCode + ((getServiceIds() == null) ? 0 : getServiceIds().hashCode());
return hashCode;
}
@Override
public TraceUser clone() {
try {
return (TraceUser) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy