Class DefaultContributionVisibility

    • Constructor Detail

      • DefaultContributionVisibility

        protected DefaultContributionVisibility​(Contribution contribution,
                                                Period specificPeriod)
    • Method Detail

      • getSpecificPeriod

        public Optional<Period> getSpecificPeriod()
        Description copied from interface: ContributionVisibility
        Gets the period of visibility which has been specifically set.
        Specified by:
        getSpecificPeriod in interface ContributionVisibility
        Returns:
        an optional Period, filled if a period has been specifically set. If no specific period has been set, otherwise if it is default visibility period of the contribution that is taken, then returns nothing (empty optional).
      • getPeriod

        public Period getPeriod()
        Description copied from interface: ContributionVisibility
        Gets the actual period of visibility of a contribution.

        If no specific period is set, by default the period taken into account is the never ending duration starting at the date of the last contribution update.

        If a period has been specifically set, so ContributionVisibility.getSpecificPeriod() returns a not empty result, then the period is taken into account.
        If the last update date of the Contribution is greater than the begin date of the specific period, then the start date of returned period is overridden with the last update date of Contribution.

        Specified by:
        getPeriod in interface ContributionVisibility
        Returns:
        a period instance.