Package com.opengamma.livedata.resolver

Source Code of com.opengamma.livedata.resolver.NaiveDistributionSpecificationResolver

/**
* Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.livedata.resolver;

import com.opengamma.livedata.LiveDataSpecification;
import com.opengamma.livedata.normalization.StandardRules;
import com.opengamma.livedata.server.DistributionSpecification;

/**
* A naive implementation of {@code DistributionSpecificationResolver}.
* <p>
* This class is only useful in tests.
*/
public class NaiveDistributionSpecificationResolver
  extends AbstractResolver<LiveDataSpecification, DistributionSpecification>
  implements DistributionSpecificationResolver {

  @Override
  public DistributionSpecification resolve(
      LiveDataSpecification spec) throws IllegalArgumentException {
    return new DistributionSpecification(
        spec.getIdentifiers().getExternalIds().iterator().next(),
        StandardRules.getNoNormalization(),
        spec.getIdentifiers().toString());
  }

}
TOP

Related Classes of com.opengamma.livedata.resolver.NaiveDistributionSpecificationResolver

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.