/** * Utility returning a copy of the "base" of this instance * This utility does not copy the associations with other instances * * @return a clone of this instance */ public EnergyConsumer clone() { EnergyConsumer newInstance = new EnergyConsumer(this); EnergyConsumer newInstanceSP = newInstance; return newInstanceSP; }
/** * Factory of the class * * @param id * id of the class EnergyConsumer to create * @return the class created */ public static EnergyConsumer create(final String id) { EnergyConsumer newEnergyConsumer = new EnergyConsumer(); newEnergyConsumer.setId(id); return newEnergyConsumer; }
EnergyConsumer newEnergyConsumer = new EnergyConsumer();