/* * Copyright 2010-2019 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.logs.model; import java.io.Serializable; /** *

* Represents a log stream, which is a sequence of log events from a single * emitter of logs. *

*/ public class LogStream implements Serializable { /** *

* The name of the log stream. *

*

* Constraints:
* Length: 1 - 512
* Pattern: [^:*]*
*/ private String logStreamName; /** *

* The creation time of the stream, expressed as the number of milliseconds * after Jan 1, 1970 00:00:00 UTC. *

*

* Constraints:
* Range: 0 -
*/ private Long creationTime; /** *

* The time of the first event, expressed as the number of milliseconds * after Jan 1, 1970 00:00:00 UTC. *

*

* Constraints:
* Range: 0 -
*/ private Long firstEventTimestamp; /** *

* the time of the most recent log event in the log stream in CloudWatch * Logs. This number is expressed as the number of milliseconds after Jan 1, * 1970 00:00:00 UTC. lastEventTime updates on an eventual consistency * basis. It typically updates in less than an hour from ingestion, but may * take longer in some rare situations. *

*

* Constraints:
* Range: 0 -
*/ private Long lastEventTimestamp; /** *

* The ingestion time, expressed as the number of milliseconds after Jan 1, * 1970 00:00:00 UTC. *

*

* Constraints:
* Range: 0 -
*/ private Long lastIngestionTime; /** *

* The sequence token. *

*

* Constraints:
* Length: 1 -
*/ private String uploadSequenceToken; /** *

* The Amazon Resource Name (ARN) of the log stream. *

*/ private String arn; /** *

* The number of bytes stored. *

*

* Constraints:
* Range: 0 -
*/ private Long storedBytes; /** *

* The name of the log stream. *

*

* Constraints:
* Length: 1 - 512
* Pattern: [^:*]*
* * @return

* The name of the log stream. *

*/ public String getLogStreamName() { return logStreamName; } /** *

* The name of the log stream. *

*

* Constraints:
* Length: 1 - 512
* Pattern: [^:*]*
* * @param logStreamName

* The name of the log stream. *

*/ public void setLogStreamName(String logStreamName) { this.logStreamName = logStreamName; } /** *

* The name of the log stream. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 512
* Pattern: [^:*]*
* * @param logStreamName

* The name of the log stream. *

* @return A reference to this updated object so that method calls can be * chained together. */ public LogStream withLogStreamName(String logStreamName) { this.logStreamName = logStreamName; return this; } /** *

* The creation time of the stream, expressed as the number of milliseconds * after Jan 1, 1970 00:00:00 UTC. *

*

* Constraints:
* Range: 0 -
* * @return

* The creation time of the stream, expressed as the number of * milliseconds after Jan 1, 1970 00:00:00 UTC. *

*/ public Long getCreationTime() { return creationTime; } /** *

* The creation time of the stream, expressed as the number of milliseconds * after Jan 1, 1970 00:00:00 UTC. *

*

* Constraints:
* Range: 0 -
* * @param creationTime

* The creation time of the stream, expressed as the number of * milliseconds after Jan 1, 1970 00:00:00 UTC. *

*/ public void setCreationTime(Long creationTime) { this.creationTime = creationTime; } /** *

* The creation time of the stream, expressed as the number of milliseconds * after Jan 1, 1970 00:00:00 UTC. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Range: 0 -
* * @param creationTime

* The creation time of the stream, expressed as the number of * milliseconds after Jan 1, 1970 00:00:00 UTC. *

* @return A reference to this updated object so that method calls can be * chained together. */ public LogStream withCreationTime(Long creationTime) { this.creationTime = creationTime; return this; } /** *

* The time of the first event, expressed as the number of milliseconds * after Jan 1, 1970 00:00:00 UTC. *

*

* Constraints:
* Range: 0 -
* * @return

* The time of the first event, expressed as the number of * milliseconds after Jan 1, 1970 00:00:00 UTC. *

*/ public Long getFirstEventTimestamp() { return firstEventTimestamp; } /** *

* The time of the first event, expressed as the number of milliseconds * after Jan 1, 1970 00:00:00 UTC. *

*

* Constraints:
* Range: 0 -
* * @param firstEventTimestamp

* The time of the first event, expressed as the number of * milliseconds after Jan 1, 1970 00:00:00 UTC. *

*/ public void setFirstEventTimestamp(Long firstEventTimestamp) { this.firstEventTimestamp = firstEventTimestamp; } /** *

* The time of the first event, expressed as the number of milliseconds * after Jan 1, 1970 00:00:00 UTC. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Range: 0 -
* * @param firstEventTimestamp

* The time of the first event, expressed as the number of * milliseconds after Jan 1, 1970 00:00:00 UTC. *

* @return A reference to this updated object so that method calls can be * chained together. */ public LogStream withFirstEventTimestamp(Long firstEventTimestamp) { this.firstEventTimestamp = firstEventTimestamp; return this; } /** *

* the time of the most recent log event in the log stream in CloudWatch * Logs. This number is expressed as the number of milliseconds after Jan 1, * 1970 00:00:00 UTC. lastEventTime updates on an eventual consistency * basis. It typically updates in less than an hour from ingestion, but may * take longer in some rare situations. *

*

* Constraints:
* Range: 0 -
* * @return

* the time of the most recent log event in the log stream in * CloudWatch Logs. This number is expressed as the number of * milliseconds after Jan 1, 1970 00:00:00 UTC. lastEventTime * updates on an eventual consistency basis. It typically updates in * less than an hour from ingestion, but may take longer in some * rare situations. *

*/ public Long getLastEventTimestamp() { return lastEventTimestamp; } /** *

* the time of the most recent log event in the log stream in CloudWatch * Logs. This number is expressed as the number of milliseconds after Jan 1, * 1970 00:00:00 UTC. lastEventTime updates on an eventual consistency * basis. It typically updates in less than an hour from ingestion, but may * take longer in some rare situations. *

*

* Constraints:
* Range: 0 -
* * @param lastEventTimestamp

* the time of the most recent log event in the log stream in * CloudWatch Logs. This number is expressed as the number of * milliseconds after Jan 1, 1970 00:00:00 UTC. lastEventTime * updates on an eventual consistency basis. It typically updates * in less than an hour from ingestion, but may take longer in * some rare situations. *

*/ public void setLastEventTimestamp(Long lastEventTimestamp) { this.lastEventTimestamp = lastEventTimestamp; } /** *

* the time of the most recent log event in the log stream in CloudWatch * Logs. This number is expressed as the number of milliseconds after Jan 1, * 1970 00:00:00 UTC. lastEventTime updates on an eventual consistency * basis. It typically updates in less than an hour from ingestion, but may * take longer in some rare situations. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Range: 0 -
* * @param lastEventTimestamp

* the time of the most recent log event in the log stream in * CloudWatch Logs. This number is expressed as the number of * milliseconds after Jan 1, 1970 00:00:00 UTC. lastEventTime * updates on an eventual consistency basis. It typically updates * in less than an hour from ingestion, but may take longer in * some rare situations. *

* @return A reference to this updated object so that method calls can be * chained together. */ public LogStream withLastEventTimestamp(Long lastEventTimestamp) { this.lastEventTimestamp = lastEventTimestamp; return this; } /** *

* The ingestion time, expressed as the number of milliseconds after Jan 1, * 1970 00:00:00 UTC. *

*

* Constraints:
* Range: 0 -
* * @return

* The ingestion time, expressed as the number of milliseconds after * Jan 1, 1970 00:00:00 UTC. *

*/ public Long getLastIngestionTime() { return lastIngestionTime; } /** *

* The ingestion time, expressed as the number of milliseconds after Jan 1, * 1970 00:00:00 UTC. *

*

* Constraints:
* Range: 0 -
* * @param lastIngestionTime

* The ingestion time, expressed as the number of milliseconds * after Jan 1, 1970 00:00:00 UTC. *

*/ public void setLastIngestionTime(Long lastIngestionTime) { this.lastIngestionTime = lastIngestionTime; } /** *

* The ingestion time, expressed as the number of milliseconds after Jan 1, * 1970 00:00:00 UTC. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Range: 0 -
* * @param lastIngestionTime

* The ingestion time, expressed as the number of milliseconds * after Jan 1, 1970 00:00:00 UTC. *

* @return A reference to this updated object so that method calls can be * chained together. */ public LogStream withLastIngestionTime(Long lastIngestionTime) { this.lastIngestionTime = lastIngestionTime; return this; } /** *

* The sequence token. *

*

* Constraints:
* Length: 1 -
* * @return

* The sequence token. *

*/ public String getUploadSequenceToken() { return uploadSequenceToken; } /** *

* The sequence token. *

*

* Constraints:
* Length: 1 -
* * @param uploadSequenceToken

* The sequence token. *

*/ public void setUploadSequenceToken(String uploadSequenceToken) { this.uploadSequenceToken = uploadSequenceToken; } /** *

* The sequence token. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 -
* * @param uploadSequenceToken

* The sequence token. *

* @return A reference to this updated object so that method calls can be * chained together. */ public LogStream withUploadSequenceToken(String uploadSequenceToken) { this.uploadSequenceToken = uploadSequenceToken; return this; } /** *

* The Amazon Resource Name (ARN) of the log stream. *

* * @return

* The Amazon Resource Name (ARN) of the log stream. *

*/ public String getArn() { return arn; } /** *

* The Amazon Resource Name (ARN) of the log stream. *

* * @param arn

* The Amazon Resource Name (ARN) of the log stream. *

*/ public void setArn(String arn) { this.arn = arn; } /** *

* The Amazon Resource Name (ARN) of the log stream. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param arn

* The Amazon Resource Name (ARN) of the log stream. *

* @return A reference to this updated object so that method calls can be * chained together. */ public LogStream withArn(String arn) { this.arn = arn; return this; } /** *

* The number of bytes stored. *

*

* Constraints:
* Range: 0 -
* * @return

* The number of bytes stored. *

*/ public Long getStoredBytes() { return storedBytes; } /** *

* The number of bytes stored. *

*

* Constraints:
* Range: 0 -
* * @param storedBytes

* The number of bytes stored. *

*/ public void setStoredBytes(Long storedBytes) { this.storedBytes = storedBytes; } /** *

* The number of bytes stored. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Range: 0 -
* * @param storedBytes

* The number of bytes stored. *

* @return A reference to this updated object so that method calls can be * chained together. */ public LogStream withStoredBytes(Long storedBytes) { this.storedBytes = storedBytes; 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 (getLogStreamName() != null) sb.append("logStreamName: " + getLogStreamName() + ","); if (getCreationTime() != null) sb.append("creationTime: " + getCreationTime() + ","); if (getFirstEventTimestamp() != null) sb.append("firstEventTimestamp: " + getFirstEventTimestamp() + ","); if (getLastEventTimestamp() != null) sb.append("lastEventTimestamp: " + getLastEventTimestamp() + ","); if (getLastIngestionTime() != null) sb.append("lastIngestionTime: " + getLastIngestionTime() + ","); if (getUploadSequenceToken() != null) sb.append("uploadSequenceToken: " + getUploadSequenceToken() + ","); if (getArn() != null) sb.append("arn: " + getArn() + ","); if (getStoredBytes() != null) sb.append("storedBytes: " + getStoredBytes()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLogStreamName() == null) ? 0 : getLogStreamName().hashCode()); hashCode = prime * hashCode + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode()); hashCode = prime * hashCode + ((getFirstEventTimestamp() == null) ? 0 : getFirstEventTimestamp().hashCode()); hashCode = prime * hashCode + ((getLastEventTimestamp() == null) ? 0 : getLastEventTimestamp().hashCode()); hashCode = prime * hashCode + ((getLastIngestionTime() == null) ? 0 : getLastIngestionTime().hashCode()); hashCode = prime * hashCode + ((getUploadSequenceToken() == null) ? 0 : getUploadSequenceToken().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getStoredBytes() == null) ? 0 : getStoredBytes().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof LogStream == false) return false; LogStream other = (LogStream) obj; if (other.getLogStreamName() == null ^ this.getLogStreamName() == null) return false; if (other.getLogStreamName() != null && other.getLogStreamName().equals(this.getLogStreamName()) == false) return false; if (other.getCreationTime() == null ^ this.getCreationTime() == null) return false; if (other.getCreationTime() != null && other.getCreationTime().equals(this.getCreationTime()) == false) return false; if (other.getFirstEventTimestamp() == null ^ this.getFirstEventTimestamp() == null) return false; if (other.getFirstEventTimestamp() != null && other.getFirstEventTimestamp().equals(this.getFirstEventTimestamp()) == false) return false; if (other.getLastEventTimestamp() == null ^ this.getLastEventTimestamp() == null) return false; if (other.getLastEventTimestamp() != null && other.getLastEventTimestamp().equals(this.getLastEventTimestamp()) == false) return false; if (other.getLastIngestionTime() == null ^ this.getLastIngestionTime() == null) return false; if (other.getLastIngestionTime() != null && other.getLastIngestionTime().equals(this.getLastIngestionTime()) == false) return false; if (other.getUploadSequenceToken() == null ^ this.getUploadSequenceToken() == null) return false; if (other.getUploadSequenceToken() != null && other.getUploadSequenceToken().equals(this.getUploadSequenceToken()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getStoredBytes() == null ^ this.getStoredBytes() == null) return false; if (other.getStoredBytes() != null && other.getStoredBytes().equals(this.getStoredBytes()) == false) return false; return true; } }