com.amazonaws.services.detective.model.ImpossibleTravelDetail Maven / Gradle / Ivy
Show all versions of aws-java-sdk-detective 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.detective.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Contains information on unusual and impossible travel in an account.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ImpossibleTravelDetail implements Serializable, Cloneable, StructuredPojo {
/**
*
* IP address where the resource was first used in the impossible travel.
*
*/
private String startingIpAddress;
/**
*
* IP address where the resource was last used in the impossible travel.
*
*/
private String endingIpAddress;
/**
*
* Location where the resource was first used in the impossible travel.
*
*/
private String startingLocation;
/**
*
* Location where the resource was last used in the impossible travel.
*
*/
private String endingLocation;
/**
*
* Returns the time difference between the first and last timestamp the resource was used.
*
*/
private Integer hourlyTimeDelta;
/**
*
* IP address where the resource was first used in the impossible travel.
*
*
* @param startingIpAddress
* IP address where the resource was first used in the impossible travel.
*/
public void setStartingIpAddress(String startingIpAddress) {
this.startingIpAddress = startingIpAddress;
}
/**
*
* IP address where the resource was first used in the impossible travel.
*
*
* @return IP address where the resource was first used in the impossible travel.
*/
public String getStartingIpAddress() {
return this.startingIpAddress;
}
/**
*
* IP address where the resource was first used in the impossible travel.
*
*
* @param startingIpAddress
* IP address where the resource was first used in the impossible travel.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImpossibleTravelDetail withStartingIpAddress(String startingIpAddress) {
setStartingIpAddress(startingIpAddress);
return this;
}
/**
*
* IP address where the resource was last used in the impossible travel.
*
*
* @param endingIpAddress
* IP address where the resource was last used in the impossible travel.
*/
public void setEndingIpAddress(String endingIpAddress) {
this.endingIpAddress = endingIpAddress;
}
/**
*
* IP address where the resource was last used in the impossible travel.
*
*
* @return IP address where the resource was last used in the impossible travel.
*/
public String getEndingIpAddress() {
return this.endingIpAddress;
}
/**
*
* IP address where the resource was last used in the impossible travel.
*
*
* @param endingIpAddress
* IP address where the resource was last used in the impossible travel.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImpossibleTravelDetail withEndingIpAddress(String endingIpAddress) {
setEndingIpAddress(endingIpAddress);
return this;
}
/**
*
* Location where the resource was first used in the impossible travel.
*
*
* @param startingLocation
* Location where the resource was first used in the impossible travel.
*/
public void setStartingLocation(String startingLocation) {
this.startingLocation = startingLocation;
}
/**
*
* Location where the resource was first used in the impossible travel.
*
*
* @return Location where the resource was first used in the impossible travel.
*/
public String getStartingLocation() {
return this.startingLocation;
}
/**
*
* Location where the resource was first used in the impossible travel.
*
*
* @param startingLocation
* Location where the resource was first used in the impossible travel.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImpossibleTravelDetail withStartingLocation(String startingLocation) {
setStartingLocation(startingLocation);
return this;
}
/**
*
* Location where the resource was last used in the impossible travel.
*
*
* @param endingLocation
* Location where the resource was last used in the impossible travel.
*/
public void setEndingLocation(String endingLocation) {
this.endingLocation = endingLocation;
}
/**
*
* Location where the resource was last used in the impossible travel.
*
*
* @return Location where the resource was last used in the impossible travel.
*/
public String getEndingLocation() {
return this.endingLocation;
}
/**
*
* Location where the resource was last used in the impossible travel.
*
*
* @param endingLocation
* Location where the resource was last used in the impossible travel.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImpossibleTravelDetail withEndingLocation(String endingLocation) {
setEndingLocation(endingLocation);
return this;
}
/**
*
* Returns the time difference between the first and last timestamp the resource was used.
*
*
* @param hourlyTimeDelta
* Returns the time difference between the first and last timestamp the resource was used.
*/
public void setHourlyTimeDelta(Integer hourlyTimeDelta) {
this.hourlyTimeDelta = hourlyTimeDelta;
}
/**
*
* Returns the time difference between the first and last timestamp the resource was used.
*
*
* @return Returns the time difference between the first and last timestamp the resource was used.
*/
public Integer getHourlyTimeDelta() {
return this.hourlyTimeDelta;
}
/**
*
* Returns the time difference between the first and last timestamp the resource was used.
*
*
* @param hourlyTimeDelta
* Returns the time difference between the first and last timestamp the resource was used.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImpossibleTravelDetail withHourlyTimeDelta(Integer hourlyTimeDelta) {
setHourlyTimeDelta(hourlyTimeDelta);
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 (getStartingIpAddress() != null)
sb.append("StartingIpAddress: ").append(getStartingIpAddress()).append(",");
if (getEndingIpAddress() != null)
sb.append("EndingIpAddress: ").append(getEndingIpAddress()).append(",");
if (getStartingLocation() != null)
sb.append("StartingLocation: ").append(getStartingLocation()).append(",");
if (getEndingLocation() != null)
sb.append("EndingLocation: ").append(getEndingLocation()).append(",");
if (getHourlyTimeDelta() != null)
sb.append("HourlyTimeDelta: ").append(getHourlyTimeDelta());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ImpossibleTravelDetail == false)
return false;
ImpossibleTravelDetail other = (ImpossibleTravelDetail) obj;
if (other.getStartingIpAddress() == null ^ this.getStartingIpAddress() == null)
return false;
if (other.getStartingIpAddress() != null && other.getStartingIpAddress().equals(this.getStartingIpAddress()) == false)
return false;
if (other.getEndingIpAddress() == null ^ this.getEndingIpAddress() == null)
return false;
if (other.getEndingIpAddress() != null && other.getEndingIpAddress().equals(this.getEndingIpAddress()) == false)
return false;
if (other.getStartingLocation() == null ^ this.getStartingLocation() == null)
return false;
if (other.getStartingLocation() != null && other.getStartingLocation().equals(this.getStartingLocation()) == false)
return false;
if (other.getEndingLocation() == null ^ this.getEndingLocation() == null)
return false;
if (other.getEndingLocation() != null && other.getEndingLocation().equals(this.getEndingLocation()) == false)
return false;
if (other.getHourlyTimeDelta() == null ^ this.getHourlyTimeDelta() == null)
return false;
if (other.getHourlyTimeDelta() != null && other.getHourlyTimeDelta().equals(this.getHourlyTimeDelta()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getStartingIpAddress() == null) ? 0 : getStartingIpAddress().hashCode());
hashCode = prime * hashCode + ((getEndingIpAddress() == null) ? 0 : getEndingIpAddress().hashCode());
hashCode = prime * hashCode + ((getStartingLocation() == null) ? 0 : getStartingLocation().hashCode());
hashCode = prime * hashCode + ((getEndingLocation() == null) ? 0 : getEndingLocation().hashCode());
hashCode = prime * hashCode + ((getHourlyTimeDelta() == null) ? 0 : getHourlyTimeDelta().hashCode());
return hashCode;
}
@Override
public ImpossibleTravelDetail clone() {
try {
return (ImpossibleTravelDetail) 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.detective.model.transform.ImpossibleTravelDetailMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}