/**
* Copyright (C) 2013 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.integration.viewer.status.impl;
import java.util.Map;
import org.joda.beans.Bean;
import org.joda.beans.BeanBuilder;
import org.joda.beans.BeanDefinition;
import org.joda.beans.JodaBeanUtils;
import org.joda.beans.MetaProperty;
import org.joda.beans.Property;
import org.joda.beans.PropertyDefinition;
import org.joda.beans.impl.direct.DirectBean;
import org.joda.beans.impl.direct.DirectBeanBuilder;
import org.joda.beans.impl.direct.DirectMetaBean;
import org.joda.beans.impl.direct.DirectMetaProperty;
import org.joda.beans.impl.direct.DirectMetaPropertyMap;
import com.opengamma.integration.viewer.status.ViewStatusKey;
import com.opengamma.util.ArgumentChecker;
/**
*
*/
@BeanDefinition
public class ViewStatusKeyBean extends DirectBean implements ViewStatusKey {
@PropertyDefinition(validate = "notNull")
private String _securityType;
@PropertyDefinition(validate = "notNull")
private String _valueRequirementName;
@PropertyDefinition(validate = "notNull")
private String _currency;
@PropertyDefinition(validate = "notNull")
private String _targetType;
/**
* Creates an instance
*
* @param securityType the security type, not-null.
* @param valueRequirementName the value name, not-null.
* @param currency the currency, not-null.
* @param targetType the target type, not-null.
*/
public ViewStatusKeyBean(String securityType, String valueRequirementName, String currency, String targetType) {
ArgumentChecker.notNull(securityType, "securityType");
ArgumentChecker.notNull(valueRequirementName, "valueRequirementName");
ArgumentChecker.notNull(currency, "currency");
ArgumentChecker.notNull(targetType, "targetType");
setSecurityType(securityType);
setValueRequirementName(valueRequirementName);
setCurrency(currency);
setTargetType(targetType);
}
/**
* Constructor for builder
*/
ViewStatusKeyBean() {
}
//------------------------- AUTOGENERATED START -------------------------
///CLOVER:OFF
/**
* The meta-bean for {@code ViewStatusKeyBean}.
* @return the meta-bean, not null
*/
public static ViewStatusKeyBean.Meta meta() {
return ViewStatusKeyBean.Meta.INSTANCE;
}
static {
JodaBeanUtils.registerMetaBean(ViewStatusKeyBean.Meta.INSTANCE);
}
@Override
public ViewStatusKeyBean.Meta metaBean() {
return ViewStatusKeyBean.Meta.INSTANCE;
}
//-----------------------------------------------------------------------
/**
* Gets the securityType.
* @return the value of the property, not null
*/
public String getSecurityType() {
return _securityType;
}
/**
* Sets the securityType.
* @param securityType the new value of the property, not null
*/
public void setSecurityType(String securityType) {
JodaBeanUtils.notNull(securityType, "securityType");
this._securityType = securityType;
}
/**
* Gets the the {@code securityType} property.
* @return the property, not null
*/
public final Property<String> securityType() {
return metaBean().securityType().createProperty(this);
}
//-----------------------------------------------------------------------
/**
* Gets the valueRequirementName.
* @return the value of the property, not null
*/
public String getValueRequirementName() {
return _valueRequirementName;
}
/**
* Sets the valueRequirementName.
* @param valueRequirementName the new value of the property, not null
*/
public void setValueRequirementName(String valueRequirementName) {
JodaBeanUtils.notNull(valueRequirementName, "valueRequirementName");
this._valueRequirementName = valueRequirementName;
}
/**
* Gets the the {@code valueRequirementName} property.
* @return the property, not null
*/
public final Property<String> valueRequirementName() {
return metaBean().valueRequirementName().createProperty(this);
}
//-----------------------------------------------------------------------
/**
* Gets the currency.
* @return the value of the property, not null
*/
public String getCurrency() {
return _currency;
}
/**
* Sets the currency.
* @param currency the new value of the property, not null
*/
public void setCurrency(String currency) {
JodaBeanUtils.notNull(currency, "currency");
this._currency = currency;
}
/**
* Gets the the {@code currency} property.
* @return the property, not null
*/
public final Property<String> currency() {
return metaBean().currency().createProperty(this);
}
//-----------------------------------------------------------------------
/**
* Gets the targetType.
* @return the value of the property, not null
*/
public String getTargetType() {
return _targetType;
}
/**
* Sets the targetType.
* @param targetType the new value of the property, not null
*/
public void setTargetType(String targetType) {
JodaBeanUtils.notNull(targetType, "targetType");
this._targetType = targetType;
}
/**
* Gets the the {@code targetType} property.
* @return the property, not null
*/
public final Property<String> targetType() {
return metaBean().targetType().createProperty(this);
}
//-----------------------------------------------------------------------
@Override
public ViewStatusKeyBean clone() {
return JodaBeanUtils.cloneAlways(this);
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (obj != null && obj.getClass() == this.getClass()) {
ViewStatusKeyBean other = (ViewStatusKeyBean) obj;
return JodaBeanUtils.equal(getSecurityType(), other.getSecurityType()) &&
JodaBeanUtils.equal(getValueRequirementName(), other.getValueRequirementName()) &&
JodaBeanUtils.equal(getCurrency(), other.getCurrency()) &&
JodaBeanUtils.equal(getTargetType(), other.getTargetType());
}
return false;
}
@Override
public int hashCode() {
int hash = getClass().hashCode();
hash = hash * 31 + JodaBeanUtils.hashCode(getSecurityType());
hash = hash * 31 + JodaBeanUtils.hashCode(getValueRequirementName());
hash = hash * 31 + JodaBeanUtils.hashCode(getCurrency());
hash = hash * 31 + JodaBeanUtils.hashCode(getTargetType());
return hash;
}
@Override
public String toString() {
StringBuilder buf = new StringBuilder(160);
buf.append("ViewStatusKeyBean{");
int len = buf.length();
toString(buf);
if (buf.length() > len) {
buf.setLength(buf.length() - 2);
}
buf.append('}');
return buf.toString();
}
protected void toString(StringBuilder buf) {
buf.append("securityType").append('=').append(JodaBeanUtils.toString(getSecurityType())).append(',').append(' ');
buf.append("valueRequirementName").append('=').append(JodaBeanUtils.toString(getValueRequirementName())).append(',').append(' ');
buf.append("currency").append('=').append(JodaBeanUtils.toString(getCurrency())).append(',').append(' ');
buf.append("targetType").append('=').append(JodaBeanUtils.toString(getTargetType())).append(',').append(' ');
}
//-----------------------------------------------------------------------
/**
* The meta-bean for {@code ViewStatusKeyBean}.
*/
public static class Meta extends DirectMetaBean {
/**
* The singleton instance of the meta-bean.
*/
static final Meta INSTANCE = new Meta();
/**
* The meta-property for the {@code securityType} property.
*/
private final MetaProperty<String> _securityType = DirectMetaProperty.ofReadWrite(
this, "securityType", ViewStatusKeyBean.class, String.class);
/**
* The meta-property for the {@code valueRequirementName} property.
*/
private final MetaProperty<String> _valueRequirementName = DirectMetaProperty.ofReadWrite(
this, "valueRequirementName", ViewStatusKeyBean.class, String.class);
/**
* The meta-property for the {@code currency} property.
*/
private final MetaProperty<String> _currency = DirectMetaProperty.ofReadWrite(
this, "currency", ViewStatusKeyBean.class, String.class);
/**
* The meta-property for the {@code targetType} property.
*/
private final MetaProperty<String> _targetType = DirectMetaProperty.ofReadWrite(
this, "targetType", ViewStatusKeyBean.class, String.class);
/**
* The meta-properties.
*/
private final Map<String, MetaProperty<?>> _metaPropertyMap$ = new DirectMetaPropertyMap(
this, null,
"securityType",
"valueRequirementName",
"currency",
"targetType");
/**
* Restricted constructor.
*/
protected Meta() {
}
@Override
protected MetaProperty<?> metaPropertyGet(String propertyName) {
switch (propertyName.hashCode()) {
case 808245914: // securityType
return _securityType;
case 1646585789: // valueRequirementName
return _valueRequirementName;
case 575402001: // currency
return _currency;
case 486622315: // targetType
return _targetType;
}
return super.metaPropertyGet(propertyName);
}
@Override
public BeanBuilder<? extends ViewStatusKeyBean> builder() {
return new DirectBeanBuilder<ViewStatusKeyBean>(new ViewStatusKeyBean());
}
@Override
public Class<? extends ViewStatusKeyBean> beanType() {
return ViewStatusKeyBean.class;
}
@Override
public Map<String, MetaProperty<?>> metaPropertyMap() {
return _metaPropertyMap$;
}
//-----------------------------------------------------------------------
/**
* The meta-property for the {@code securityType} property.
* @return the meta-property, not null
*/
public final MetaProperty<String> securityType() {
return _securityType;
}
/**
* The meta-property for the {@code valueRequirementName} property.
* @return the meta-property, not null
*/
public final MetaProperty<String> valueRequirementName() {
return _valueRequirementName;
}
/**
* The meta-property for the {@code currency} property.
* @return the meta-property, not null
*/
public final MetaProperty<String> currency() {
return _currency;
}
/**
* The meta-property for the {@code targetType} property.
* @return the meta-property, not null
*/
public final MetaProperty<String> targetType() {
return _targetType;
}
//-----------------------------------------------------------------------
@Override
protected Object propertyGet(Bean bean, String propertyName, boolean quiet) {
switch (propertyName.hashCode()) {
case 808245914: // securityType
return ((ViewStatusKeyBean) bean).getSecurityType();
case 1646585789: // valueRequirementName
return ((ViewStatusKeyBean) bean).getValueRequirementName();
case 575402001: // currency
return ((ViewStatusKeyBean) bean).getCurrency();
case 486622315: // targetType
return ((ViewStatusKeyBean) bean).getTargetType();
}
return super.propertyGet(bean, propertyName, quiet);
}
@Override
protected void propertySet(Bean bean, String propertyName, Object newValue, boolean quiet) {
switch (propertyName.hashCode()) {
case 808245914: // securityType
((ViewStatusKeyBean) bean).setSecurityType((String) newValue);
return;
case 1646585789: // valueRequirementName
((ViewStatusKeyBean) bean).setValueRequirementName((String) newValue);
return;
case 575402001: // currency
((ViewStatusKeyBean) bean).setCurrency((String) newValue);
return;
case 486622315: // targetType
((ViewStatusKeyBean) bean).setTargetType((String) newValue);
return;
}
super.propertySet(bean, propertyName, newValue, quiet);
}
@Override
protected void validate(Bean bean) {
JodaBeanUtils.notNull(((ViewStatusKeyBean) bean)._securityType, "securityType");
JodaBeanUtils.notNull(((ViewStatusKeyBean) bean)._valueRequirementName, "valueRequirementName");
JodaBeanUtils.notNull(((ViewStatusKeyBean) bean)._currency, "currency");
JodaBeanUtils.notNull(((ViewStatusKeyBean) bean)._targetType, "targetType");
}
}
///CLOVER:ON
//-------------------------- AUTOGENERATED END --------------------------
}