/**
* Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.master.security;
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.DirectBeanBuilder;
import org.joda.beans.impl.direct.DirectMetaProperty;
import org.joda.beans.impl.direct.DirectMetaPropertyMap;
import com.opengamma.master.AbstractMetaDataRequest;
import com.opengamma.util.PublicSPI;
/**
* Request for meta-data about the security master.
* <p>
* This will return meta-data valid for the whole master.
*/
@PublicSPI
@BeanDefinition
public class SecurityMetaDataRequest extends AbstractMetaDataRequest {
/**
* Whether to fetch the security types meta-data, true by default.
*/
@PropertyDefinition
private boolean _securityTypes = true;
/**
* Whether to fetch the db_schema_version, false by default.
*/
@PropertyDefinition
private boolean _schemaVersion;
/**
* Creates an instance.
*/
public SecurityMetaDataRequest() {
}
//------------------------- AUTOGENERATED START -------------------------
///CLOVER:OFF
/**
* The meta-bean for {@code SecurityMetaDataRequest}.
* @return the meta-bean, not null
*/
public static SecurityMetaDataRequest.Meta meta() {
return SecurityMetaDataRequest.Meta.INSTANCE;
}
static {
JodaBeanUtils.registerMetaBean(SecurityMetaDataRequest.Meta.INSTANCE);
}
@Override
public SecurityMetaDataRequest.Meta metaBean() {
return SecurityMetaDataRequest.Meta.INSTANCE;
}
//-----------------------------------------------------------------------
/**
* Gets whether to fetch the security types meta-data, true by default.
* @return the value of the property
*/
public boolean isSecurityTypes() {
return _securityTypes;
}
/**
* Sets whether to fetch the security types meta-data, true by default.
* @param securityTypes the new value of the property
*/
public void setSecurityTypes(boolean securityTypes) {
this._securityTypes = securityTypes;
}
/**
* Gets the the {@code securityTypes} property.
* @return the property, not null
*/
public final Property<Boolean> securityTypes() {
return metaBean().securityTypes().createProperty(this);
}
//-----------------------------------------------------------------------
/**
* Gets whether to fetch the db_schema_version, false by default.
* @return the value of the property
*/
public boolean isSchemaVersion() {
return _schemaVersion;
}
/**
* Sets whether to fetch the db_schema_version, false by default.
* @param schemaVersion the new value of the property
*/
public void setSchemaVersion(boolean schemaVersion) {
this._schemaVersion = schemaVersion;
}
/**
* Gets the the {@code schemaVersion} property.
* @return the property, not null
*/
public final Property<Boolean> schemaVersion() {
return metaBean().schemaVersion().createProperty(this);
}
//-----------------------------------------------------------------------
@Override
public SecurityMetaDataRequest clone() {
return JodaBeanUtils.cloneAlways(this);
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (obj != null && obj.getClass() == this.getClass()) {
SecurityMetaDataRequest other = (SecurityMetaDataRequest) obj;
return (isSecurityTypes() == other.isSecurityTypes()) &&
(isSchemaVersion() == other.isSchemaVersion()) &&
super.equals(obj);
}
return false;
}
@Override
public int hashCode() {
int hash = 7;
hash = hash * 31 + JodaBeanUtils.hashCode(isSecurityTypes());
hash = hash * 31 + JodaBeanUtils.hashCode(isSchemaVersion());
return hash ^ super.hashCode();
}
@Override
public String toString() {
StringBuilder buf = new StringBuilder(96);
buf.append("SecurityMetaDataRequest{");
int len = buf.length();
toString(buf);
if (buf.length() > len) {
buf.setLength(buf.length() - 2);
}
buf.append('}');
return buf.toString();
}
@Override
protected void toString(StringBuilder buf) {
super.toString(buf);
buf.append("securityTypes").append('=').append(JodaBeanUtils.toString(isSecurityTypes())).append(',').append(' ');
buf.append("schemaVersion").append('=').append(JodaBeanUtils.toString(isSchemaVersion())).append(',').append(' ');
}
//-----------------------------------------------------------------------
/**
* The meta-bean for {@code SecurityMetaDataRequest}.
*/
public static class Meta extends AbstractMetaDataRequest.Meta {
/**
* The singleton instance of the meta-bean.
*/
static final Meta INSTANCE = new Meta();
/**
* The meta-property for the {@code securityTypes} property.
*/
private final MetaProperty<Boolean> _securityTypes = DirectMetaProperty.ofReadWrite(
this, "securityTypes", SecurityMetaDataRequest.class, Boolean.TYPE);
/**
* The meta-property for the {@code schemaVersion} property.
*/
private final MetaProperty<Boolean> _schemaVersion = DirectMetaProperty.ofReadWrite(
this, "schemaVersion", SecurityMetaDataRequest.class, Boolean.TYPE);
/**
* The meta-properties.
*/
private final Map<String, MetaProperty<?>> _metaPropertyMap$ = new DirectMetaPropertyMap(
this, (DirectMetaPropertyMap) super.metaPropertyMap(),
"securityTypes",
"schemaVersion");
/**
* Restricted constructor.
*/
protected Meta() {
}
@Override
protected MetaProperty<?> metaPropertyGet(String propertyName) {
switch (propertyName.hashCode()) {
case -714180327: // securityTypes
return _securityTypes;
case -233564169: // schemaVersion
return _schemaVersion;
}
return super.metaPropertyGet(propertyName);
}
@Override
public BeanBuilder<? extends SecurityMetaDataRequest> builder() {
return new DirectBeanBuilder<SecurityMetaDataRequest>(new SecurityMetaDataRequest());
}
@Override
public Class<? extends SecurityMetaDataRequest> beanType() {
return SecurityMetaDataRequest.class;
}
@Override
public Map<String, MetaProperty<?>> metaPropertyMap() {
return _metaPropertyMap$;
}
//-----------------------------------------------------------------------
/**
* The meta-property for the {@code securityTypes} property.
* @return the meta-property, not null
*/
public final MetaProperty<Boolean> securityTypes() {
return _securityTypes;
}
/**
* The meta-property for the {@code schemaVersion} property.
* @return the meta-property, not null
*/
public final MetaProperty<Boolean> schemaVersion() {
return _schemaVersion;
}
//-----------------------------------------------------------------------
@Override
protected Object propertyGet(Bean bean, String propertyName, boolean quiet) {
switch (propertyName.hashCode()) {
case -714180327: // securityTypes
return ((SecurityMetaDataRequest) bean).isSecurityTypes();
case -233564169: // schemaVersion
return ((SecurityMetaDataRequest) bean).isSchemaVersion();
}
return super.propertyGet(bean, propertyName, quiet);
}
@Override
protected void propertySet(Bean bean, String propertyName, Object newValue, boolean quiet) {
switch (propertyName.hashCode()) {
case -714180327: // securityTypes
((SecurityMetaDataRequest) bean).setSecurityTypes((Boolean) newValue);
return;
case -233564169: // schemaVersion
((SecurityMetaDataRequest) bean).setSchemaVersion((Boolean) newValue);
return;
}
super.propertySet(bean, propertyName, newValue, quiet);
}
}
///CLOVER:ON
//-------------------------- AUTOGENERATED END --------------------------
}