/* * Copyright 2018-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; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* A technical cue or shot detection segment detected in a video. An array of SegmentDetection objects * containing all segments detected in a stored video is returned by GetSegmentDetection. *

*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class SegmentDetection implements Serializable, Cloneable, StructuredPojo { /** *

* The type of the segment. Valid values are TECHNICAL_CUE and SHOT. *

*/ private String type; /** *

* The start time of the detected segment in milliseconds from the start of the video. This value is rounded down. * For example, if the actual timestamp is 100.6667 milliseconds, Amazon Rekognition Video returns a value of 100 * millis. *

*/ private Long startTimestampMillis; /** *

* The end time of the detected segment, in milliseconds, from the start of the video. This value is rounded down. *

*/ private Long endTimestampMillis; /** *

* The duration of the detected segment in milliseconds. *

*/ private Long durationMillis; /** *

* The frame-accurate SMPTE timecode, from the start of a video, for the start of a detected segment. * StartTimecode is in HH:MM:SS:fr format (and ;fr for drop frame-rates). *

*/ private String startTimecodeSMPTE; /** *

* The frame-accurate SMPTE timecode, from the start of a video, for the end of a detected segment. * EndTimecode is in HH:MM:SS:fr format (and ;fr for drop frame-rates). *

*/ private String endTimecodeSMPTE; /** *

* The duration of the timecode for the detected segment in SMPTE format. *

*/ private String durationSMPTE; /** *

* If the segment is a technical cue, contains information about the technical cue. *

*/ private TechnicalCueSegment technicalCueSegment; /** *

* If the segment is a shot detection, contains information about the shot detection. *

*/ private ShotSegment shotSegment; /** *

* The frame number of the start of a video segment, using a frame index that starts with 0. *

*/ private Long startFrameNumber; /** *

* The frame number at the end of a video segment, using a frame index that starts with 0. *

*/ private Long endFrameNumber; /** *

* The duration of a video segment, expressed in frames. *

*/ private Long durationFrames; /** *

* The type of the segment. Valid values are TECHNICAL_CUE and SHOT. *

* * @param type * The type of the segment. Valid values are TECHNICAL_CUE and SHOT. * @see SegmentType */ public void setType(String type) { this.type = type; } /** *

* The type of the segment. Valid values are TECHNICAL_CUE and SHOT. *

* * @return The type of the segment. Valid values are TECHNICAL_CUE and SHOT. * @see SegmentType */ public String getType() { return this.type; } /** *

* The type of the segment. Valid values are TECHNICAL_CUE and SHOT. *

* * @param type * The type of the segment. Valid values are TECHNICAL_CUE and SHOT. * @return Returns a reference to this object so that method calls can be chained together. * @see SegmentType */ public SegmentDetection withType(String type) { setType(type); return this; } /** *

* The type of the segment. Valid values are TECHNICAL_CUE and SHOT. *

* * @param type * The type of the segment. Valid values are TECHNICAL_CUE and SHOT. * @return Returns a reference to this object so that method calls can be chained together. * @see SegmentType */ public SegmentDetection withType(SegmentType type) { this.type = type.toString(); return this; } /** *

* The start time of the detected segment in milliseconds from the start of the video. This value is rounded down. * For example, if the actual timestamp is 100.6667 milliseconds, Amazon Rekognition Video returns a value of 100 * millis. *

* * @param startTimestampMillis * The start time of the detected segment in milliseconds from the start of the video. This value is rounded * down. For example, if the actual timestamp is 100.6667 milliseconds, Amazon Rekognition Video returns a * value of 100 millis. */ public void setStartTimestampMillis(Long startTimestampMillis) { this.startTimestampMillis = startTimestampMillis; } /** *

* The start time of the detected segment in milliseconds from the start of the video. This value is rounded down. * For example, if the actual timestamp is 100.6667 milliseconds, Amazon Rekognition Video returns a value of 100 * millis. *

* * @return The start time of the detected segment in milliseconds from the start of the video. This value is rounded * down. For example, if the actual timestamp is 100.6667 milliseconds, Amazon Rekognition Video returns a * value of 100 millis. */ public Long getStartTimestampMillis() { return this.startTimestampMillis; } /** *

* The start time of the detected segment in milliseconds from the start of the video. This value is rounded down. * For example, if the actual timestamp is 100.6667 milliseconds, Amazon Rekognition Video returns a value of 100 * millis. *

* * @param startTimestampMillis * The start time of the detected segment in milliseconds from the start of the video. This value is rounded * down. For example, if the actual timestamp is 100.6667 milliseconds, Amazon Rekognition Video returns a * value of 100 millis. * @return Returns a reference to this object so that method calls can be chained together. */ public SegmentDetection withStartTimestampMillis(Long startTimestampMillis) { setStartTimestampMillis(startTimestampMillis); return this; } /** *

* The end time of the detected segment, in milliseconds, from the start of the video. This value is rounded down. *

* * @param endTimestampMillis * The end time of the detected segment, in milliseconds, from the start of the video. This value is rounded * down. */ public void setEndTimestampMillis(Long endTimestampMillis) { this.endTimestampMillis = endTimestampMillis; } /** *

* The end time of the detected segment, in milliseconds, from the start of the video. This value is rounded down. *

* * @return The end time of the detected segment, in milliseconds, from the start of the video. This value is rounded * down. */ public Long getEndTimestampMillis() { return this.endTimestampMillis; } /** *

* The end time of the detected segment, in milliseconds, from the start of the video. This value is rounded down. *

* * @param endTimestampMillis * The end time of the detected segment, in milliseconds, from the start of the video. This value is rounded * down. * @return Returns a reference to this object so that method calls can be chained together. */ public SegmentDetection withEndTimestampMillis(Long endTimestampMillis) { setEndTimestampMillis(endTimestampMillis); return this; } /** *

* The duration of the detected segment in milliseconds. *

* * @param durationMillis * The duration of the detected segment in milliseconds. */ public void setDurationMillis(Long durationMillis) { this.durationMillis = durationMillis; } /** *

* The duration of the detected segment in milliseconds. *

* * @return The duration of the detected segment in milliseconds. */ public Long getDurationMillis() { return this.durationMillis; } /** *

* The duration of the detected segment in milliseconds. *

* * @param durationMillis * The duration of the detected segment in milliseconds. * @return Returns a reference to this object so that method calls can be chained together. */ public SegmentDetection withDurationMillis(Long durationMillis) { setDurationMillis(durationMillis); return this; } /** *

* The frame-accurate SMPTE timecode, from the start of a video, for the start of a detected segment. * StartTimecode is in HH:MM:SS:fr format (and ;fr for drop frame-rates). *

* * @param startTimecodeSMPTE * The frame-accurate SMPTE timecode, from the start of a video, for the start of a detected segment. * StartTimecode is in HH:MM:SS:fr format (and ;fr for drop frame-rates). */ public void setStartTimecodeSMPTE(String startTimecodeSMPTE) { this.startTimecodeSMPTE = startTimecodeSMPTE; } /** *

* The frame-accurate SMPTE timecode, from the start of a video, for the start of a detected segment. * StartTimecode is in HH:MM:SS:fr format (and ;fr for drop frame-rates). *

* * @return The frame-accurate SMPTE timecode, from the start of a video, for the start of a detected segment. * StartTimecode is in HH:MM:SS:fr format (and ;fr for drop frame-rates). */ public String getStartTimecodeSMPTE() { return this.startTimecodeSMPTE; } /** *

* The frame-accurate SMPTE timecode, from the start of a video, for the start of a detected segment. * StartTimecode is in HH:MM:SS:fr format (and ;fr for drop frame-rates). *

* * @param startTimecodeSMPTE * The frame-accurate SMPTE timecode, from the start of a video, for the start of a detected segment. * StartTimecode is in HH:MM:SS:fr format (and ;fr for drop frame-rates). * @return Returns a reference to this object so that method calls can be chained together. */ public SegmentDetection withStartTimecodeSMPTE(String startTimecodeSMPTE) { setStartTimecodeSMPTE(startTimecodeSMPTE); return this; } /** *

* The frame-accurate SMPTE timecode, from the start of a video, for the end of a detected segment. * EndTimecode is in HH:MM:SS:fr format (and ;fr for drop frame-rates). *

* * @param endTimecodeSMPTE * The frame-accurate SMPTE timecode, from the start of a video, for the end of a detected segment. * EndTimecode is in HH:MM:SS:fr format (and ;fr for drop frame-rates). */ public void setEndTimecodeSMPTE(String endTimecodeSMPTE) { this.endTimecodeSMPTE = endTimecodeSMPTE; } /** *

* The frame-accurate SMPTE timecode, from the start of a video, for the end of a detected segment. * EndTimecode is in HH:MM:SS:fr format (and ;fr for drop frame-rates). *

* * @return The frame-accurate SMPTE timecode, from the start of a video, for the end of a detected segment. * EndTimecode is in HH:MM:SS:fr format (and ;fr for drop frame-rates). */ public String getEndTimecodeSMPTE() { return this.endTimecodeSMPTE; } /** *

* The frame-accurate SMPTE timecode, from the start of a video, for the end of a detected segment. * EndTimecode is in HH:MM:SS:fr format (and ;fr for drop frame-rates). *

* * @param endTimecodeSMPTE * The frame-accurate SMPTE timecode, from the start of a video, for the end of a detected segment. * EndTimecode is in HH:MM:SS:fr format (and ;fr for drop frame-rates). * @return Returns a reference to this object so that method calls can be chained together. */ public SegmentDetection withEndTimecodeSMPTE(String endTimecodeSMPTE) { setEndTimecodeSMPTE(endTimecodeSMPTE); return this; } /** *

* The duration of the timecode for the detected segment in SMPTE format. *

* * @param durationSMPTE * The duration of the timecode for the detected segment in SMPTE format. */ public void setDurationSMPTE(String durationSMPTE) { this.durationSMPTE = durationSMPTE; } /** *

* The duration of the timecode for the detected segment in SMPTE format. *

* * @return The duration of the timecode for the detected segment in SMPTE format. */ public String getDurationSMPTE() { return this.durationSMPTE; } /** *

* The duration of the timecode for the detected segment in SMPTE format. *

* * @param durationSMPTE * The duration of the timecode for the detected segment in SMPTE format. * @return Returns a reference to this object so that method calls can be chained together. */ public SegmentDetection withDurationSMPTE(String durationSMPTE) { setDurationSMPTE(durationSMPTE); return this; } /** *

* If the segment is a technical cue, contains information about the technical cue. *

* * @param technicalCueSegment * If the segment is a technical cue, contains information about the technical cue. */ public void setTechnicalCueSegment(TechnicalCueSegment technicalCueSegment) { this.technicalCueSegment = technicalCueSegment; } /** *

* If the segment is a technical cue, contains information about the technical cue. *

* * @return If the segment is a technical cue, contains information about the technical cue. */ public TechnicalCueSegment getTechnicalCueSegment() { return this.technicalCueSegment; } /** *

* If the segment is a technical cue, contains information about the technical cue. *

* * @param technicalCueSegment * If the segment is a technical cue, contains information about the technical cue. * @return Returns a reference to this object so that method calls can be chained together. */ public SegmentDetection withTechnicalCueSegment(TechnicalCueSegment technicalCueSegment) { setTechnicalCueSegment(technicalCueSegment); return this; } /** *

* If the segment is a shot detection, contains information about the shot detection. *

* * @param shotSegment * If the segment is a shot detection, contains information about the shot detection. */ public void setShotSegment(ShotSegment shotSegment) { this.shotSegment = shotSegment; } /** *

* If the segment is a shot detection, contains information about the shot detection. *

* * @return If the segment is a shot detection, contains information about the shot detection. */ public ShotSegment getShotSegment() { return this.shotSegment; } /** *

* If the segment is a shot detection, contains information about the shot detection. *

* * @param shotSegment * If the segment is a shot detection, contains information about the shot detection. * @return Returns a reference to this object so that method calls can be chained together. */ public SegmentDetection withShotSegment(ShotSegment shotSegment) { setShotSegment(shotSegment); return this; } /** *

* The frame number of the start of a video segment, using a frame index that starts with 0. *

* * @param startFrameNumber * The frame number of the start of a video segment, using a frame index that starts with 0. */ public void setStartFrameNumber(Long startFrameNumber) { this.startFrameNumber = startFrameNumber; } /** *

* The frame number of the start of a video segment, using a frame index that starts with 0. *

* * @return The frame number of the start of a video segment, using a frame index that starts with 0. */ public Long getStartFrameNumber() { return this.startFrameNumber; } /** *

* The frame number of the start of a video segment, using a frame index that starts with 0. *

* * @param startFrameNumber * The frame number of the start of a video segment, using a frame index that starts with 0. * @return Returns a reference to this object so that method calls can be chained together. */ public SegmentDetection withStartFrameNumber(Long startFrameNumber) { setStartFrameNumber(startFrameNumber); return this; } /** *

* The frame number at the end of a video segment, using a frame index that starts with 0. *

* * @param endFrameNumber * The frame number at the end of a video segment, using a frame index that starts with 0. */ public void setEndFrameNumber(Long endFrameNumber) { this.endFrameNumber = endFrameNumber; } /** *

* The frame number at the end of a video segment, using a frame index that starts with 0. *

* * @return The frame number at the end of a video segment, using a frame index that starts with 0. */ public Long getEndFrameNumber() { return this.endFrameNumber; } /** *

* The frame number at the end of a video segment, using a frame index that starts with 0. *

* * @param endFrameNumber * The frame number at the end of a video segment, using a frame index that starts with 0. * @return Returns a reference to this object so that method calls can be chained together. */ public SegmentDetection withEndFrameNumber(Long endFrameNumber) { setEndFrameNumber(endFrameNumber); return this; } /** *

* The duration of a video segment, expressed in frames. *

* * @param durationFrames * The duration of a video segment, expressed in frames. */ public void setDurationFrames(Long durationFrames) { this.durationFrames = durationFrames; } /** *

* The duration of a video segment, expressed in frames. *

* * @return The duration of a video segment, expressed in frames. */ public Long getDurationFrames() { return this.durationFrames; } /** *

* The duration of a video segment, expressed in frames. *

* * @param durationFrames * The duration of a video segment, expressed in frames. * @return Returns a reference to this object so that method calls can be chained together. */ public SegmentDetection withDurationFrames(Long durationFrames) { setDurationFrames(durationFrames); 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 (getType() != null) sb.append("Type: ").append(getType()).append(","); if (getStartTimestampMillis() != null) sb.append("StartTimestampMillis: ").append(getStartTimestampMillis()).append(","); if (getEndTimestampMillis() != null) sb.append("EndTimestampMillis: ").append(getEndTimestampMillis()).append(","); if (getDurationMillis() != null) sb.append("DurationMillis: ").append(getDurationMillis()).append(","); if (getStartTimecodeSMPTE() != null) sb.append("StartTimecodeSMPTE: ").append(getStartTimecodeSMPTE()).append(","); if (getEndTimecodeSMPTE() != null) sb.append("EndTimecodeSMPTE: ").append(getEndTimecodeSMPTE()).append(","); if (getDurationSMPTE() != null) sb.append("DurationSMPTE: ").append(getDurationSMPTE()).append(","); if (getTechnicalCueSegment() != null) sb.append("TechnicalCueSegment: ").append(getTechnicalCueSegment()).append(","); if (getShotSegment() != null) sb.append("ShotSegment: ").append(getShotSegment()).append(","); if (getStartFrameNumber() != null) sb.append("StartFrameNumber: ").append(getStartFrameNumber()).append(","); if (getEndFrameNumber() != null) sb.append("EndFrameNumber: ").append(getEndFrameNumber()).append(","); if (getDurationFrames() != null) sb.append("DurationFrames: ").append(getDurationFrames()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SegmentDetection == false) return false; SegmentDetection other = (SegmentDetection) obj; if (other.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == false) return false; if (other.getStartTimestampMillis() == null ^ this.getStartTimestampMillis() == null) return false; if (other.getStartTimestampMillis() != null && other.getStartTimestampMillis().equals(this.getStartTimestampMillis()) == false) return false; if (other.getEndTimestampMillis() == null ^ this.getEndTimestampMillis() == null) return false; if (other.getEndTimestampMillis() != null && other.getEndTimestampMillis().equals(this.getEndTimestampMillis()) == false) return false; if (other.getDurationMillis() == null ^ this.getDurationMillis() == null) return false; if (other.getDurationMillis() != null && other.getDurationMillis().equals(this.getDurationMillis()) == false) return false; if (other.getStartTimecodeSMPTE() == null ^ this.getStartTimecodeSMPTE() == null) return false; if (other.getStartTimecodeSMPTE() != null && other.getStartTimecodeSMPTE().equals(this.getStartTimecodeSMPTE()) == false) return false; if (other.getEndTimecodeSMPTE() == null ^ this.getEndTimecodeSMPTE() == null) return false; if (other.getEndTimecodeSMPTE() != null && other.getEndTimecodeSMPTE().equals(this.getEndTimecodeSMPTE()) == false) return false; if (other.getDurationSMPTE() == null ^ this.getDurationSMPTE() == null) return false; if (other.getDurationSMPTE() != null && other.getDurationSMPTE().equals(this.getDurationSMPTE()) == false) return false; if (other.getTechnicalCueSegment() == null ^ this.getTechnicalCueSegment() == null) return false; if (other.getTechnicalCueSegment() != null && other.getTechnicalCueSegment().equals(this.getTechnicalCueSegment()) == false) return false; if (other.getShotSegment() == null ^ this.getShotSegment() == null) return false; if (other.getShotSegment() != null && other.getShotSegment().equals(this.getShotSegment()) == false) return false; if (other.getStartFrameNumber() == null ^ this.getStartFrameNumber() == null) return false; if (other.getStartFrameNumber() != null && other.getStartFrameNumber().equals(this.getStartFrameNumber()) == false) return false; if (other.getEndFrameNumber() == null ^ this.getEndFrameNumber() == null) return false; if (other.getEndFrameNumber() != null && other.getEndFrameNumber().equals(this.getEndFrameNumber()) == false) return false; if (other.getDurationFrames() == null ^ this.getDurationFrames() == null) return false; if (other.getDurationFrames() != null && other.getDurationFrames().equals(this.getDurationFrames()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); hashCode = prime * hashCode + ((getStartTimestampMillis() == null) ? 0 : getStartTimestampMillis().hashCode()); hashCode = prime * hashCode + ((getEndTimestampMillis() == null) ? 0 : getEndTimestampMillis().hashCode()); hashCode = prime * hashCode + ((getDurationMillis() == null) ? 0 : getDurationMillis().hashCode()); hashCode = prime * hashCode + ((getStartTimecodeSMPTE() == null) ? 0 : getStartTimecodeSMPTE().hashCode()); hashCode = prime * hashCode + ((getEndTimecodeSMPTE() == null) ? 0 : getEndTimecodeSMPTE().hashCode()); hashCode = prime * hashCode + ((getDurationSMPTE() == null) ? 0 : getDurationSMPTE().hashCode()); hashCode = prime * hashCode + ((getTechnicalCueSegment() == null) ? 0 : getTechnicalCueSegment().hashCode()); hashCode = prime * hashCode + ((getShotSegment() == null) ? 0 : getShotSegment().hashCode()); hashCode = prime * hashCode + ((getStartFrameNumber() == null) ? 0 : getStartFrameNumber().hashCode()); hashCode = prime * hashCode + ((getEndFrameNumber() == null) ? 0 : getEndFrameNumber().hashCode()); hashCode = prime * hashCode + ((getDurationFrames() == null) ? 0 : getDurationFrames().hashCode()); return hashCode; } @Override public SegmentDetection clone() { try { return (SegmentDetection) 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.rekognition.model.transform.SegmentDetectionMarshaller.getInstance().marshall(this, protocolMarshaller); } }