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

* Represents a segment of video or other time-delimited data. *

*/ public class Fragment implements Serializable { /** *

* The unique identifier of the fragment. This value monotonically increases * based on the ingestion order. *

*

* Constraints:
* Length: 1 - 128
* Pattern: ^[0-9]+$
*/ private String fragmentNumber; /** *

* The total fragment size, including information about the fragment and * contained media data. *

*/ private Long fragmentSizeInBytes; /** *

* The timestamp from the producer corresponding to the fragment. *

*/ private java.util.Date producerTimestamp; /** *

* The timestamp from the AWS server corresponding to the fragment. *

*/ private java.util.Date serverTimestamp; /** *

* The playback duration or other time value associated with the fragment. *

*/ private Long fragmentLengthInMilliseconds; /** *

* The unique identifier of the fragment. This value monotonically increases * based on the ingestion order. *

*

* Constraints:
* Length: 1 - 128
* Pattern: ^[0-9]+$
* * @return

* The unique identifier of the fragment. This value monotonically * increases based on the ingestion order. *

*/ public String getFragmentNumber() { return fragmentNumber; } /** *

* The unique identifier of the fragment. This value monotonically increases * based on the ingestion order. *

*

* Constraints:
* Length: 1 - 128
* Pattern: ^[0-9]+$
* * @param fragmentNumber

* The unique identifier of the fragment. This value * monotonically increases based on the ingestion order. *

*/ public void setFragmentNumber(String fragmentNumber) { this.fragmentNumber = fragmentNumber; } /** *

* The unique identifier of the fragment. This value monotonically increases * based on the ingestion order. *

*

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

* Constraints:
* Length: 1 - 128
* Pattern: ^[0-9]+$
* * @param fragmentNumber

* The unique identifier of the fragment. This value * monotonically increases based on the ingestion order. *

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

* The total fragment size, including information about the fragment and * contained media data. *

* * @return

* The total fragment size, including information about the fragment * and contained media data. *

*/ public Long getFragmentSizeInBytes() { return fragmentSizeInBytes; } /** *

* The total fragment size, including information about the fragment and * contained media data. *

* * @param fragmentSizeInBytes

* The total fragment size, including information about the * fragment and contained media data. *

*/ public void setFragmentSizeInBytes(Long fragmentSizeInBytes) { this.fragmentSizeInBytes = fragmentSizeInBytes; } /** *

* The total fragment size, including information about the fragment and * contained media data. *

*

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

* The total fragment size, including information about the * fragment and contained media data. *

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

* The timestamp from the producer corresponding to the fragment. *

* * @return

* The timestamp from the producer corresponding to the fragment. *

*/ public java.util.Date getProducerTimestamp() { return producerTimestamp; } /** *

* The timestamp from the producer corresponding to the fragment. *

* * @param producerTimestamp

* The timestamp from the producer corresponding to the fragment. *

*/ public void setProducerTimestamp(java.util.Date producerTimestamp) { this.producerTimestamp = producerTimestamp; } /** *

* The timestamp from the producer corresponding to the fragment. *

*

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

* The timestamp from the producer corresponding to the fragment. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Fragment withProducerTimestamp(java.util.Date producerTimestamp) { this.producerTimestamp = producerTimestamp; return this; } /** *

* The timestamp from the AWS server corresponding to the fragment. *

* * @return

* The timestamp from the AWS server corresponding to the fragment. *

*/ public java.util.Date getServerTimestamp() { return serverTimestamp; } /** *

* The timestamp from the AWS server corresponding to the fragment. *

* * @param serverTimestamp

* The timestamp from the AWS server corresponding to the * fragment. *

*/ public void setServerTimestamp(java.util.Date serverTimestamp) { this.serverTimestamp = serverTimestamp; } /** *

* The timestamp from the AWS server corresponding to the fragment. *

*

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

* The timestamp from the AWS server corresponding to the * fragment. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Fragment withServerTimestamp(java.util.Date serverTimestamp) { this.serverTimestamp = serverTimestamp; return this; } /** *

* The playback duration or other time value associated with the fragment. *

* * @return

* The playback duration or other time value associated with the * fragment. *

*/ public Long getFragmentLengthInMilliseconds() { return fragmentLengthInMilliseconds; } /** *

* The playback duration or other time value associated with the fragment. *

* * @param fragmentLengthInMilliseconds

* The playback duration or other time value associated with the * fragment. *

*/ public void setFragmentLengthInMilliseconds(Long fragmentLengthInMilliseconds) { this.fragmentLengthInMilliseconds = fragmentLengthInMilliseconds; } /** *

* The playback duration or other time value associated with the fragment. *

*

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

* The playback duration or other time value associated with the * fragment. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Fragment withFragmentLengthInMilliseconds(Long fragmentLengthInMilliseconds) { this.fragmentLengthInMilliseconds = fragmentLengthInMilliseconds; 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 (getFragmentNumber() != null) sb.append("FragmentNumber: " + getFragmentNumber() + ","); if (getFragmentSizeInBytes() != null) sb.append("FragmentSizeInBytes: " + getFragmentSizeInBytes() + ","); if (getProducerTimestamp() != null) sb.append("ProducerTimestamp: " + getProducerTimestamp() + ","); if (getServerTimestamp() != null) sb.append("ServerTimestamp: " + getServerTimestamp() + ","); if (getFragmentLengthInMilliseconds() != null) sb.append("FragmentLengthInMilliseconds: " + getFragmentLengthInMilliseconds()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getFragmentNumber() == null) ? 0 : getFragmentNumber().hashCode()); hashCode = prime * hashCode + ((getFragmentSizeInBytes() == null) ? 0 : getFragmentSizeInBytes().hashCode()); hashCode = prime * hashCode + ((getProducerTimestamp() == null) ? 0 : getProducerTimestamp().hashCode()); hashCode = prime * hashCode + ((getServerTimestamp() == null) ? 0 : getServerTimestamp().hashCode()); hashCode = prime * hashCode + ((getFragmentLengthInMilliseconds() == null) ? 0 : getFragmentLengthInMilliseconds().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Fragment == false) return false; Fragment other = (Fragment) obj; if (other.getFragmentNumber() == null ^ this.getFragmentNumber() == null) return false; if (other.getFragmentNumber() != null && other.getFragmentNumber().equals(this.getFragmentNumber()) == false) return false; if (other.getFragmentSizeInBytes() == null ^ this.getFragmentSizeInBytes() == null) return false; if (other.getFragmentSizeInBytes() != null && other.getFragmentSizeInBytes().equals(this.getFragmentSizeInBytes()) == false) return false; if (other.getProducerTimestamp() == null ^ this.getProducerTimestamp() == null) return false; if (other.getProducerTimestamp() != null && other.getProducerTimestamp().equals(this.getProducerTimestamp()) == false) return false; if (other.getServerTimestamp() == null ^ this.getServerTimestamp() == null) return false; if (other.getServerTimestamp() != null && other.getServerTimestamp().equals(this.getServerTimestamp()) == false) return false; if (other.getFragmentLengthInMilliseconds() == null ^ this.getFragmentLengthInMilliseconds() == null) return false; if (other.getFragmentLengthInMilliseconds() != null && other.getFragmentLengthInMilliseconds().equals( this.getFragmentLengthInMilliseconds()) == false) return false; return true; } }