com.amazonaws.services.quicksight.model.NamedEntityDefinition Maven / Gradle / Ivy
Show all versions of aws-java-sdk-quicksight Show documentation
/*
* Copyright 2019-2024 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.quicksight.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* A structure that represents a named entity.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class NamedEntityDefinition implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the entity.
*
*/
private String fieldName;
/**
*
* The property name to be used for the named entity.
*
*/
private String propertyName;
/**
*
* The property role. Valid values for this structure are PRIMARY
and ID
.
*
*/
private String propertyRole;
/**
*
* The property usage. Valid values for this structure are INHERIT
, DIMENSION
, and
* MEASURE
.
*
*/
private String propertyUsage;
/**
*
* The definition of a metric.
*
*/
private NamedEntityDefinitionMetric metric;
/**
*
* The name of the entity.
*
*
* @param fieldName
* The name of the entity.
*/
public void setFieldName(String fieldName) {
this.fieldName = fieldName;
}
/**
*
* The name of the entity.
*
*
* @return The name of the entity.
*/
public String getFieldName() {
return this.fieldName;
}
/**
*
* The name of the entity.
*
*
* @param fieldName
* The name of the entity.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NamedEntityDefinition withFieldName(String fieldName) {
setFieldName(fieldName);
return this;
}
/**
*
* The property name to be used for the named entity.
*
*
* @param propertyName
* The property name to be used for the named entity.
*/
public void setPropertyName(String propertyName) {
this.propertyName = propertyName;
}
/**
*
* The property name to be used for the named entity.
*
*
* @return The property name to be used for the named entity.
*/
public String getPropertyName() {
return this.propertyName;
}
/**
*
* The property name to be used for the named entity.
*
*
* @param propertyName
* The property name to be used for the named entity.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NamedEntityDefinition withPropertyName(String propertyName) {
setPropertyName(propertyName);
return this;
}
/**
*
* The property role. Valid values for this structure are PRIMARY
and ID
.
*
*
* @param propertyRole
* The property role. Valid values for this structure are PRIMARY
and ID
.
* @see PropertyRole
*/
public void setPropertyRole(String propertyRole) {
this.propertyRole = propertyRole;
}
/**
*
* The property role. Valid values for this structure are PRIMARY
and ID
.
*
*
* @return The property role. Valid values for this structure are PRIMARY
and ID
.
* @see PropertyRole
*/
public String getPropertyRole() {
return this.propertyRole;
}
/**
*
* The property role. Valid values for this structure are PRIMARY
and ID
.
*
*
* @param propertyRole
* The property role. Valid values for this structure are PRIMARY
and ID
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PropertyRole
*/
public NamedEntityDefinition withPropertyRole(String propertyRole) {
setPropertyRole(propertyRole);
return this;
}
/**
*
* The property role. Valid values for this structure are PRIMARY
and ID
.
*
*
* @param propertyRole
* The property role. Valid values for this structure are PRIMARY
and ID
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PropertyRole
*/
public NamedEntityDefinition withPropertyRole(PropertyRole propertyRole) {
this.propertyRole = propertyRole.toString();
return this;
}
/**
*
* The property usage. Valid values for this structure are INHERIT
, DIMENSION
, and
* MEASURE
.
*
*
* @param propertyUsage
* The property usage. Valid values for this structure are INHERIT
, DIMENSION
, and
* MEASURE
.
* @see PropertyUsage
*/
public void setPropertyUsage(String propertyUsage) {
this.propertyUsage = propertyUsage;
}
/**
*
* The property usage. Valid values for this structure are INHERIT
, DIMENSION
, and
* MEASURE
.
*
*
* @return The property usage. Valid values for this structure are INHERIT
, DIMENSION
, and
* MEASURE
.
* @see PropertyUsage
*/
public String getPropertyUsage() {
return this.propertyUsage;
}
/**
*
* The property usage. Valid values for this structure are INHERIT
, DIMENSION
, and
* MEASURE
.
*
*
* @param propertyUsage
* The property usage. Valid values for this structure are INHERIT
, DIMENSION
, and
* MEASURE
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PropertyUsage
*/
public NamedEntityDefinition withPropertyUsage(String propertyUsage) {
setPropertyUsage(propertyUsage);
return this;
}
/**
*
* The property usage. Valid values for this structure are INHERIT
, DIMENSION
, and
* MEASURE
.
*
*
* @param propertyUsage
* The property usage. Valid values for this structure are INHERIT
, DIMENSION
, and
* MEASURE
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PropertyUsage
*/
public NamedEntityDefinition withPropertyUsage(PropertyUsage propertyUsage) {
this.propertyUsage = propertyUsage.toString();
return this;
}
/**
*
* The definition of a metric.
*
*
* @param metric
* The definition of a metric.
*/
public void setMetric(NamedEntityDefinitionMetric metric) {
this.metric = metric;
}
/**
*
* The definition of a metric.
*
*
* @return The definition of a metric.
*/
public NamedEntityDefinitionMetric getMetric() {
return this.metric;
}
/**
*
* The definition of a metric.
*
*
* @param metric
* The definition of a metric.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NamedEntityDefinition withMetric(NamedEntityDefinitionMetric metric) {
setMetric(metric);
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 (getFieldName() != null)
sb.append("FieldName: ").append(getFieldName()).append(",");
if (getPropertyName() != null)
sb.append("PropertyName: ").append(getPropertyName()).append(",");
if (getPropertyRole() != null)
sb.append("PropertyRole: ").append(getPropertyRole()).append(",");
if (getPropertyUsage() != null)
sb.append("PropertyUsage: ").append(getPropertyUsage()).append(",");
if (getMetric() != null)
sb.append("Metric: ").append(getMetric());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof NamedEntityDefinition == false)
return false;
NamedEntityDefinition other = (NamedEntityDefinition) obj;
if (other.getFieldName() == null ^ this.getFieldName() == null)
return false;
if (other.getFieldName() != null && other.getFieldName().equals(this.getFieldName()) == false)
return false;
if (other.getPropertyName() == null ^ this.getPropertyName() == null)
return false;
if (other.getPropertyName() != null && other.getPropertyName().equals(this.getPropertyName()) == false)
return false;
if (other.getPropertyRole() == null ^ this.getPropertyRole() == null)
return false;
if (other.getPropertyRole() != null && other.getPropertyRole().equals(this.getPropertyRole()) == false)
return false;
if (other.getPropertyUsage() == null ^ this.getPropertyUsage() == null)
return false;
if (other.getPropertyUsage() != null && other.getPropertyUsage().equals(this.getPropertyUsage()) == false)
return false;
if (other.getMetric() == null ^ this.getMetric() == null)
return false;
if (other.getMetric() != null && other.getMetric().equals(this.getMetric()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getFieldName() == null) ? 0 : getFieldName().hashCode());
hashCode = prime * hashCode + ((getPropertyName() == null) ? 0 : getPropertyName().hashCode());
hashCode = prime * hashCode + ((getPropertyRole() == null) ? 0 : getPropertyRole().hashCode());
hashCode = prime * hashCode + ((getPropertyUsage() == null) ? 0 : getPropertyUsage().hashCode());
hashCode = prime * hashCode + ((getMetric() == null) ? 0 : getMetric().hashCode());
return hashCode;
}
@Override
public NamedEntityDefinition clone() {
try {
return (NamedEntityDefinition) 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.quicksight.model.transform.NamedEntityDefinitionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}