/** * Declare the extensions of the feeds for the Google Finance Portfolio Data * API. */ private void declareExtensions() { new PortfolioFeed().declareExtensions(extProfile); new PositionFeed().declareExtensions(extProfile); new TransactionFeed().declareExtensions(extProfile); }
/** * Returns the gain for the portfolio in the portfolio default currency. * * @return gain for the portfolio in the portfolio default currency */ public Gain getGain() { return getExtension(Gain.class); }
/** * Sets the 4 week return (percentage). * * @param return4w 4 week return (percentage) or <code>null</code> to reset */ public void setReturn4w(Double return4w) { throwExceptionIfImmutable(); this.return4w = return4w; }
/** * Returns the monetary value of the total gain. * * @return monetary value of the total gain */ public List<Money> getMoney() { return getRepeatingExtension(Money.class); }
/** * Returns whether it has the market value of the position in the portfolio * default currency (and exchange currency if it differs). * * @return whether it has the market value of the position in the portfolio * default currency (and exchange currency if it differs) */ public boolean hasMarketValue() { return hasExtension(MarketValue.class); }
/** * Returns whether it has the 5 year return (percentage). * * @return whether it has the 5 year return (percentage) */ public boolean hasReturn5y() { return getReturn5y() != null; }
/** * Returns the data for the transaction. * * @return data for the transaction */ public TransactionData getTransactionData() { return getExtension(TransactionData.class); }
/** * Returns whether it has the data for the transaction. * * @return whether it has the data for the transaction */ public boolean hasTransactionData() { return hasExtension(TransactionData.class); }
/** * Returns whether it has the cost basis of the portfolio in the portfolio * default currency. * * @return whether it has the cost basis of the portfolio in the portfolio * default currency */ public boolean hasCostBasis() { return hasExtension(CostBasis.class); }
/** * Sets the overall return (percentage). * * @param returnOverall overall return (percentage) or <code>null</code> to * reset */ public void setReturnOverall(Double returnOverall) { throwExceptionIfImmutable(); this.returnOverall = returnOverall; }
/** * Returns whether it has the full name for the company or mutual fund. * * @return whether it has the full name for the company or mutual fund */ public boolean hasFullName() { return getFullName() != null; }
/** * Returns whether it has the number of shares involved in the transaction. * * @return whether it has the number of shares involved in the transaction */ public boolean hasShares() { return getShares() != null; }
/** * Sets the type for the transaction (can be "Buy", "Sell", "Buy to Cover" or * "Sell Short"). * * @param type type for the transaction (can be "Buy", "Sell", "Buy to Cover" * or "Sell Short") or <code>null</code> to reset */ public void setType(String type) { throwExceptionIfImmutable(); this.type = type; }
/** * Returns whether it has the 1 year return (percentage). * * @return whether it has the 1 year return (percentage) */ public boolean hasReturn1y() { return getReturn1y() != null; }
/** * Returns whether it has the monetary value of the commission. * * @return whether it has the monetary value of the commission */ public boolean hasMoney() { return hasRepeatingExtension(Money.class); }
/** * Returns whether it has the monetary value of the cost basis. * * @return whether it has the monetary value of the cost basis */ public boolean hasMoney() { return hasRepeatingExtension(Money.class); }
/** * Declare the extensions of the feeds for the Google Finance Portfolio Data * API. */ private void declareExtensions() { new PortfolioFeed().declareExtensions(extProfile); new PositionFeed().declareExtensions(extProfile); new TransactionFeed().declareExtensions(extProfile); }
/** * Returns the cost basis of the portfolio in the portfolio default currency. * * @return cost basis of the portfolio in the portfolio default currency */ public CostBasis getCostBasis() { return getExtension(CostBasis.class); }
/** * Sets the 5 year return (percentage). * * @param return5y 5 year return (percentage) or <code>null</code> to reset */ public void setReturn5y(Double return5y) { throwExceptionIfImmutable(); this.return5y = return5y; }
/** * Returns the today's gain for the portfolio in the portfolio default * currency. * * @return today's gain for the portfolio in the portfolio default currency */ public DaysGain getDaysGain() { return getExtension(DaysGain.class); }