/* * Copyright 2010-2022 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.kinesisvideoarchivedmedia.model; import java.io.Serializable; /** *

* A structure that contains the Timestamp, Error, and * ImageContent. *

*/ public class Image implements Serializable { /** *

* An attribute of the Image object that is used to extract an * image from the video stream. This field is used to manage gaps on images * or to better understand the pagination window. *

*/ private java.util.Date timeStamp; /** *

* The error message shown when the image for the provided timestamp was not * extracted due to a non-tryable error. An error will be returned if: *

* * *

* Constraints:
* Allowed Values: NO_MEDIA, MEDIA_ERROR */ private String error; /** *

* An attribute of the Image object that is Base64 encoded. *

*

* Constraints:
* Length: 1 - 6291456
*/ private String imageContent; /** *

* An attribute of the Image object that is used to extract an * image from the video stream. This field is used to manage gaps on images * or to better understand the pagination window. *

* * @return

* An attribute of the Image object that is used to * extract an image from the video stream. This field is used to * manage gaps on images or to better understand the pagination * window. *

*/ public java.util.Date getTimeStamp() { return timeStamp; } /** *

* An attribute of the Image object that is used to extract an * image from the video stream. This field is used to manage gaps on images * or to better understand the pagination window. *

* * @param timeStamp

* An attribute of the Image object that is used to * extract an image from the video stream. This field is used to * manage gaps on images or to better understand the pagination * window. *

*/ public void setTimeStamp(java.util.Date timeStamp) { this.timeStamp = timeStamp; } /** *

* An attribute of the Image object that is used to extract an * image from the video stream. This field is used to manage gaps on images * or to better understand the pagination window. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param timeStamp

* An attribute of the Image object that is used to * extract an image from the video stream. This field is used to * manage gaps on images or to better understand the pagination * window. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Image withTimeStamp(java.util.Date timeStamp) { this.timeStamp = timeStamp; return this; } /** *

* The error message shown when the image for the provided timestamp was not * extracted due to a non-tryable error. An error will be returned if: *

* * *

* Constraints:
* Allowed Values: NO_MEDIA, MEDIA_ERROR * * @return

* The error message shown when the image for the provided timestamp * was not extracted due to a non-tryable error. An error will be * returned if: *

* * * @see ImageError */ public String getError() { return error; } /** *

* The error message shown when the image for the provided timestamp was not * extracted due to a non-tryable error. An error will be returned if: *

* * *

* Constraints:
* Allowed Values: NO_MEDIA, MEDIA_ERROR * * @param error

* The error message shown when the image for the provided * timestamp was not extracted due to a non-tryable error. An * error will be returned if: *

* * * @see ImageError */ public void setError(String error) { this.error = error; } /** *

* The error message shown when the image for the provided timestamp was not * extracted due to a non-tryable error. An error will be returned if: *

* * *

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: NO_MEDIA, MEDIA_ERROR * * @param error

* The error message shown when the image for the provided * timestamp was not extracted due to a non-tryable error. An * error will be returned if: *

* * * @return A reference to this updated object so that method calls can be * chained together. * @see ImageError */ public Image withError(String error) { this.error = error; return this; } /** *

* The error message shown when the image for the provided timestamp was not * extracted due to a non-tryable error. An error will be returned if: *

* * *

* Constraints:
* Allowed Values: NO_MEDIA, MEDIA_ERROR * * @param error

* The error message shown when the image for the provided * timestamp was not extracted due to a non-tryable error. An * error will be returned if: *

* * * @see ImageError */ public void setError(ImageError error) { this.error = error.toString(); } /** *

* The error message shown when the image for the provided timestamp was not * extracted due to a non-tryable error. An error will be returned if: *

* * *

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: NO_MEDIA, MEDIA_ERROR * * @param error

* The error message shown when the image for the provided * timestamp was not extracted due to a non-tryable error. An * error will be returned if: *

* * * @return A reference to this updated object so that method calls can be * chained together. * @see ImageError */ public Image withError(ImageError error) { this.error = error.toString(); return this; } /** *

* An attribute of the Image object that is Base64 encoded. *

*

* Constraints:
* Length: 1 - 6291456
* * @return

* An attribute of the Image object that is Base64 * encoded. *

*/ public String getImageContent() { return imageContent; } /** *

* An attribute of the Image object that is Base64 encoded. *

*

* Constraints:
* Length: 1 - 6291456
* * @param imageContent

* An attribute of the Image object that is Base64 * encoded. *

*/ public void setImageContent(String imageContent) { this.imageContent = imageContent; } /** *

* An attribute of the Image object that is Base64 encoded. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 6291456
* * @param imageContent

* An attribute of the Image object that is Base64 * encoded. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Image withImageContent(String imageContent) { this.imageContent = imageContent; 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 (getError() != null) sb.append("Error: " + getError() + ","); if (getImageContent() != null) sb.append("ImageContent: " + getImageContent()); 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 + ((getError() == null) ? 0 : getError().hashCode()); hashCode = prime * hashCode + ((getImageContent() == null) ? 0 : getImageContent().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Image == false) return false; Image other = (Image) obj; if (other.getTimeStamp() == null ^ this.getTimeStamp() == null) return false; if (other.getTimeStamp() != null && other.getTimeStamp().equals(this.getTimeStamp()) == false) return false; if (other.getError() == null ^ this.getError() == null) return false; if (other.getError() != null && other.getError().equals(this.getError()) == false) return false; if (other.getImageContent() == null ^ this.getImageContent() == null) return false; if (other.getImageContent() != null && other.getImageContent().equals(this.getImageContent()) == false) return false; return true; } }