/* * 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; /** *
* Contains metadata about a label detection request, including the SortBy and * AggregateBy options. *
*/ public class GetLabelDetectionRequestMetadata implements Serializable { /** ** The sorting method chosen for a GetLabelDetection request. *
*
* Constraints:
* Allowed Values: NAME, TIMESTAMP
*/
private String sortBy;
/**
*
* The aggregation method chosen for a GetLabelDetection request. *
*
* Constraints:
* Allowed Values: TIMESTAMPS, SEGMENTS
*/
private String aggregateBy;
/**
*
* The sorting method chosen for a GetLabelDetection request. *
*
* Constraints:
* Allowed Values: NAME, TIMESTAMP
*
* @return
* The sorting method chosen for a GetLabelDetection request. *
* @see LabelDetectionSortBy */ public String getSortBy() { return sortBy; } /** ** The sorting method chosen for a GetLabelDetection request. *
*
* Constraints:
* Allowed Values: NAME, TIMESTAMP
*
* @param sortBy
* The sorting method chosen for a GetLabelDetection request. *
* @see LabelDetectionSortBy */ public void setSortBy(String sortBy) { this.sortBy = sortBy; } /** ** The sorting method chosen for a GetLabelDetection request. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: NAME, TIMESTAMP
*
* @param sortBy
* The sorting method chosen for a GetLabelDetection request. *
* @return A reference to this updated object so that method calls can be * chained together. * @see LabelDetectionSortBy */ public GetLabelDetectionRequestMetadata withSortBy(String sortBy) { this.sortBy = sortBy; return this; } /** ** The sorting method chosen for a GetLabelDetection request. *
*
* Constraints:
* Allowed Values: NAME, TIMESTAMP
*
* @param sortBy
* The sorting method chosen for a GetLabelDetection request. *
* @see LabelDetectionSortBy */ public void setSortBy(LabelDetectionSortBy sortBy) { this.sortBy = sortBy.toString(); } /** ** The sorting method chosen for a GetLabelDetection request. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: NAME, TIMESTAMP
*
* @param sortBy
* The sorting method chosen for a GetLabelDetection request. *
* @return A reference to this updated object so that method calls can be * chained together. * @see LabelDetectionSortBy */ public GetLabelDetectionRequestMetadata withSortBy(LabelDetectionSortBy sortBy) { this.sortBy = sortBy.toString(); return this; } /** ** The aggregation method chosen for a GetLabelDetection request. *
*
* Constraints:
* Allowed Values: TIMESTAMPS, SEGMENTS
*
* @return
* The aggregation method chosen for a GetLabelDetection request. *
* @see LabelDetectionAggregateBy */ public String getAggregateBy() { return aggregateBy; } /** ** The aggregation method chosen for a GetLabelDetection request. *
*
* Constraints:
* Allowed Values: TIMESTAMPS, SEGMENTS
*
* @param aggregateBy
* The aggregation method chosen for a GetLabelDetection request. *
* @see LabelDetectionAggregateBy */ public void setAggregateBy(String aggregateBy) { this.aggregateBy = aggregateBy; } /** ** The aggregation method chosen for a GetLabelDetection request. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: TIMESTAMPS, SEGMENTS
*
* @param aggregateBy
* The aggregation method chosen for a GetLabelDetection request. *
* @return A reference to this updated object so that method calls can be * chained together. * @see LabelDetectionAggregateBy */ public GetLabelDetectionRequestMetadata withAggregateBy(String aggregateBy) { this.aggregateBy = aggregateBy; return this; } /** ** The aggregation method chosen for a GetLabelDetection request. *
*
* Constraints:
* Allowed Values: TIMESTAMPS, SEGMENTS
*
* @param aggregateBy
* The aggregation method chosen for a GetLabelDetection request. *
* @see LabelDetectionAggregateBy */ public void setAggregateBy(LabelDetectionAggregateBy aggregateBy) { this.aggregateBy = aggregateBy.toString(); } /** ** The aggregation method chosen for a GetLabelDetection request. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: TIMESTAMPS, SEGMENTS
*
* @param aggregateBy
* The aggregation method chosen for a GetLabelDetection request. *
* @return A reference to this updated object so that method calls can be * chained together. * @see LabelDetectionAggregateBy */ public GetLabelDetectionRequestMetadata withAggregateBy(LabelDetectionAggregateBy aggregateBy) { this.aggregateBy = aggregateBy.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 (getSortBy() != null) sb.append("SortBy: " + getSortBy() + ","); if (getAggregateBy() != null) sb.append("AggregateBy: " + getAggregateBy()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSortBy() == null) ? 0 : getSortBy().hashCode()); hashCode = prime * hashCode + ((getAggregateBy() == null) ? 0 : getAggregateBy().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetLabelDetectionRequestMetadata == false) return false; GetLabelDetectionRequestMetadata other = (GetLabelDetectionRequestMetadata) obj; if (other.getSortBy() == null ^ this.getSortBy() == null) return false; if (other.getSortBy() != null && other.getSortBy().equals(this.getSortBy()) == false) return false; if (other.getAggregateBy() == null ^ this.getAggregateBy() == null) return false; if (other.getAggregateBy() != null && other.getAggregateBy().equals(this.getAggregateBy()) == false) return false; return true; } }