
com.opengamma.strata.product.PortfolioItemInfoBuilder Maven / Gradle / Ivy
Show all versions of strata-product Show documentation
/*
* Copyright (C) 2016 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.strata.product;
import com.opengamma.strata.basics.StandardId;
/**
* Interface across the various info builder classes.
*
* @param the info class type
*/
public interface PortfolioItemInfoBuilder {
/**
* Sets the primary identifier for the position, optional.
*
* The identifier is used to identify the position.
*
* @param id the identifier
* @return this, for chaining
*/
public abstract PortfolioItemInfoBuilder id(StandardId id);
/**
* Adds a position attribute to the map of attributes.
*
* The attribute is added using {@code Map.put(type, value)} semantics.
*
* @param the type of the value
* @param attributeType the type providing meaning to the value
* @param attributeValue the value
* @return this, for chaining
*/
@SuppressWarnings("unchecked")
public abstract PortfolioItemInfoBuilder addAttribute(AttributeType attributeType, V attributeValue);
/**
* Builds the position information.
*
* @return the position information
*/
public abstract T build();
}