
com.amazonaws.services.rekognition.model.VideoMetadata Maven / Gradle / Ivy
/*
* 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.rekognition.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Information about a video that Amazon Rekognition analyzed. Videometadata
is returned in every page of
* paginated responses from a Amazon Rekognition video operation.
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class VideoMetadata implements Serializable, Cloneable, StructuredPojo {
/**
*
* Type of compression used in the analyzed video.
*
*/
private String codec;
/**
*
* Length of the video in milliseconds.
*
*/
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.
*
*/
private Long frameHeight;
/**
*
* Horizontal pixel dimension of the video.
*
*/
private Long frameWidth;
/**
*
* A description of the range of luminance values in a video, either LIMITED (16 to 235) or FULL (0 to 255).
*
*/
private String colorRange;
/**
*
* 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.
*
*
* @return Type of compression used in the analyzed video.
*/
public String getCodec() {
return this.codec;
}
/**
*
* Type of compression used in the analyzed video.
*
*
* @param codec
* Type of compression used in the analyzed video.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VideoMetadata withCodec(String codec) {
setCodec(codec);
return this;
}
/**
*
* Length of the video in milliseconds.
*
*
* @param durationMillis
* Length of the video in milliseconds.
*/
public void setDurationMillis(Long durationMillis) {
this.durationMillis = durationMillis;
}
/**
*
* Length of the video in milliseconds.
*
*
* @return Length of the video in milliseconds.
*/
public Long getDurationMillis() {
return this.durationMillis;
}
/**
*
* Length of the video in milliseconds.
*
*
* @param durationMillis
* Length of the video in milliseconds.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VideoMetadata withDurationMillis(Long durationMillis) {
setDurationMillis(durationMillis);
return this;
}
/**
*
* 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.
*
*
* @return Format of the analyzed video. Possible values are MP4, MOV and AVI.
*/
public String getFormat() {
return this.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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VideoMetadata withFormat(String format) {
setFormat(format);
return this;
}
/**
*
* 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.
*
*
* @return Number of frames per second in the video.
*/
public Float getFrameRate() {
return this.frameRate;
}
/**
*
* Number of frames per second in the video.
*
*
* @param frameRate
* Number of frames per second in the video.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VideoMetadata withFrameRate(Float frameRate) {
setFrameRate(frameRate);
return this;
}
/**
*
* Vertical pixel dimension of the video.
*
*
* @param frameHeight
* Vertical pixel dimension of the video.
*/
public void setFrameHeight(Long frameHeight) {
this.frameHeight = frameHeight;
}
/**
*
* Vertical pixel dimension of the video.
*
*
* @return Vertical pixel dimension of the video.
*/
public Long getFrameHeight() {
return this.frameHeight;
}
/**
*
* Vertical pixel dimension of the video.
*
*
* @param frameHeight
* Vertical pixel dimension of the video.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VideoMetadata withFrameHeight(Long frameHeight) {
setFrameHeight(frameHeight);
return this;
}
/**
*
* Horizontal pixel dimension of the video.
*
*
* @param frameWidth
* Horizontal pixel dimension of the video.
*/
public void setFrameWidth(Long frameWidth) {
this.frameWidth = frameWidth;
}
/**
*
* Horizontal pixel dimension of the video.
*
*
* @return Horizontal pixel dimension of the video.
*/
public Long getFrameWidth() {
return this.frameWidth;
}
/**
*
* Horizontal pixel dimension of the video.
*
*
* @param frameWidth
* Horizontal pixel dimension of the video.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VideoMetadata withFrameWidth(Long frameWidth) {
setFrameWidth(frameWidth);
return this;
}
/**
*
* A description of the range of luminance values in a video, either LIMITED (16 to 235) or FULL (0 to 255).
*
*
* @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).
*
*
* @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 this.colorRange;
}
/**
*
* A description of the range of luminance values in a video, either LIMITED (16 to 235) or FULL (0 to 255).
*
*
* @param colorRange
* A description of the range of luminance values in a video, either LIMITED (16 to 235) or FULL (0 to 255).
* @return Returns a reference to this object so that method calls can be chained together.
* @see VideoColorRange
*/
public VideoMetadata withColorRange(String colorRange) {
setColorRange(colorRange);
return this;
}
/**
*
* A description of the range of luminance values in a video, either LIMITED (16 to 235) or FULL (0 to 255).
*
*
* @param colorRange
* A description of the range of luminance values in a video, either LIMITED (16 to 235) or FULL (0 to 255).
* @return Returns a reference to this 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. 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 (getCodec() != null)
sb.append("Codec: ").append(getCodec()).append(",");
if (getDurationMillis() != null)
sb.append("DurationMillis: ").append(getDurationMillis()).append(",");
if (getFormat() != null)
sb.append("Format: ").append(getFormat()).append(",");
if (getFrameRate() != null)
sb.append("FrameRate: ").append(getFrameRate()).append(",");
if (getFrameHeight() != null)
sb.append("FrameHeight: ").append(getFrameHeight()).append(",");
if (getFrameWidth() != null)
sb.append("FrameWidth: ").append(getFrameWidth()).append(",");
if (getColorRange() != null)
sb.append("ColorRange: ").append(getColorRange());
sb.append("}");
return sb.toString();
}
@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;
}
@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 VideoMetadata clone() {
try {
return (VideoMetadata) 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.VideoMetadataMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}