All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.personalize.model.MetricAttribute Maven / Gradle / Ivy

/*
 * 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.personalize.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 * 

* Contains information on a metric that a metric attribution reports on. For more information, see Measuring impact of * recommendations. *

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

* The metric's event type. *

*/ private String eventType; /** *

* The metric's name. The name helps you identify the metric in Amazon CloudWatch or Amazon S3. *

*/ private String metricName; /** *

* The attribute's expression. Available functions are SUM() or SAMPLECOUNT(). For SUM() * functions, provide the dataset type (either Interactions or Items) and column to sum as a parameter. For example * SUM(Items.PRICE). *

*/ private String expression; /** *

* The metric's event type. *

* * @param eventType * The metric's event type. */ public void setEventType(String eventType) { this.eventType = eventType; } /** *

* The metric's event type. *

* * @return The metric's event type. */ public String getEventType() { return this.eventType; } /** *

* The metric's event type. *

* * @param eventType * The metric's event type. * @return Returns a reference to this object so that method calls can be chained together. */ public MetricAttribute withEventType(String eventType) { setEventType(eventType); return this; } /** *

* The metric's name. The name helps you identify the metric in Amazon CloudWatch or Amazon S3. *

* * @param metricName * The metric's name. The name helps you identify the metric in Amazon CloudWatch or Amazon S3. */ public void setMetricName(String metricName) { this.metricName = metricName; } /** *

* The metric's name. The name helps you identify the metric in Amazon CloudWatch or Amazon S3. *

* * @return The metric's name. The name helps you identify the metric in Amazon CloudWatch or Amazon S3. */ public String getMetricName() { return this.metricName; } /** *

* The metric's name. The name helps you identify the metric in Amazon CloudWatch or Amazon S3. *

* * @param metricName * The metric's name. The name helps you identify the metric in Amazon CloudWatch or Amazon S3. * @return Returns a reference to this object so that method calls can be chained together. */ public MetricAttribute withMetricName(String metricName) { setMetricName(metricName); return this; } /** *

* The attribute's expression. Available functions are SUM() or SAMPLECOUNT(). For SUM() * functions, provide the dataset type (either Interactions or Items) and column to sum as a parameter. For example * SUM(Items.PRICE). *

* * @param expression * The attribute's expression. Available functions are SUM() or SAMPLECOUNT(). For * SUM() functions, provide the dataset type (either Interactions or Items) and column to sum as a parameter. * For example SUM(Items.PRICE). */ public void setExpression(String expression) { this.expression = expression; } /** *

* The attribute's expression. Available functions are SUM() or SAMPLECOUNT(). For SUM() * functions, provide the dataset type (either Interactions or Items) and column to sum as a parameter. For example * SUM(Items.PRICE). *

* * @return The attribute's expression. Available functions are SUM() or SAMPLECOUNT(). For * SUM() functions, provide the dataset type (either Interactions or Items) and column to sum as a * parameter. For example SUM(Items.PRICE). */ public String getExpression() { return this.expression; } /** *

* The attribute's expression. Available functions are SUM() or SAMPLECOUNT(). For SUM() * functions, provide the dataset type (either Interactions or Items) and column to sum as a parameter. For example * SUM(Items.PRICE). *

* * @param expression * The attribute's expression. Available functions are SUM() or SAMPLECOUNT(). For * SUM() functions, provide the dataset type (either Interactions or Items) and column to sum as a parameter. * For example SUM(Items.PRICE). * @return Returns a reference to this object so that method calls can be chained together. */ public MetricAttribute withExpression(String expression) { setExpression(expression); 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 (getEventType() != null) sb.append("EventType: ").append(getEventType()).append(","); if (getMetricName() != null) sb.append("MetricName: ").append(getMetricName()).append(","); if (getExpression() != null) sb.append("Expression: ").append(getExpression()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof MetricAttribute == false) return false; MetricAttribute other = (MetricAttribute) obj; if (other.getEventType() == null ^ this.getEventType() == null) return false; if (other.getEventType() != null && other.getEventType().equals(this.getEventType()) == false) return false; if (other.getMetricName() == null ^ this.getMetricName() == null) return false; if (other.getMetricName() != null && other.getMetricName().equals(this.getMetricName()) == false) return false; if (other.getExpression() == null ^ this.getExpression() == null) return false; if (other.getExpression() != null && other.getExpression().equals(this.getExpression()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEventType() == null) ? 0 : getEventType().hashCode()); hashCode = prime * hashCode + ((getMetricName() == null) ? 0 : getMetricName().hashCode()); hashCode = prime * hashCode + ((getExpression() == null) ? 0 : getExpression().hashCode()); return hashCode; } @Override public MetricAttribute clone() { try { return (MetricAttribute) 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.personalize.model.transform.MetricAttributeMarshaller.getInstance().marshall(this, protocolMarshaller); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy