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

* Specifies the starting point in a Kinesis stream to start processing. You can * use the producer timestamp or the fragment number. One of either producer * timestamp or fragment number is required. If you use the producer timestamp, * you must put the time in milliseconds. For more information about fragment * numbers, see Fragment. *

*/ public class KinesisVideoStreamStartSelector implements Serializable { /** *

* The timestamp from the producer corresponding to the fragment, in * milliseconds, expressed in unix time format. *

*

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

* 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 timestamp from the producer corresponding to the fragment, in * milliseconds, expressed in unix time format. *

*

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

* The timestamp from the producer corresponding to the fragment, in * milliseconds, expressed in unix time format. *

*/ public Long getProducerTimestamp() { return producerTimestamp; } /** *

* The timestamp from the producer corresponding to the fragment, in * milliseconds, expressed in unix time format. *

*

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

* The timestamp from the producer corresponding to the fragment, * in milliseconds, expressed in unix time format. *

*/ public void setProducerTimestamp(Long producerTimestamp) { this.producerTimestamp = producerTimestamp; } /** *

* The timestamp from the producer corresponding to the fragment, in * milliseconds, expressed in unix time format. *

*

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

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

* The timestamp from the producer corresponding to the fragment, * in milliseconds, expressed in unix time format. *

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

* 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 KinesisVideoStreamStartSelector withFragmentNumber(String fragmentNumber) { this.fragmentNumber = fragmentNumber; 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 (getProducerTimestamp() != null) sb.append("ProducerTimestamp: " + getProducerTimestamp() + ","); if (getFragmentNumber() != null) sb.append("FragmentNumber: " + getFragmentNumber()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getProducerTimestamp() == null) ? 0 : getProducerTimestamp().hashCode()); hashCode = prime * hashCode + ((getFragmentNumber() == null) ? 0 : getFragmentNumber().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof KinesisVideoStreamStartSelector == false) return false; KinesisVideoStreamStartSelector other = (KinesisVideoStreamStartSelector) obj; if (other.getProducerTimestamp() == null ^ this.getProducerTimestamp() == null) return false; if (other.getProducerTimestamp() != null && other.getProducerTimestamp().equals(this.getProducerTimestamp()) == false) return false; if (other.getFragmentNumber() == null ^ this.getFragmentNumber() == null) return false; if (other.getFragmentNumber() != null && other.getFragmentNumber().equals(this.getFragmentNumber()) == false) return false; return true; } }