com.amazonaws.services.xray.model.Edge Maven / Gradle / Ivy
Show all versions of aws-java-sdk-xray Show documentation
/*
* 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 connection between two services.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Edge implements Serializable, Cloneable {
/**
*
* Identifier of the edge. Unique within a service map.
*
*/
private Integer referenceId;
/**
*
* The start time of the first segment on the edge.
*
*/
private java.util.Date startTime;
/**
*
* The end time of the last segment on the edge.
*
*/
private java.util.Date endTime;
/**
*
* Response statistics for segments on the edge.
*
*/
private EdgeStatistics summaryStatistics;
/**
*
* Histogram describing the prominence of response times on the edge.
*
*/
private java.util.List responseTimeHistogram;
/**
*
* Aliases for the edge.
*
*/
private java.util.List aliases;
/**
*
* Identifier of the edge. Unique within a service map.
*
*
* @param referenceId
* Identifier of the edge. Unique within a service map.
*/
public void setReferenceId(Integer referenceId) {
this.referenceId = referenceId;
}
/**
*
* Identifier of the edge. Unique within a service map.
*
*
* @return Identifier of the edge. Unique within a service map.
*/
public Integer getReferenceId() {
return this.referenceId;
}
/**
*
* Identifier of the edge. Unique within a service map.
*
*
* @param referenceId
* Identifier of the edge. Unique within a service map.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Edge withReferenceId(Integer referenceId) {
setReferenceId(referenceId);
return this;
}
/**
*
* The start time of the first segment on the edge.
*
*
* @param startTime
* The start time of the first segment on the edge.
*/
public void setStartTime(java.util.Date startTime) {
this.startTime = startTime;
}
/**
*
* The start time of the first segment on the edge.
*
*
* @return The start time of the first segment on the edge.
*/
public java.util.Date getStartTime() {
return this.startTime;
}
/**
*
* The start time of the first segment on the edge.
*
*
* @param startTime
* The start time of the first segment on the edge.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Edge withStartTime(java.util.Date startTime) {
setStartTime(startTime);
return this;
}
/**
*
* The end time of the last segment on the edge.
*
*
* @param endTime
* The end time of the last segment on the edge.
*/
public void setEndTime(java.util.Date endTime) {
this.endTime = endTime;
}
/**
*
* The end time of the last segment on the edge.
*
*
* @return The end time of the last segment on the edge.
*/
public java.util.Date getEndTime() {
return this.endTime;
}
/**
*
* The end time of the last segment on the edge.
*
*
* @param endTime
* The end time of the last segment on the edge.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Edge withEndTime(java.util.Date endTime) {
setEndTime(endTime);
return this;
}
/**
*
* Response statistics for segments on the edge.
*
*
* @param summaryStatistics
* Response statistics for segments on the edge.
*/
public void setSummaryStatistics(EdgeStatistics summaryStatistics) {
this.summaryStatistics = summaryStatistics;
}
/**
*
* Response statistics for segments on the edge.
*
*
* @return Response statistics for segments on the edge.
*/
public EdgeStatistics getSummaryStatistics() {
return this.summaryStatistics;
}
/**
*
* Response statistics for segments on the edge.
*
*
* @param summaryStatistics
* Response statistics for segments on the edge.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Edge withSummaryStatistics(EdgeStatistics summaryStatistics) {
setSummaryStatistics(summaryStatistics);
return this;
}
/**
*
* Histogram describing the prominence of response times on the edge.
*
*
* @return Histogram describing the prominence of response times on the edge.
*/
public java.util.List getResponseTimeHistogram() {
return responseTimeHistogram;
}
/**
*
* Histogram describing the prominence of response times on the edge.
*
*
* @param responseTimeHistogram
* Histogram describing the prominence of response times on the edge.
*/
public void setResponseTimeHistogram(java.util.Collection responseTimeHistogram) {
if (responseTimeHistogram == null) {
this.responseTimeHistogram = null;
return;
}
this.responseTimeHistogram = new java.util.ArrayList(responseTimeHistogram);
}
/**
*
* Histogram describing the prominence of response times on the edge.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setResponseTimeHistogram(java.util.Collection)} or
* {@link #withResponseTimeHistogram(java.util.Collection)} if you want to override the existing values.
*
*
* @param responseTimeHistogram
* Histogram describing the prominence of response times on the edge.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Edge withResponseTimeHistogram(HistogramEntry... responseTimeHistogram) {
if (this.responseTimeHistogram == null) {
setResponseTimeHistogram(new java.util.ArrayList(responseTimeHistogram.length));
}
for (HistogramEntry ele : responseTimeHistogram) {
this.responseTimeHistogram.add(ele);
}
return this;
}
/**
*
* Histogram describing the prominence of response times on the edge.
*
*
* @param responseTimeHistogram
* Histogram describing the prominence of response times on the edge.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Edge withResponseTimeHistogram(java.util.Collection responseTimeHistogram) {
setResponseTimeHistogram(responseTimeHistogram);
return this;
}
/**
*
* Aliases for the edge.
*
*
* @return Aliases for the edge.
*/
public java.util.List getAliases() {
return aliases;
}
/**
*
* Aliases for the edge.
*
*
* @param aliases
* Aliases for the edge.
*/
public void setAliases(java.util.Collection aliases) {
if (aliases == null) {
this.aliases = null;
return;
}
this.aliases = new java.util.ArrayList(aliases);
}
/**
*
* Aliases for the edge.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAliases(java.util.Collection)} or {@link #withAliases(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param aliases
* Aliases for the edge.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Edge withAliases(Alias... aliases) {
if (this.aliases == null) {
setAliases(new java.util.ArrayList(aliases.length));
}
for (Alias ele : aliases) {
this.aliases.add(ele);
}
return this;
}
/**
*
* Aliases for the edge.
*
*
* @param aliases
* Aliases for the edge.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Edge withAliases(java.util.Collection aliases) {
setAliases(aliases);
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 (getReferenceId() != null)
sb.append("ReferenceId: ").append(getReferenceId()).append(",");
if (getStartTime() != null)
sb.append("StartTime: ").append(getStartTime()).append(",");
if (getEndTime() != null)
sb.append("EndTime: ").append(getEndTime()).append(",");
if (getSummaryStatistics() != null)
sb.append("SummaryStatistics: ").append(getSummaryStatistics()).append(",");
if (getResponseTimeHistogram() != null)
sb.append("ResponseTimeHistogram: ").append(getResponseTimeHistogram()).append(",");
if (getAliases() != null)
sb.append("Aliases: ").append(getAliases());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Edge == false)
return false;
Edge other = (Edge) obj;
if (other.getReferenceId() == null ^ this.getReferenceId() == null)
return false;
if (other.getReferenceId() != null && other.getReferenceId().equals(this.getReferenceId()) == false)
return false;
if (other.getStartTime() == null ^ this.getStartTime() == null)
return false;
if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == false)
return false;
if (other.getEndTime() == null ^ this.getEndTime() == null)
return false;
if (other.getEndTime() != null && other.getEndTime().equals(this.getEndTime()) == false)
return false;
if (other.getSummaryStatistics() == null ^ this.getSummaryStatistics() == null)
return false;
if (other.getSummaryStatistics() != null && other.getSummaryStatistics().equals(this.getSummaryStatistics()) == false)
return false;
if (other.getResponseTimeHistogram() == null ^ this.getResponseTimeHistogram() == null)
return false;
if (other.getResponseTimeHistogram() != null && other.getResponseTimeHistogram().equals(this.getResponseTimeHistogram()) == false)
return false;
if (other.getAliases() == null ^ this.getAliases() == null)
return false;
if (other.getAliases() != null && other.getAliases().equals(this.getAliases()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getReferenceId() == null) ? 0 : getReferenceId().hashCode());
hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
hashCode = prime * hashCode + ((getSummaryStatistics() == null) ? 0 : getSummaryStatistics().hashCode());
hashCode = prime * hashCode + ((getResponseTimeHistogram() == null) ? 0 : getResponseTimeHistogram().hashCode());
hashCode = prime * hashCode + ((getAliases() == null) ? 0 : getAliases().hashCode());
return hashCode;
}
@Override
public Edge clone() {
try {
return (Edge) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}