Class PortfolioDTOConverter
java.lang.Object
com.bluebell.greenhouse.planter.converters.AbstractGenericDTOConverter<Portfolio, PortfolioDTO>
com.bluebell.greenhouse.planter.converters.AbstractGenericEntityDTOConverter<Portfolio, PortfolioDTO>
com.bluebell.greenhouse.planter.converters.portfolio.PortfolioDTOConverter
- All Implemented Interfaces:
GenericDTOConverter<Portfolio, PortfolioDTO>
@Component("portfolioDTOConverter")
public class PortfolioDTOConverter
extends AbstractGenericEntityDTOConverter<Portfolio, PortfolioDTO>
Converts
Portfolios into PortfolioDTOs.- Version:
- 3.0.6
- Author:
- Stephen Prizio
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertAll(Collection<Portfolio> entities) Converts a page ofPortfolios, resolving every account's ledger figures in one batch.convertAll(Collection<Portfolio> entities, Map<Long, AccountLedgerSummary> summaries) Converts portfolios using ledger figures an enclosing conversion already resolved.protected PortfolioDTOconvertNonNull(Portfolio entity) Converts aPortfoliointo aPortfolioDTO.protected PortfolioDTOCreates the empty DTO returned for a null source.summariseAccounts(Collection<Portfolio> entities) Resolves the ledger figures for every account held by the given portfolios, in one batch.Methods inherited from class AbstractGenericEntityDTOConverter
afterConvertMethods inherited from class AbstractGenericDTOConverter
convert
-
Constructor Details
-
PortfolioDTOConverter
public PortfolioDTOConverter()
-
-
Method Details
-
convertAll
Converts a page ofPortfolios, resolving every account's ledger figures in one batch.- Parameters:
entities-CollectionofPortfolios- Returns:
ListofPortfolioDTO
-
convertAll
public List<PortfolioDTO> convertAll(Collection<Portfolio> entities, Map<Long, AccountLedgerSummary> summaries) Converts portfolios using ledger figures an enclosing conversion already resolved.- Parameters:
entities-CollectionofPortfoliossummaries- ledger figures keyed by account id- Returns:
ListofPortfolioDTO
-
summariseAccounts
Resolves the ledger figures for every account held by the given portfolios, in one batch.- Parameters:
entities-CollectionofPortfolios- Returns:
- ledger figures keyed by account id
-
convertNonNull
Converts aPortfoliointo aPortfolioDTO.- Specified by:
convertNonNullin classAbstractGenericDTOConverter<Portfolio, PortfolioDTO>- Parameters:
entity-Portfolio- Returns:
PortfolioDTO
-
createEmptyDTO
Creates the empty DTO returned for a null source.- Specified by:
createEmptyDTOin classAbstractGenericDTOConverter<Portfolio, PortfolioDTO>- Returns:
- empty DTO
-