com.opengamma.strata.market.param.ParameterMetadata Maven / Gradle / Ivy
Show all versions of strata-market Show documentation
/*
* Copyright (C) 2016 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.strata.market.param;
import java.util.Collections;
import java.util.List;
import org.joda.beans.ImmutableBean;
/**
* Information about a single parameter.
*
* Implementations of this interface are used to store metadata about a parameter.
* Parameters are an abstraction over curves, surfaces and other types of data.
*/
public interface ParameterMetadata
extends ImmutableBean {
/**
* Gets an empty metadata instance.
*
* This is used when the actual metadata is not known.
*
* @return the empty instance
*/
public static ParameterMetadata empty() {
return EmptyParameterMetadata.empty();
}
/**
* Gets a list of empty metadata instances.
*
* This is used when there the actual metadata is not known.
*
* @param size the size of the resulting list
* @return the empty instance
*/
public static List listOfEmpty(int size) {
return Collections.nCopies(size, EmptyParameterMetadata.empty());
}
//-------------------------------------------------------------------------
/**
* Gets the label that describes the parameter.
*
* It is intended that the label is relatively short, however there is no formal restriction.
*
* @return the label
*/
public abstract String getLabel();
/**
* Returns an object used to identify the parameter.
*
* A good choice of identifier is one that makes sense to the user and can easily be created as part of a
* scenario definition. For example, many nodes types are naturally identified by a tenor.
*
* The identifier must satisfy the following criteria:
*
* - It must be non-null
* - It should be unique within a single data set
* - It should have a sensible implementation of {@code hashCode()} and {@code equals()}.
*
* Otherwise the choice of identifier is free and the system makes no assumptions about it.
*
* @return an object used to uniquely identify the parameter within the data
*/
public abstract Object getIdentifier();
}