/**
* Copyright (C) 2012 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.integration.timeseries.snapshot;
import java.util.List;
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.google.common.collect.Lists;
/**
*
*/
@BeanDefinition
public class DefaultBlackList extends DirectBean implements BlackList {
@PropertyDefinition(validate = "notNull")
private String _name;
@PropertyDefinition(validate = "notNull")
private List<String> _blackList = Lists.newArrayList();
//------------------------- AUTOGENERATED START -------------------------
///CLOVER:OFF
/**
* The meta-bean for {@code DefaultBlackList}.
* @return the meta-bean, not null
*/
public static DefaultBlackList.Meta meta() {
return DefaultBlackList.Meta.INSTANCE;
}
static {
JodaBeanUtils.registerMetaBean(DefaultBlackList.Meta.INSTANCE);
}
@Override
public DefaultBlackList.Meta metaBean() {
return DefaultBlackList.Meta.INSTANCE;
}
//-----------------------------------------------------------------------
/**
* Gets the name.
* @return the value of the property, not null
*/
public String getName() {
return _name;
}
/**
* Sets the name.
* @param name the new value of the property, not null
*/
public void setName(String name) {
JodaBeanUtils.notNull(name, "name");
this._name = name;
}
/**
* Gets the the {@code name} property.
* @return the property, not null
*/
public final Property<String> name() {
return metaBean().name().createProperty(this);
}
//-----------------------------------------------------------------------
/**
* Gets the blackList.
* @return the value of the property, not null
*/
public List<String> getBlackList() {
return _blackList;
}
/**
* Sets the blackList.
* @param blackList the new value of the property, not null
*/
public void setBlackList(List<String> blackList) {
JodaBeanUtils.notNull(blackList, "blackList");
this._blackList = blackList;
}
/**
* Gets the the {@code blackList} property.
* @return the property, not null
*/
public final Property<List<String>> blackList() {
return metaBean().blackList().createProperty(this);
}
//-----------------------------------------------------------------------
@Override
public DefaultBlackList clone() {
return JodaBeanUtils.cloneAlways(this);
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (obj != null && obj.getClass() == this.getClass()) {
DefaultBlackList other = (DefaultBlackList) obj;
return JodaBeanUtils.equal(getName(), other.getName()) &&
JodaBeanUtils.equal(getBlackList(), other.getBlackList());
}
return false;
}
@Override
public int hashCode() {
int hash = getClass().hashCode();
hash = hash * 31 + JodaBeanUtils.hashCode(getName());
hash = hash * 31 + JodaBeanUtils.hashCode(getBlackList());
return hash;
}
@Override
public String toString() {
StringBuilder buf = new StringBuilder(96);
buf.append("DefaultBlackList{");
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("name").append('=').append(JodaBeanUtils.toString(getName())).append(',').append(' ');
buf.append("blackList").append('=').append(JodaBeanUtils.toString(getBlackList())).append(',').append(' ');
}
//-----------------------------------------------------------------------
/**
* The meta-bean for {@code DefaultBlackList}.
*/
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 name} property.
*/
private final MetaProperty<String> _name = DirectMetaProperty.ofReadWrite(
this, "name", DefaultBlackList.class, String.class);
/**
* The meta-property for the {@code blackList} property.
*/
@SuppressWarnings({"unchecked", "rawtypes" })
private final MetaProperty<List<String>> _blackList = DirectMetaProperty.ofReadWrite(
this, "blackList", DefaultBlackList.class, (Class) List.class);
/**
* The meta-properties.
*/
private final Map<String, MetaProperty<?>> _metaPropertyMap$ = new DirectMetaPropertyMap(
this, null,
"name",
"blackList");
/**
* Restricted constructor.
*/
protected Meta() {
}
@Override
protected MetaProperty<?> metaPropertyGet(String propertyName) {
switch (propertyName.hashCode()) {
case 3373707: // name
return _name;
case 1332059453: // blackList
return _blackList;
}
return super.metaPropertyGet(propertyName);
}
@Override
public BeanBuilder<? extends DefaultBlackList> builder() {
return new DirectBeanBuilder<DefaultBlackList>(new DefaultBlackList());
}
@Override
public Class<? extends DefaultBlackList> beanType() {
return DefaultBlackList.class;
}
@Override
public Map<String, MetaProperty<?>> metaPropertyMap() {
return _metaPropertyMap$;
}
//-----------------------------------------------------------------------
/**
* The meta-property for the {@code name} property.
* @return the meta-property, not null
*/
public final MetaProperty<String> name() {
return _name;
}
/**
* The meta-property for the {@code blackList} property.
* @return the meta-property, not null
*/
public final MetaProperty<List<String>> blackList() {
return _blackList;
}
//-----------------------------------------------------------------------
@Override
protected Object propertyGet(Bean bean, String propertyName, boolean quiet) {
switch (propertyName.hashCode()) {
case 3373707: // name
return ((DefaultBlackList) bean).getName();
case 1332059453: // blackList
return ((DefaultBlackList) bean).getBlackList();
}
return super.propertyGet(bean, propertyName, quiet);
}
@SuppressWarnings("unchecked")
@Override
protected void propertySet(Bean bean, String propertyName, Object newValue, boolean quiet) {
switch (propertyName.hashCode()) {
case 3373707: // name
((DefaultBlackList) bean).setName((String) newValue);
return;
case 1332059453: // blackList
((DefaultBlackList) bean).setBlackList((List<String>) newValue);
return;
}
super.propertySet(bean, propertyName, newValue, quiet);
}
@Override
protected void validate(Bean bean) {
JodaBeanUtils.notNull(((DefaultBlackList) bean)._name, "name");
JodaBeanUtils.notNull(((DefaultBlackList) bean)._blackList, "blackList");
}
}
///CLOVER:ON
//-------------------------- AUTOGENERATED END --------------------------
}