package beaform.gui;

import beaform.Ingredient;
import beaform.entities.Formula;

/**
 * This class represents a formula for use in a treeview
 *
 * @author steven
 *
 */
public class TreeViewFormula {
	private final Formula formula;
	private final String amount;

	public TreeViewFormula(final Formula formula) {
		this.formula = formula;
		this.amount = "";
	}

	public TreeViewFormula(final Ingredient ingredient) {
		this.formula = ingredient.getFormula();
		this.amount = ingredient.getAmount();
	}

	@Override
	public String toString() {
		return this.formula.getName();
	}

	public Formula getFormula() {
		return this.formula;
	}

	public String getAmount() {
		return this.amount;
	}

}

package beaform.gui;

import beaform.Ingredient;
import beaform.entities.Formula;

/**
 * This class represents a formula for use in a tree view.
 *
 * @author Steven Post
 *
 */
public class TreeViewFormula {

	/** The formula this object represents */
	private final Formula formula;

	/** The amount of this formula in the total view of the tree */
	private final String amount;

	/**
	 * Constructor.
	 *
	 * @param formula The formula this object needs to represent
	 */
	public TreeViewFormula(final Formula formula) {
		this.formula = formula;
		this.amount = "";
	}

	/**
	 * Constructor.
	 *
	 * @param ingredient The ingredient this object needs to represent
	 */
	public TreeViewFormula(final Ingredient ingredient) {
		this.formula = ingredient.getFormula();
		this.amount = ingredient.getAmount();
	}

	/**
	 * A toString implementation
	 *
	 * @return name of the formula this object represents
	 */
	@Override
	public String toString() {
		return this.formula.getName();
	}

	/**
	 * Getter for the formula that this object is representing.
	 *
	 * @return The formula this object is representing
	 */
	public Formula getFormula() {
		return this.formula;
	}

	/**
	 * Getter for the amount of this formula in the whole.
	 * @return the amount
	 */
	public String getAmount() {
		return this.amount;
	}

}

Fix multiple PMD errors