Class PunchcardDetailsPresenter<T extends PunchcardDetailsView>

    • Constructor Detail

      • PunchcardDetailsPresenter

        public PunchcardDetailsPresenter​(java.lang.String punchcardId)
        Default constructor that accepts Punchcard id. Using this constructor creates a default PunchcardParams for Punchcard Details
        Parameters:
        punchcardId - id/name of the punchcard to get details
      • PunchcardDetailsPresenter

        public PunchcardDetailsPresenter​(java.lang.String punchcardId,
                                         PunchcardParams punchcardParams)
        Constructor of the presenter which accepts a String as a parameter
        Parameters:
        punchcardId - internal name of the punchcard
        punchcardParams - query params for Punchcard API
    • Method Detail

      • getPunchcardType

        public void getPunchcardType()
        Get punchcard type
      • onPunchcardReceivedSuccess

        protected void onPunchcardReceivedSuccess​(Punchcard data)
        Called when receiving response from PunchcardAPI
        Parameters:
        data - response received in formatted using Punchcard model
      • onPunchcardReceivedFail

        protected void onPunchcardReceivedFail​(java.lang.String error)
        Called when failing to receive response from PunchcardAPI
        Parameters:
        error - message describing the details of the error
      • onPunchcardInstanceReceivedSuccess

        protected void onPunchcardInstanceReceivedSuccess​(PunchcardInstance data)
        Called when receiving response from PunchcardAPI
        Parameters:
        data - response received in formatted using PunchcardInstance model
      • onPunchcardInstanceReceivedFailed

        protected void onPunchcardInstanceReceivedFailed​(java.lang.String error)
        Called when failing to receive response from PunchcardAPI
        Parameters:
        error - message describing the details of the error
      • getRewardPoints

        protected java.lang.String getRewardPoints​(java.util.List<PunchcardReward> rewards)
        Parse the reward points from the list of PunchcardReward
        Parameters:
        rewards - list used to check for the points
        Returns:
        reward points in string format
      • getPunchcardInstancePunches

        protected java.util.List<Punch> getPunchcardInstancePunches​(java.lang.Object data)
        Get the list of Punch based on the required punches, current punches and max allowed punches
        Parameters:
        data - instance of Punchcard or PunchcardInstance
        Returns:
        total Punch generated from Punchcard/PunchcardInstance