/* * 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 a video that Amazon Rekognition analyzed.
* Videometadata
is returned in every page of paginated responses
* from a Amazon Rekognition video operation.
*
* Type of compression used in the analyzed video. *
*/ private String codec; /** ** Length of the video in milliseconds. *
*
* Constraints:
* Range: 0 -
*/
private Long durationMillis;
/**
*
* Format of the analyzed video. Possible values are MP4, MOV and AVI. *
*/ private String format; /** ** Number of frames per second in the video. *
*/ private Float frameRate; /** ** Vertical pixel dimension of the video. *
*
* Constraints:
* Range: 0 -
*/
private Long frameHeight;
/**
*
* Horizontal pixel dimension of the video. *
*
* Constraints:
* Range: 0 -
*/
private Long frameWidth;
/**
*
* A description of the range of luminance values in a video, either LIMITED * (16 to 235) or FULL (0 to 255). *
*
* Constraints:
* Allowed Values: FULL, LIMITED
*/
private String colorRange;
/**
*
* Type of compression used in the analyzed video. *
* * @return* Type of compression used in the analyzed video. *
*/ public String getCodec() { return codec; } /** ** Type of compression used in the analyzed video. *
* * @param codec* Type of compression used in the analyzed video. *
*/ public void setCodec(String codec) { this.codec = codec; } /** ** Type of compression used in the analyzed video. *
** Returns a reference to this object so that method calls can be chained * together. * * @param codec
* Type of compression used in the analyzed video. *
* @return A reference to this updated object so that method calls can be * chained together. */ public VideoMetadata withCodec(String codec) { this.codec = codec; return this; } /** ** Length of the video in milliseconds. *
*
* Constraints:
* Range: 0 -
*
* @return
* Length of the video in milliseconds. *
*/ public Long getDurationMillis() { return durationMillis; } /** ** Length of the video in milliseconds. *
*
* Constraints:
* Range: 0 -
*
* @param durationMillis
* Length of the video in milliseconds. *
*/ public void setDurationMillis(Long durationMillis) { this.durationMillis = durationMillis; } /** ** Length of the video in milliseconds. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Range: 0 -
*
* @param durationMillis
* Length of the video in milliseconds. *
* @return A reference to this updated object so that method calls can be * chained together. */ public VideoMetadata withDurationMillis(Long durationMillis) { this.durationMillis = durationMillis; return this; } /** ** Format of the analyzed video. Possible values are MP4, MOV and AVI. *
* * @return* Format of the analyzed video. Possible values are MP4, MOV and * AVI. *
*/ public String getFormat() { return format; } /** ** Format of the analyzed video. Possible values are MP4, MOV and AVI. *
* * @param format* Format of the analyzed video. Possible values are MP4, MOV and * AVI. *
*/ public void setFormat(String format) { this.format = format; } /** ** Format of the analyzed video. Possible values are MP4, MOV and AVI. *
** Returns a reference to this object so that method calls can be chained * together. * * @param format
* Format of the analyzed video. Possible values are MP4, MOV and * AVI. *
* @return A reference to this updated object so that method calls can be * chained together. */ public VideoMetadata withFormat(String format) { this.format = format; return this; } /** ** Number of frames per second in the video. *
* * @return* Number of frames per second in the video. *
*/ public Float getFrameRate() { return frameRate; } /** ** Number of frames per second in the video. *
* * @param frameRate* Number of frames per second in the video. *
*/ public void setFrameRate(Float frameRate) { this.frameRate = frameRate; } /** ** Number of frames per second in the video. *
** Returns a reference to this object so that method calls can be chained * together. * * @param frameRate
* Number of frames per second in the video. *
* @return A reference to this updated object so that method calls can be * chained together. */ public VideoMetadata withFrameRate(Float frameRate) { this.frameRate = frameRate; return this; } /** ** Vertical pixel dimension of the video. *
*
* Constraints:
* Range: 0 -
*
* @return
* Vertical pixel dimension of the video. *
*/ public Long getFrameHeight() { return frameHeight; } /** ** Vertical pixel dimension of the video. *
*
* Constraints:
* Range: 0 -
*
* @param frameHeight
* Vertical pixel dimension of the video. *
*/ public void setFrameHeight(Long frameHeight) { this.frameHeight = frameHeight; } /** ** Vertical pixel dimension of the video. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Range: 0 -
*
* @param frameHeight
* Vertical pixel dimension of the video. *
* @return A reference to this updated object so that method calls can be * chained together. */ public VideoMetadata withFrameHeight(Long frameHeight) { this.frameHeight = frameHeight; return this; } /** ** Horizontal pixel dimension of the video. *
*
* Constraints:
* Range: 0 -
*
* @return
* Horizontal pixel dimension of the video. *
*/ public Long getFrameWidth() { return frameWidth; } /** ** Horizontal pixel dimension of the video. *
*
* Constraints:
* Range: 0 -
*
* @param frameWidth
* Horizontal pixel dimension of the video. *
*/ public void setFrameWidth(Long frameWidth) { this.frameWidth = frameWidth; } /** ** Horizontal pixel dimension of the video. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Range: 0 -
*
* @param frameWidth
* Horizontal pixel dimension of the video. *
* @return A reference to this updated object so that method calls can be * chained together. */ public VideoMetadata withFrameWidth(Long frameWidth) { this.frameWidth = frameWidth; return this; } /** ** A description of the range of luminance values in a video, either LIMITED * (16 to 235) or FULL (0 to 255). *
*
* Constraints:
* Allowed Values: FULL, LIMITED
*
* @return
* A description of the range of luminance values in a video, either * LIMITED (16 to 235) or FULL (0 to 255). *
* @see VideoColorRange */ public String getColorRange() { return colorRange; } /** ** A description of the range of luminance values in a video, either LIMITED * (16 to 235) or FULL (0 to 255). *
*
* Constraints:
* Allowed Values: FULL, LIMITED
*
* @param colorRange
* A description of the range of luminance values in a video, * either LIMITED (16 to 235) or FULL (0 to 255). *
* @see VideoColorRange */ public void setColorRange(String colorRange) { this.colorRange = colorRange; } /** ** A description of the range of luminance values in a video, either LIMITED * (16 to 235) or FULL (0 to 255). *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: FULL, LIMITED
*
* @param colorRange
* A description of the range of luminance values in a video, * either LIMITED (16 to 235) or FULL (0 to 255). *
* @return A reference to this updated object so that method calls can be * chained together. * @see VideoColorRange */ public VideoMetadata withColorRange(String colorRange) { this.colorRange = colorRange; return this; } /** ** A description of the range of luminance values in a video, either LIMITED * (16 to 235) or FULL (0 to 255). *
*
* Constraints:
* Allowed Values: FULL, LIMITED
*
* @param colorRange
* A description of the range of luminance values in a video, * either LIMITED (16 to 235) or FULL (0 to 255). *
* @see VideoColorRange */ public void setColorRange(VideoColorRange colorRange) { this.colorRange = colorRange.toString(); } /** ** A description of the range of luminance values in a video, either LIMITED * (16 to 235) or FULL (0 to 255). *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: FULL, LIMITED
*
* @param colorRange
* A description of the range of luminance values in a video, * either LIMITED (16 to 235) or FULL (0 to 255). *
* @return A reference to this updated object so that method calls can be * chained together. * @see VideoColorRange */ public VideoMetadata withColorRange(VideoColorRange colorRange) { this.colorRange = colorRange.toString(); 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 (getCodec() != null) sb.append("Codec: " + getCodec() + ","); if (getDurationMillis() != null) sb.append("DurationMillis: " + getDurationMillis() + ","); if (getFormat() != null) sb.append("Format: " + getFormat() + ","); if (getFrameRate() != null) sb.append("FrameRate: " + getFrameRate() + ","); if (getFrameHeight() != null) sb.append("FrameHeight: " + getFrameHeight() + ","); if (getFrameWidth() != null) sb.append("FrameWidth: " + getFrameWidth() + ","); if (getColorRange() != null) sb.append("ColorRange: " + getColorRange()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getCodec() == null) ? 0 : getCodec().hashCode()); hashCode = prime * hashCode + ((getDurationMillis() == null) ? 0 : getDurationMillis().hashCode()); hashCode = prime * hashCode + ((getFormat() == null) ? 0 : getFormat().hashCode()); hashCode = prime * hashCode + ((getFrameRate() == null) ? 0 : getFrameRate().hashCode()); hashCode = prime * hashCode + ((getFrameHeight() == null) ? 0 : getFrameHeight().hashCode()); hashCode = prime * hashCode + ((getFrameWidth() == null) ? 0 : getFrameWidth().hashCode()); hashCode = prime * hashCode + ((getColorRange() == null) ? 0 : getColorRange().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof VideoMetadata == false) return false; VideoMetadata other = (VideoMetadata) obj; if (other.getCodec() == null ^ this.getCodec() == null) return false; if (other.getCodec() != null && other.getCodec().equals(this.getCodec()) == 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.getFormat() == null ^ this.getFormat() == null) return false; if (other.getFormat() != null && other.getFormat().equals(this.getFormat()) == false) return false; if (other.getFrameRate() == null ^ this.getFrameRate() == null) return false; if (other.getFrameRate() != null && other.getFrameRate().equals(this.getFrameRate()) == false) return false; if (other.getFrameHeight() == null ^ this.getFrameHeight() == null) return false; if (other.getFrameHeight() != null && other.getFrameHeight().equals(this.getFrameHeight()) == false) return false; if (other.getFrameWidth() == null ^ this.getFrameWidth() == null) return false; if (other.getFrameWidth() != null && other.getFrameWidth().equals(this.getFrameWidth()) == false) return false; if (other.getColorRange() == null ^ this.getColorRange() == null) return false; if (other.getColorRange() != null && other.getColorRange().equals(this.getColorRange()) == false) return false; return true; } }