com.amazonaws.services.transcribe.model.AbsoluteTimeRange Maven / Gradle / Ivy
Show all versions of aws-java-sdk-transcribe 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.transcribe.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* A time range, in milliseconds, between two points in your media file.
*
*
* You can use StartTime
and EndTime
to search a custom segment. For example, setting
* StartTime
to 10000 and EndTime
to 50000 only searches for your specified criteria in the
* audio contained between the 10,000 millisecond mark and the 50,000 millisecond mark of your media file. You must use
* StartTime
and EndTime
as a set; that is, if you include one, you must include both.
*
*
* You can use also First
to search from the start of the audio until the time that you specify, or
* Last
to search from the time that you specify until the end of the audio. For example, setting
* First
to 50000 only searches for your specified criteria in the audio contained between the start of the
* media file to the 50,000 millisecond mark. You can use First
and Last
independently of each
* other.
*
*
* If you prefer to use percentage instead of milliseconds, see .
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AbsoluteTimeRange implements Serializable, Cloneable, StructuredPojo {
/**
*
* The time, in milliseconds, when Amazon Transcribe starts searching for the specified criteria in your audio. If
* you include StartTime
in your request, you must also include EndTime
.
*
*/
private Long startTime;
/**
*
* The time, in milliseconds, when Amazon Transcribe stops searching for the specified criteria in your audio. If
* you include EndTime
in your request, you must also include StartTime
.
*
*/
private Long endTime;
/**
*
* The time, in milliseconds, from the start of your media file until the specified value. Amazon Transcribe
* searches for your specified criteria in this time segment.
*
*/
private Long first;
/**
*
* The time, in milliseconds, from the specified value until the end of your media file. Amazon Transcribe searches
* for your specified criteria in this time segment.
*
*/
private Long last;
/**
*
* The time, in milliseconds, when Amazon Transcribe starts searching for the specified criteria in your audio. If
* you include StartTime
in your request, you must also include EndTime
.
*
*
* @param startTime
* The time, in milliseconds, when Amazon Transcribe starts searching for the specified criteria in your
* audio. If you include StartTime
in your request, you must also include EndTime
.
*/
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
/**
*
* The time, in milliseconds, when Amazon Transcribe starts searching for the specified criteria in your audio. If
* you include StartTime
in your request, you must also include EndTime
.
*
*
* @return The time, in milliseconds, when Amazon Transcribe starts searching for the specified criteria in your
* audio. If you include StartTime
in your request, you must also include EndTime
.
*/
public Long getStartTime() {
return this.startTime;
}
/**
*
* The time, in milliseconds, when Amazon Transcribe starts searching for the specified criteria in your audio. If
* you include StartTime
in your request, you must also include EndTime
.
*
*
* @param startTime
* The time, in milliseconds, when Amazon Transcribe starts searching for the specified criteria in your
* audio. If you include StartTime
in your request, you must also include EndTime
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AbsoluteTimeRange withStartTime(Long startTime) {
setStartTime(startTime);
return this;
}
/**
*
* The time, in milliseconds, when Amazon Transcribe stops searching for the specified criteria in your audio. If
* you include EndTime
in your request, you must also include StartTime
.
*
*
* @param endTime
* The time, in milliseconds, when Amazon Transcribe stops searching for the specified criteria in your
* audio. If you include EndTime
in your request, you must also include StartTime
.
*/
public void setEndTime(Long endTime) {
this.endTime = endTime;
}
/**
*
* The time, in milliseconds, when Amazon Transcribe stops searching for the specified criteria in your audio. If
* you include EndTime
in your request, you must also include StartTime
.
*
*
* @return The time, in milliseconds, when Amazon Transcribe stops searching for the specified criteria in your
* audio. If you include EndTime
in your request, you must also include StartTime
.
*/
public Long getEndTime() {
return this.endTime;
}
/**
*
* The time, in milliseconds, when Amazon Transcribe stops searching for the specified criteria in your audio. If
* you include EndTime
in your request, you must also include StartTime
.
*
*
* @param endTime
* The time, in milliseconds, when Amazon Transcribe stops searching for the specified criteria in your
* audio. If you include EndTime
in your request, you must also include StartTime
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AbsoluteTimeRange withEndTime(Long endTime) {
setEndTime(endTime);
return this;
}
/**
*
* The time, in milliseconds, from the start of your media file until the specified value. Amazon Transcribe
* searches for your specified criteria in this time segment.
*
*
* @param first
* The time, in milliseconds, from the start of your media file until the specified value. Amazon Transcribe
* searches for your specified criteria in this time segment.
*/
public void setFirst(Long first) {
this.first = first;
}
/**
*
* The time, in milliseconds, from the start of your media file until the specified value. Amazon Transcribe
* searches for your specified criteria in this time segment.
*
*
* @return The time, in milliseconds, from the start of your media file until the specified value. Amazon Transcribe
* searches for your specified criteria in this time segment.
*/
public Long getFirst() {
return this.first;
}
/**
*
* The time, in milliseconds, from the start of your media file until the specified value. Amazon Transcribe
* searches for your specified criteria in this time segment.
*
*
* @param first
* The time, in milliseconds, from the start of your media file until the specified value. Amazon Transcribe
* searches for your specified criteria in this time segment.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AbsoluteTimeRange withFirst(Long first) {
setFirst(first);
return this;
}
/**
*
* The time, in milliseconds, from the specified value until the end of your media file. Amazon Transcribe searches
* for your specified criteria in this time segment.
*
*
* @param last
* The time, in milliseconds, from the specified value until the end of your media file. Amazon Transcribe
* searches for your specified criteria in this time segment.
*/
public void setLast(Long last) {
this.last = last;
}
/**
*
* The time, in milliseconds, from the specified value until the end of your media file. Amazon Transcribe searches
* for your specified criteria in this time segment.
*
*
* @return The time, in milliseconds, from the specified value until the end of your media file. Amazon Transcribe
* searches for your specified criteria in this time segment.
*/
public Long getLast() {
return this.last;
}
/**
*
* The time, in milliseconds, from the specified value until the end of your media file. Amazon Transcribe searches
* for your specified criteria in this time segment.
*
*
* @param last
* The time, in milliseconds, from the specified value until the end of your media file. Amazon Transcribe
* searches for your specified criteria in this time segment.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AbsoluteTimeRange withLast(Long last) {
setLast(last);
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 (getStartTime() != null)
sb.append("StartTime: ").append(getStartTime()).append(",");
if (getEndTime() != null)
sb.append("EndTime: ").append(getEndTime()).append(",");
if (getFirst() != null)
sb.append("First: ").append(getFirst()).append(",");
if (getLast() != null)
sb.append("Last: ").append(getLast());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AbsoluteTimeRange == false)
return false;
AbsoluteTimeRange other = (AbsoluteTimeRange) obj;
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.getFirst() == null ^ this.getFirst() == null)
return false;
if (other.getFirst() != null && other.getFirst().equals(this.getFirst()) == false)
return false;
if (other.getLast() == null ^ this.getLast() == null)
return false;
if (other.getLast() != null && other.getLast().equals(this.getLast()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
hashCode = prime * hashCode + ((getFirst() == null) ? 0 : getFirst().hashCode());
hashCode = prime * hashCode + ((getLast() == null) ? 0 : getLast().hashCode());
return hashCode;
}
@Override
public AbsoluteTimeRange clone() {
try {
return (AbsoluteTimeRange) 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.transcribe.model.transform.AbsoluteTimeRangeMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}