/** * Copyright (C) 2014 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.sesame.marketdata; import java.util.Map; import java.util.NoSuchElementException; import java.util.Set; import org.joda.beans.BeanDefinition; import org.joda.beans.ImmutableBean; import org.joda.beans.JodaBeanUtils; import org.joda.beans.MetaProperty; import org.joda.beans.Property; import org.joda.beans.impl.direct.DirectFieldsBeanBuilder; import org.joda.beans.impl.direct.DirectMetaBean; import org.joda.beans.impl.direct.DirectMetaPropertyMap; import com.opengamma.engine.marketdata.spec.MarketDataSpecification; /** * Placeholder market data specification used in cases when no market data is specification is needed */ @BeanDefinition public final class EmptyMarketDataSpec implements MarketDataSpecification, ImmutableBean { /** * Create an instance of the EmptyMarketDataSpec */ public static final EmptyMarketDataSpec INSTANCE = new EmptyMarketDataSpec(); //------------------------- AUTOGENERATED START ------------------------- ///CLOVER:OFF /** * The meta-bean for {@code EmptyMarketDataSpec}. * @return the meta-bean, not null */ public static EmptyMarketDataSpec.Meta meta() { return EmptyMarketDataSpec.Meta.INSTANCE; } static { JodaBeanUtils.registerMetaBean(EmptyMarketDataSpec.Meta.INSTANCE); } /** * Returns a builder used to create an instance of the bean. * @return the builder, not null */ public static EmptyMarketDataSpec.Builder builder() { return new EmptyMarketDataSpec.Builder(); } private EmptyMarketDataSpec() { } @Override public EmptyMarketDataSpec.Meta metaBean() { return EmptyMarketDataSpec.Meta.INSTANCE; } @Override public <R> Property<R> property(String propertyName) { return metaBean().<R>metaProperty(propertyName).createProperty(this); } @Override public Set<String> propertyNames() { return metaBean().metaPropertyMap().keySet(); } //----------------------------------------------------------------------- @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj != null && obj.getClass() == this.getClass()) { return true; } return false; } @Override public int hashCode() { int hash = getClass().hashCode(); return hash; } @Override public String toString() { StringBuilder buf = new StringBuilder(32); buf.append("EmptyMarketDataSpec{"); buf.append('}'); return buf.toString(); } //----------------------------------------------------------------------- /** * The meta-bean for {@code EmptyMarketDataSpec}. */ public static final class Meta extends DirectMetaBean { /** * The singleton instance of the meta-bean. */ static final Meta INSTANCE = new Meta(); /** * The meta-properties. */ private final Map<String, MetaProperty<?>> _metaPropertyMap$ = new DirectMetaPropertyMap( this, null); /** * Restricted constructor. */ private Meta() { } @Override public EmptyMarketDataSpec.Builder builder() { return new EmptyMarketDataSpec.Builder(); } @Override public Class<? extends EmptyMarketDataSpec> beanType() { return EmptyMarketDataSpec.class; } @Override public Map<String, MetaProperty<?>> metaPropertyMap() { return _metaPropertyMap$; } //----------------------------------------------------------------------- } //----------------------------------------------------------------------- /** * The bean-builder for {@code EmptyMarketDataSpec}. */ public static final class Builder extends DirectFieldsBeanBuilder<EmptyMarketDataSpec> { /** * Restricted constructor. */ private Builder() { } //----------------------------------------------------------------------- @Override public Object get(String propertyName) { throw new NoSuchElementException("Unknown property: " + propertyName); } @Override public Builder set(String propertyName, Object newValue) { throw new NoSuchElementException("Unknown property: " + propertyName); } @Override public Builder set(MetaProperty<?> property, Object value) { super.set(property, value); return this; } @Override public Builder setString(String propertyName, String value) { setString(meta().metaProperty(propertyName), value); return this; } @Override public Builder setString(MetaProperty<?> property, String value) { super.setString(property, value); return this; } @Override public Builder setAll(Map<String, ? extends Object> propertyValueMap) { super.setAll(propertyValueMap); return this; } @Override public EmptyMarketDataSpec build() { return new EmptyMarketDataSpec(); } //----------------------------------------------------------------------- @Override public String toString() { return "EmptyMarketDataSpec.Builder{}"; } } ///CLOVER:ON //-------------------------- AUTOGENERATED END -------------------------- }