/* * 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; /** *
* Information about an inappropriate, unwanted, or offensive content label * detection in a stored video. *
*/ public class ContentModerationDetection implements Serializable { /** *
* Time, in milliseconds from the beginning of the video, that the content
* moderation label was detected. Note that Timestamp
is not
* guaranteed to be accurate to the individual frame where the moderated
* content first appears.
*
* The content moderation label detected by in the stored video. *
*/ private ModerationLabel moderationLabel; /** ** The time in milliseconds defining the start of the timeline segment * containing a continuously detected moderation label. *
*
* Constraints:
* Range: 0 -
*/
private Long startTimestampMillis;
/**
*
* The time in milliseconds defining the end of the timeline segment * containing a continuously detected moderation label. *
*
* Constraints:
* Range: 0 -
*/
private Long endTimestampMillis;
/**
*
* The time duration of a segment in milliseconds, I.e. time elapsed from * StartTimestampMillis to EndTimestampMillis. *
*
* Constraints:
* Range: 0 -
*/
private Long durationMillis;
/**
*
* Time, in milliseconds from the beginning of the video, that the content
* moderation label was detected. Note that Timestamp
is not
* guaranteed to be accurate to the individual frame where the moderated
* content first appears.
*
* Time, in milliseconds from the beginning of the video, that the
* content moderation label was detected. Note that
* Timestamp
is not guaranteed to be accurate to the
* individual frame where the moderated content first appears.
*
* Time, in milliseconds from the beginning of the video, that the content
* moderation label was detected. Note that Timestamp
is not
* guaranteed to be accurate to the individual frame where the moderated
* content first appears.
*
* Time, in milliseconds from the beginning of the video, that
* the content moderation label was detected. Note that
* Timestamp
is not guaranteed to be accurate to the
* individual frame where the moderated content first appears.
*
* Time, in milliseconds from the beginning of the video, that the content
* moderation label was detected. Note that Timestamp
is not
* guaranteed to be accurate to the individual frame where the moderated
* content first appears.
*
* Returns a reference to this object so that method calls can be chained * together. * * @param timestamp
* Time, in milliseconds from the beginning of the video, that
* the content moderation label was detected. Note that
* Timestamp
is not guaranteed to be accurate to the
* individual frame where the moderated content first appears.
*
* The content moderation label detected by in the stored video. *
* * @return* The content moderation label detected by in the stored video. *
*/ public ModerationLabel getModerationLabel() { return moderationLabel; } /** ** The content moderation label detected by in the stored video. *
* * @param moderationLabel* The content moderation label detected by in the stored video. *
*/ public void setModerationLabel(ModerationLabel moderationLabel) { this.moderationLabel = moderationLabel; } /** ** The content moderation label detected by in the stored video. *
** Returns a reference to this object so that method calls can be chained * together. * * @param moderationLabel
* The content moderation label detected by in the stored video. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ContentModerationDetection withModerationLabel(ModerationLabel moderationLabel) { this.moderationLabel = moderationLabel; return this; } /** ** The time in milliseconds defining the start of the timeline segment * containing a continuously detected moderation label. *
*
* Constraints:
* Range: 0 -
*
* @return
* The time in milliseconds defining the start of the timeline * segment containing a continuously detected moderation label. *
*/ public Long getStartTimestampMillis() { return startTimestampMillis; } /** ** The time in milliseconds defining the start of the timeline segment * containing a continuously detected moderation label. *
*
* Constraints:
* Range: 0 -
*
* @param startTimestampMillis
* The time in milliseconds defining the start of the timeline * segment containing a continuously detected moderation label. *
*/ public void setStartTimestampMillis(Long startTimestampMillis) { this.startTimestampMillis = startTimestampMillis; } /** ** The time in milliseconds defining the start of the timeline segment * containing a continuously detected moderation label. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Range: 0 -
*
* @param startTimestampMillis
* The time in milliseconds defining the start of the timeline * segment containing a continuously detected moderation label. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ContentModerationDetection withStartTimestampMillis(Long startTimestampMillis) { this.startTimestampMillis = startTimestampMillis; return this; } /** ** The time in milliseconds defining the end of the timeline segment * containing a continuously detected moderation label. *
*
* Constraints:
* Range: 0 -
*
* @return
* The time in milliseconds defining the end of the timeline segment * containing a continuously detected moderation label. *
*/ public Long getEndTimestampMillis() { return endTimestampMillis; } /** ** The time in milliseconds defining the end of the timeline segment * containing a continuously detected moderation label. *
*
* Constraints:
* Range: 0 -
*
* @param endTimestampMillis
* The time in milliseconds defining the end of the timeline * segment containing a continuously detected moderation label. *
*/ public void setEndTimestampMillis(Long endTimestampMillis) { this.endTimestampMillis = endTimestampMillis; } /** ** The time in milliseconds defining the end of the timeline segment * containing a continuously detected moderation label. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Range: 0 -
*
* @param endTimestampMillis
* The time in milliseconds defining the end of the timeline * segment containing a continuously detected moderation label. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ContentModerationDetection withEndTimestampMillis(Long endTimestampMillis) { this.endTimestampMillis = endTimestampMillis; return this; } /** ** The time duration of a segment in milliseconds, I.e. time elapsed from * StartTimestampMillis to EndTimestampMillis. *
*
* Constraints:
* Range: 0 -
*
* @return
* The time duration of a segment in milliseconds, I.e. time elapsed * from StartTimestampMillis to EndTimestampMillis. *
*/ public Long getDurationMillis() { return durationMillis; } /** ** The time duration of a segment in milliseconds, I.e. time elapsed from * StartTimestampMillis to EndTimestampMillis. *
*
* Constraints:
* Range: 0 -
*
* @param durationMillis
* The time duration of a segment in milliseconds, I.e. time * elapsed from StartTimestampMillis to EndTimestampMillis. *
*/ public void setDurationMillis(Long durationMillis) { this.durationMillis = durationMillis; } /** ** The time duration of a segment in milliseconds, I.e. time elapsed from * StartTimestampMillis to EndTimestampMillis. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Range: 0 -
*
* @param durationMillis
* The time duration of a segment in milliseconds, I.e. time * elapsed from StartTimestampMillis to EndTimestampMillis. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ContentModerationDetection withDurationMillis(Long durationMillis) { this.durationMillis = durationMillis; 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 (getTimestamp() != null) sb.append("Timestamp: " + getTimestamp() + ","); if (getModerationLabel() != null) sb.append("ModerationLabel: " + getModerationLabel() + ","); if (getStartTimestampMillis() != null) sb.append("StartTimestampMillis: " + getStartTimestampMillis() + ","); if (getEndTimestampMillis() != null) sb.append("EndTimestampMillis: " + getEndTimestampMillis() + ","); if (getDurationMillis() != null) sb.append("DurationMillis: " + getDurationMillis()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode()); hashCode = prime * hashCode + ((getModerationLabel() == null) ? 0 : getModerationLabel().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()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ContentModerationDetection == false) return false; ContentModerationDetection other = (ContentModerationDetection) obj; if (other.getTimestamp() == null ^ this.getTimestamp() == null) return false; if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == false) return false; if (other.getModerationLabel() == null ^ this.getModerationLabel() == null) return false; if (other.getModerationLabel() != null && other.getModerationLabel().equals(this.getModerationLabel()) == 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; return true; } }