/* * Copyright 2018-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.lexmodelsv2.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Contains settings used by Amazon Lex to select a slot value. *

* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class SlotValueSelectionSetting implements Serializable, Cloneable, StructuredPojo { /** *

* Determines the slot resolution strategy that Amazon Lex uses to return slot type values. The field can be set to * one of the following values: *

* *

* If you don't specify the valueSelectionStrategy, the default is ORIGINAL_VALUE. *

*/ private String resolutionStrategy; /** *

* A regular expression used to validate the value of a slot. *

*/ private SlotValueRegexFilter regexFilter; /** *

* Provides settings that enable advanced recognition settings for slot values. You can use this to enable using * slot values as a custom vocabulary for recognizing user utterances. *

*/ private AdvancedRecognitionSetting advancedRecognitionSetting; /** *

* Determines the slot resolution strategy that Amazon Lex uses to return slot type values. The field can be set to * one of the following values: *

* *

* If you don't specify the valueSelectionStrategy, the default is ORIGINAL_VALUE. *

* * @param resolutionStrategy * Determines the slot resolution strategy that Amazon Lex uses to return slot type values. The field can be * set to one of the following values:

* *

* If you don't specify the valueSelectionStrategy, the default is ORIGINAL_VALUE. * @see SlotValueResolutionStrategy */ public void setResolutionStrategy(String resolutionStrategy) { this.resolutionStrategy = resolutionStrategy; } /** *

* Determines the slot resolution strategy that Amazon Lex uses to return slot type values. The field can be set to * one of the following values: *

* *

* If you don't specify the valueSelectionStrategy, the default is ORIGINAL_VALUE. *

* * @return Determines the slot resolution strategy that Amazon Lex uses to return slot type values. The field can be * set to one of the following values:

* *

* If you don't specify the valueSelectionStrategy, the default is ORIGINAL_VALUE. * @see SlotValueResolutionStrategy */ public String getResolutionStrategy() { return this.resolutionStrategy; } /** *

* Determines the slot resolution strategy that Amazon Lex uses to return slot type values. The field can be set to * one of the following values: *

* *

* If you don't specify the valueSelectionStrategy, the default is ORIGINAL_VALUE. *

* * @param resolutionStrategy * Determines the slot resolution strategy that Amazon Lex uses to return slot type values. The field can be * set to one of the following values:

* *

* If you don't specify the valueSelectionStrategy, the default is ORIGINAL_VALUE. * @return Returns a reference to this object so that method calls can be chained together. * @see SlotValueResolutionStrategy */ public SlotValueSelectionSetting withResolutionStrategy(String resolutionStrategy) { setResolutionStrategy(resolutionStrategy); return this; } /** *

* Determines the slot resolution strategy that Amazon Lex uses to return slot type values. The field can be set to * one of the following values: *

* *

* If you don't specify the valueSelectionStrategy, the default is ORIGINAL_VALUE. *

* * @param resolutionStrategy * Determines the slot resolution strategy that Amazon Lex uses to return slot type values. The field can be * set to one of the following values:

* *

* If you don't specify the valueSelectionStrategy, the default is ORIGINAL_VALUE. * @return Returns a reference to this object so that method calls can be chained together. * @see SlotValueResolutionStrategy */ public SlotValueSelectionSetting withResolutionStrategy(SlotValueResolutionStrategy resolutionStrategy) { this.resolutionStrategy = resolutionStrategy.toString(); return this; } /** *

* A regular expression used to validate the value of a slot. *

* * @param regexFilter * A regular expression used to validate the value of a slot. */ public void setRegexFilter(SlotValueRegexFilter regexFilter) { this.regexFilter = regexFilter; } /** *

* A regular expression used to validate the value of a slot. *

* * @return A regular expression used to validate the value of a slot. */ public SlotValueRegexFilter getRegexFilter() { return this.regexFilter; } /** *

* A regular expression used to validate the value of a slot. *

* * @param regexFilter * A regular expression used to validate the value of a slot. * @return Returns a reference to this object so that method calls can be chained together. */ public SlotValueSelectionSetting withRegexFilter(SlotValueRegexFilter regexFilter) { setRegexFilter(regexFilter); return this; } /** *

* Provides settings that enable advanced recognition settings for slot values. You can use this to enable using * slot values as a custom vocabulary for recognizing user utterances. *

* * @param advancedRecognitionSetting * Provides settings that enable advanced recognition settings for slot values. You can use this to enable * using slot values as a custom vocabulary for recognizing user utterances. */ public void setAdvancedRecognitionSetting(AdvancedRecognitionSetting advancedRecognitionSetting) { this.advancedRecognitionSetting = advancedRecognitionSetting; } /** *

* Provides settings that enable advanced recognition settings for slot values. You can use this to enable using * slot values as a custom vocabulary for recognizing user utterances. *

* * @return Provides settings that enable advanced recognition settings for slot values. You can use this to enable * using slot values as a custom vocabulary for recognizing user utterances. */ public AdvancedRecognitionSetting getAdvancedRecognitionSetting() { return this.advancedRecognitionSetting; } /** *

* Provides settings that enable advanced recognition settings for slot values. You can use this to enable using * slot values as a custom vocabulary for recognizing user utterances. *

* * @param advancedRecognitionSetting * Provides settings that enable advanced recognition settings for slot values. You can use this to enable * using slot values as a custom vocabulary for recognizing user utterances. * @return Returns a reference to this object so that method calls can be chained together. */ public SlotValueSelectionSetting withAdvancedRecognitionSetting(AdvancedRecognitionSetting advancedRecognitionSetting) { setAdvancedRecognitionSetting(advancedRecognitionSetting); 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 (getResolutionStrategy() != null) sb.append("ResolutionStrategy: ").append(getResolutionStrategy()).append(","); if (getRegexFilter() != null) sb.append("RegexFilter: ").append(getRegexFilter()).append(","); if (getAdvancedRecognitionSetting() != null) sb.append("AdvancedRecognitionSetting: ").append(getAdvancedRecognitionSetting()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SlotValueSelectionSetting == false) return false; SlotValueSelectionSetting other = (SlotValueSelectionSetting) obj; if (other.getResolutionStrategy() == null ^ this.getResolutionStrategy() == null) return false; if (other.getResolutionStrategy() != null && other.getResolutionStrategy().equals(this.getResolutionStrategy()) == false) return false; if (other.getRegexFilter() == null ^ this.getRegexFilter() == null) return false; if (other.getRegexFilter() != null && other.getRegexFilter().equals(this.getRegexFilter()) == false) return false; if (other.getAdvancedRecognitionSetting() == null ^ this.getAdvancedRecognitionSetting() == null) return false; if (other.getAdvancedRecognitionSetting() != null && other.getAdvancedRecognitionSetting().equals(this.getAdvancedRecognitionSetting()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getResolutionStrategy() == null) ? 0 : getResolutionStrategy().hashCode()); hashCode = prime * hashCode + ((getRegexFilter() == null) ? 0 : getRegexFilter().hashCode()); hashCode = prime * hashCode + ((getAdvancedRecognitionSetting() == null) ? 0 : getAdvancedRecognitionSetting().hashCode()); return hashCode; } @Override public SlotValueSelectionSetting clone() { try { return (SlotValueSelectionSetting) 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.lexmodelsv2.model.transform.SlotValueSelectionSettingMarshaller.getInstance().marshall(this, protocolMarshaller); } }