Class FreakliesShopVoucher

java.lang.Object
de.calamanari.pk.factorymethod.AbstractVoucher
de.calamanari.pk.factorymethod.FreakliesShopVoucher

public class FreakliesShopVoucher
extends AbstractVoucher
FreakliesShop Voucher (Voucher from the little shop owned by Mrs. Freakly in Chicago) is a concrete product in this FACTORY METHOD example scenario.
Author:
Karl Eilebrecht
  • Constructor Summary

    Constructors
    Constructor Description
    FreakliesShopVoucher​(int serialNumber, java.lang.String firstName, java.lang.String lastName, double value)
    Creates a new voucher.
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getId()
    Returns this voucher's ID
    int getSerialNumber()
    Returns the serialNumber that was specified initially.
    java.lang.String getVoucherDisplayCode()
    Returns the human readable code of this voucher, the user will enter when applying it to an order.

    Methods inherited from class de.calamanari.pk.factorymethod.AbstractVoucher

    getFirstName, getLastName, getValue, setFirstName, setLastName, setValue, toString

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FreakliesShopVoucher

      public FreakliesShopVoucher​(int serialNumber, java.lang.String firstName, java.lang.String lastName, double value)
      Creates a new voucher.
      Parameters:
      serialNumber - identifies the voucher
      firstName - first name of the voucher owner
      lastName - last name of the voucher owner
      value - voucher's value
  • Method Details

    • getId

      public java.lang.String getId()
      Description copied from class: AbstractVoucher
      Returns this voucher's ID
      Specified by:
      getId in class AbstractVoucher
      Returns:
      id of voucher
    • getVoucherDisplayCode

      public java.lang.String getVoucherDisplayCode()
      Description copied from class: AbstractVoucher
      Returns the human readable code of this voucher, the user will enter when applying it to an order.
      Specified by:
      getVoucherDisplayCode in class AbstractVoucher
      Returns:
      display code
    • getSerialNumber

      public int getSerialNumber()
      Returns the serialNumber that was specified initially.
      Returns:
      serial number of this FreakliesShop Voucher