/* * 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.transcribe.model; import java.io.Serializable; /** *
* 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 . *
*/ public class AbsoluteTimeRange implements Serializable { /** *
     * 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.
     * 
     * Constraints:
     * Range: 0 - 14400000
     */
    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.
     * 
     * Constraints:
     * Range: 0 - 14400000
     */
    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. *
*
     * Constraints:
     * Range: 0 - 14400000
     */
    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. *
*
     * Constraints:
     * Range: 0 - 14400000
     */
    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.
     * 
     * Constraints:
     * Range: 0 - 14400000
     *
     * @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.
     *         
     * 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.
     * 
     * Constraints:
     * Range: 0 - 14400000
     *
     * @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.
     *            
     * 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.
     * 
* Returns a reference to this object so that method calls can be chained * together. *
     * Constraints:
     * Range: 0 - 14400000
     *
     * @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.
     *            
     * 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.
     * 
     * Constraints:
     * Range: 0 - 14400000
     *
     * @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.
     *         
     * 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.
     * 
     * Constraints:
     * Range: 0 - 14400000
     *
     * @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.
     *            
     * 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.
     * 
* Returns a reference to this object so that method calls can be chained * together. *
     * Constraints:
     * Range: 0 - 14400000
     *
     * @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.
     *            
* 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. *
*
     * Constraints:
     * Range: 0 - 14400000
     *
     * @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 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. *
*
     * Constraints:
     * Range: 0 - 14400000
     *
     * @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. *
** Returns a reference to this object so that method calls can be chained * together. *
     * Constraints:
     * Range: 0 - 14400000
     *
     * @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 A reference to this updated object so that method calls can be * chained together. */ public AbsoluteTimeRange withFirst(Long first) { this.first = 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. *
*
     * Constraints:
     * Range: 0 - 14400000
     *
     * @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 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. *
*
     * Constraints:
     * Range: 0 - 14400000
     *
     * @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. *
** Returns a reference to this object so that method calls can be chained * together. *
     * Constraints:
     * Range: 0 - 14400000
     *
     * @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 A reference to this updated object so that method calls can be * chained together. */ public AbsoluteTimeRange withLast(Long last) { this.last = last; 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 (getStartTime() != null) sb.append("StartTime: " + getStartTime() + ","); if (getEndTime() != null) sb.append("EndTime: " + getEndTime() + ","); if (getFirst() != null) sb.append("First: " + getFirst() + ","); if (getLast() != null) sb.append("Last: " + getLast()); sb.append("}"); return sb.toString(); } @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 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; } }