/* * 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.connect.model; import java.io.Serializable; /** *

* The search criteria to be used to return queues. *

* *

* The name and description fields support "contains" * queries with a minimum of 2 characters and a maximum of 25 characters. Any * queries with character lengths outside of this range will throw invalid * results. *

*
*/ public class QueueSearchCriteria implements Serializable { /** *

* A list of conditions which would be applied together with an OR * condition. *

*/ private java.util.List orConditions; /** *

* A list of conditions which would be applied together with an AND * condition. *

*/ private java.util.List andConditions; /** *

* A leaf node condition which can be used to specify a string condition. *

* *

* The currently supported values for FieldName are * name, description, and resourceID. *

*
*/ private StringCondition stringCondition; /** *

* The type of queue. *

*

* Constraints:
* Allowed Values: STANDARD */ private String queueTypeCondition; /** *

* A list of conditions which would be applied together with an OR * condition. *

* * @return

* A list of conditions which would be applied together with an OR * condition. *

*/ public java.util.List getOrConditions() { return orConditions; } /** *

* A list of conditions which would be applied together with an OR * condition. *

* * @param orConditions

* A list of conditions which would be applied together with an * OR condition. *

*/ public void setOrConditions(java.util.Collection orConditions) { if (orConditions == null) { this.orConditions = null; return; } this.orConditions = new java.util.ArrayList(orConditions); } /** *

* A list of conditions which would be applied together with an OR * condition. *

*

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

* A list of conditions which would be applied together with an * OR condition. *

* @return A reference to this updated object so that method calls can be * chained together. */ public QueueSearchCriteria withOrConditions(QueueSearchCriteria... orConditions) { if (getOrConditions() == null) { this.orConditions = new java.util.ArrayList(orConditions.length); } for (QueueSearchCriteria value : orConditions) { this.orConditions.add(value); } return this; } /** *

* A list of conditions which would be applied together with an OR * condition. *

*

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

* A list of conditions which would be applied together with an * OR condition. *

* @return A reference to this updated object so that method calls can be * chained together. */ public QueueSearchCriteria withOrConditions( java.util.Collection orConditions) { setOrConditions(orConditions); return this; } /** *

* A list of conditions which would be applied together with an AND * condition. *

* * @return

* A list of conditions which would be applied together with an AND * condition. *

*/ public java.util.List getAndConditions() { return andConditions; } /** *

* A list of conditions which would be applied together with an AND * condition. *

* * @param andConditions

* A list of conditions which would be applied together with an * AND condition. *

*/ public void setAndConditions(java.util.Collection andConditions) { if (andConditions == null) { this.andConditions = null; return; } this.andConditions = new java.util.ArrayList(andConditions); } /** *

* A list of conditions which would be applied together with an AND * condition. *

*

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

* A list of conditions which would be applied together with an * AND condition. *

* @return A reference to this updated object so that method calls can be * chained together. */ public QueueSearchCriteria withAndConditions(QueueSearchCriteria... andConditions) { if (getAndConditions() == null) { this.andConditions = new java.util.ArrayList(andConditions.length); } for (QueueSearchCriteria value : andConditions) { this.andConditions.add(value); } return this; } /** *

* A list of conditions which would be applied together with an AND * condition. *

*

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

* A list of conditions which would be applied together with an * AND condition. *

* @return A reference to this updated object so that method calls can be * chained together. */ public QueueSearchCriteria withAndConditions( java.util.Collection andConditions) { setAndConditions(andConditions); return this; } /** *

* A leaf node condition which can be used to specify a string condition. *

* *

* The currently supported values for FieldName are * name, description, and resourceID. *

*
* * @return

* A leaf node condition which can be used to specify a string * condition. *

* *

* The currently supported values for FieldName are * name, description, and * resourceID. *

*
*/ public StringCondition getStringCondition() { return stringCondition; } /** *

* A leaf node condition which can be used to specify a string condition. *

* *

* The currently supported values for FieldName are * name, description, and resourceID. *

*
* * @param stringCondition

* A leaf node condition which can be used to specify a string * condition. *

* *

* The currently supported values for FieldName are * name, description, and * resourceID. *

*
*/ public void setStringCondition(StringCondition stringCondition) { this.stringCondition = stringCondition; } /** *

* A leaf node condition which can be used to specify a string condition. *

* *

* The currently supported values for FieldName are * name, description, and resourceID. *

*
*

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

* A leaf node condition which can be used to specify a string * condition. *

* *

* The currently supported values for FieldName are * name, description, and * resourceID. *

*
* @return A reference to this updated object so that method calls can be * chained together. */ public QueueSearchCriteria withStringCondition(StringCondition stringCondition) { this.stringCondition = stringCondition; return this; } /** *

* The type of queue. *

*

* Constraints:
* Allowed Values: STANDARD * * @return

* The type of queue. *

* @see SearchableQueueType */ public String getQueueTypeCondition() { return queueTypeCondition; } /** *

* The type of queue. *

*

* Constraints:
* Allowed Values: STANDARD * * @param queueTypeCondition

* The type of queue. *

* @see SearchableQueueType */ public void setQueueTypeCondition(String queueTypeCondition) { this.queueTypeCondition = queueTypeCondition; } /** *

* The type of queue. *

*

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

* Constraints:
* Allowed Values: STANDARD * * @param queueTypeCondition

* The type of queue. *

* @return A reference to this updated object so that method calls can be * chained together. * @see SearchableQueueType */ public QueueSearchCriteria withQueueTypeCondition(String queueTypeCondition) { this.queueTypeCondition = queueTypeCondition; return this; } /** *

* The type of queue. *

*

* Constraints:
* Allowed Values: STANDARD * * @param queueTypeCondition

* The type of queue. *

* @see SearchableQueueType */ public void setQueueTypeCondition(SearchableQueueType queueTypeCondition) { this.queueTypeCondition = queueTypeCondition.toString(); } /** *

* The type of queue. *

*

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

* Constraints:
* Allowed Values: STANDARD * * @param queueTypeCondition

* The type of queue. *

* @return A reference to this updated object so that method calls can be * chained together. * @see SearchableQueueType */ public QueueSearchCriteria withQueueTypeCondition(SearchableQueueType queueTypeCondition) { this.queueTypeCondition = queueTypeCondition.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 (getOrConditions() != null) sb.append("OrConditions: " + getOrConditions() + ","); if (getAndConditions() != null) sb.append("AndConditions: " + getAndConditions() + ","); if (getStringCondition() != null) sb.append("StringCondition: " + getStringCondition() + ","); if (getQueueTypeCondition() != null) sb.append("QueueTypeCondition: " + getQueueTypeCondition()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getOrConditions() == null) ? 0 : getOrConditions().hashCode()); hashCode = prime * hashCode + ((getAndConditions() == null) ? 0 : getAndConditions().hashCode()); hashCode = prime * hashCode + ((getStringCondition() == null) ? 0 : getStringCondition().hashCode()); hashCode = prime * hashCode + ((getQueueTypeCondition() == null) ? 0 : getQueueTypeCondition().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof QueueSearchCriteria == false) return false; QueueSearchCriteria other = (QueueSearchCriteria) obj; if (other.getOrConditions() == null ^ this.getOrConditions() == null) return false; if (other.getOrConditions() != null && other.getOrConditions().equals(this.getOrConditions()) == false) return false; if (other.getAndConditions() == null ^ this.getAndConditions() == null) return false; if (other.getAndConditions() != null && other.getAndConditions().equals(this.getAndConditions()) == false) return false; if (other.getStringCondition() == null ^ this.getStringCondition() == null) return false; if (other.getStringCondition() != null && other.getStringCondition().equals(this.getStringCondition()) == false) return false; if (other.getQueueTypeCondition() == null ^ this.getQueueTypeCondition() == null) return false; if (other.getQueueTypeCondition() != null && other.getQueueTypeCondition().equals(this.getQueueTypeCondition()) == false) return false; return true; } }