/** * Creates a portfolio entry object. * * @param portfolioName the name of the new portfolio. e.g. "Oil & Gas". * This is required when creating a portfolio, but optional when updating. * @param currencyCode the ISO4217 currency code for the portfolio. * e.g. USD, EUR, JPY, GBP, CAD, HKD, etc. * This is required when creating a portfolio, but optional when updating. * @return the newly created portfolio entry * @throws IOException If there is a problem communicating with the server. * @throws MalformedURLException If the URL is invalid. * @throws ServiceException If the service is unable to handle the request. */ public static PortfolioEntry makePortfolioEntry(String portfolioName, String currencyCode) { PortfolioEntry entry = new PortfolioEntry(); if (!portfolioName.equals("")) entry.setTitle(new PlainTextConstruct(portfolioName)); PortfolioData data = new PortfolioData(); if (!currencyCode.equals("")) data.setCurrencyCode(currencyCode); entry.setPortfolioData(data); return entry; }
/** * Creates a portfolio entry object. * * @param portfolioName the name of the new portfolio. e.g. "Oil & Gas". * This is required when creating a portfolio, but optional when updating. * @param currencyCode the ISO4217 currency code for the portfolio. * e.g. USD, EUR, JPY, GBP, CAD, HKD, etc. * This is required when creating a portfolio, but optional when updating. * @return the newly created portfolio entry * @throws IOException If there is a problem communicating with the server. * @throws MalformedURLException If the URL is invalid. * @throws ServiceException If the service is unable to handle the request. */ public static PortfolioEntry makePortfolioEntry(String portfolioName, String currencyCode) { PortfolioEntry entry = new PortfolioEntry(); if (!portfolioName.equals("")) entry.setTitle(new PlainTextConstruct(portfolioName)); PortfolioData data = new PortfolioData(); if (!currencyCode.equals("")) data.setCurrencyCode(currencyCode); entry.setPortfolioData(data); return entry; }