/* * 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.cloudwatchevidently.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* This structure defines a metric that you want to use to evaluate the variations during a launch or experiment. *
* * @see AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class MetricDefinitionConfig implements Serializable, Cloneable, StructuredPojo { /** *
* The entity, such as a user or session, that does an action that causes a metric value to be recorded. An example
* is userDetails.userID
.
*
* The EventBridge event pattern that defines how the metric is recorded. *
** For more information about EventBridge event patterns, see Amazon EventBridge event * patterns. *
*/ private String eventPattern; /** ** A name for the metric. *
*/ private String name; /** ** A label for the units that the metric is measuring. *
*/ private String unitLabel; /** ** The value that is tracked to produce the metric. *
*/ private String valueKey; /** *
* The entity, such as a user or session, that does an action that causes a metric value to be recorded. An example
* is userDetails.userID
.
*
userDetails.userID
.
*/
public void setEntityIdKey(String entityIdKey) {
this.entityIdKey = entityIdKey;
}
/**
*
* The entity, such as a user or session, that does an action that causes a metric value to be recorded. An example
* is userDetails.userID
.
*
userDetails.userID
.
*/
public String getEntityIdKey() {
return this.entityIdKey;
}
/**
*
* The entity, such as a user or session, that does an action that causes a metric value to be recorded. An example
* is userDetails.userID
.
*
userDetails.userID
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricDefinitionConfig withEntityIdKey(String entityIdKey) {
setEntityIdKey(entityIdKey);
return this;
}
/**
* * The EventBridge event pattern that defines how the metric is recorded. *
** For more information about EventBridge event patterns, see Amazon EventBridge event * patterns. *
** This field's value must be valid JSON according to RFC 7159, including the opening and closing braces. For * example: '{"key": "value"}'. *
** The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service. * Users of the SDK should not perform Base64 encoding on this field. *
* * @param eventPattern * The EventBridge event pattern that defines how the metric is recorded. ** For more information about EventBridge event patterns, see Amazon EventBridge * event patterns. */ public void setEventPattern(String eventPattern) { this.eventPattern = eventPattern; } /** *
* The EventBridge event pattern that defines how the metric is recorded. *
** For more information about EventBridge event patterns, see Amazon EventBridge event * patterns. *
** This field's value will be valid JSON according to RFC 7159, including the opening and closing braces. For * example: '{"key": "value"}'. *
* * @return The EventBridge event pattern that defines how the metric is recorded. ** For more information about EventBridge event patterns, see Amazon EventBridge * event patterns. */ public String getEventPattern() { return this.eventPattern; } /** *
* The EventBridge event pattern that defines how the metric is recorded. *
** For more information about EventBridge event patterns, see Amazon EventBridge event * patterns. *
** This field's value must be valid JSON according to RFC 7159, including the opening and closing braces. For * example: '{"key": "value"}'. *
** The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service. * Users of the SDK should not perform Base64 encoding on this field. *
* * @param eventPattern * The EventBridge event pattern that defines how the metric is recorded. ** For more information about EventBridge event patterns, see Amazon EventBridge * event patterns. * @return Returns a reference to this object so that method calls can be chained together. */ public MetricDefinitionConfig withEventPattern(String eventPattern) { setEventPattern(eventPattern); return this; } /** *
* A name for the metric. *
* * @param name * A name for the metric. */ public void setName(String name) { this.name = name; } /** ** A name for the metric. *
* * @return A name for the metric. */ public String getName() { return this.name; } /** ** A name for the metric. *
* * @param name * A name for the metric. * @return Returns a reference to this object so that method calls can be chained together. */ public MetricDefinitionConfig withName(String name) { setName(name); return this; } /** ** A label for the units that the metric is measuring. *
* * @param unitLabel * A label for the units that the metric is measuring. */ public void setUnitLabel(String unitLabel) { this.unitLabel = unitLabel; } /** ** A label for the units that the metric is measuring. *
* * @return A label for the units that the metric is measuring. */ public String getUnitLabel() { return this.unitLabel; } /** ** A label for the units that the metric is measuring. *
* * @param unitLabel * A label for the units that the metric is measuring. * @return Returns a reference to this object so that method calls can be chained together. */ public MetricDefinitionConfig withUnitLabel(String unitLabel) { setUnitLabel(unitLabel); return this; } /** ** The value that is tracked to produce the metric. *
* * @param valueKey * The value that is tracked to produce the metric. */ public void setValueKey(String valueKey) { this.valueKey = valueKey; } /** ** The value that is tracked to produce the metric. *
* * @return The value that is tracked to produce the metric. */ public String getValueKey() { return this.valueKey; } /** ** The value that is tracked to produce the metric. *
* * @param valueKey * The value that is tracked to produce the metric. * @return Returns a reference to this object so that method calls can be chained together. */ public MetricDefinitionConfig withValueKey(String valueKey) { setValueKey(valueKey); 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 (getEntityIdKey() != null) sb.append("EntityIdKey: ").append(getEntityIdKey()).append(","); if (getEventPattern() != null) sb.append("EventPattern: ").append(getEventPattern()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getUnitLabel() != null) sb.append("UnitLabel: ").append(getUnitLabel()).append(","); if (getValueKey() != null) sb.append("ValueKey: ").append(getValueKey()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof MetricDefinitionConfig == false) return false; MetricDefinitionConfig other = (MetricDefinitionConfig) obj; if (other.getEntityIdKey() == null ^ this.getEntityIdKey() == null) return false; if (other.getEntityIdKey() != null && other.getEntityIdKey().equals(this.getEntityIdKey()) == false) return false; if (other.getEventPattern() == null ^ this.getEventPattern() == null) return false; if (other.getEventPattern() != null && other.getEventPattern().equals(this.getEventPattern()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getUnitLabel() == null ^ this.getUnitLabel() == null) return false; if (other.getUnitLabel() != null && other.getUnitLabel().equals(this.getUnitLabel()) == false) return false; if (other.getValueKey() == null ^ this.getValueKey() == null) return false; if (other.getValueKey() != null && other.getValueKey().equals(this.getValueKey()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEntityIdKey() == null) ? 0 : getEntityIdKey().hashCode()); hashCode = prime * hashCode + ((getEventPattern() == null) ? 0 : getEventPattern().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getUnitLabel() == null) ? 0 : getUnitLabel().hashCode()); hashCode = prime * hashCode + ((getValueKey() == null) ? 0 : getValueKey().hashCode()); return hashCode; } @Override public MetricDefinitionConfig clone() { try { return (MetricDefinitionConfig) 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.cloudwatchevidently.model.transform.MetricDefinitionConfigMarshaller.getInstance().marshall(this, protocolMarshaller); } }