Package org.silverpeas.core.contribution
Interface ContributionVisibility
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
DefaultContributionVisibility
,Visibility
public interface ContributionVisibility extends Serializable
Represents the visibility state of a given contribution.- Author:
- silveryocha
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Period
getPeriod()
Gets the actual period of visibility of a contribution.Optional<Period>
getSpecificPeriod()
Gets the period of visibility which has been specifically set.default boolean
hasBeenActive()
Indicates if the visibility has been active beforeOffsetDateTime.now()
.default boolean
isActive()
Indicates if the visibility is active atOffsetDateTime.now()
.default boolean
willBeActive()
Indicates if the visibility will be active afterOffsetDateTime.now()
.
-
-
-
Method Detail
-
getSpecificPeriod
Optional<Period> getSpecificPeriod()
Gets the period of visibility which has been specifically set.- 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
Period getPeriod()
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
getSpecificPeriod()
returns a not empty result, then the period is taken into account.
If the last update date of theContribution
is greater than the begin date of the specific period, then the start date of returned period is overridden with the last update date ofContribution
.- Returns:
- a period instance.
-
isActive
default boolean isActive()
Indicates if the visibility is active atOffsetDateTime.now()
.- Returns:
- true if active, false otherwise
-
willBeActive
default boolean willBeActive()
Indicates if the visibility will be active afterOffsetDateTime.now()
.- Returns:
- true if it will be active, false otherwise
-
hasBeenActive
default boolean hasBeenActive()
Indicates if the visibility has been active beforeOffsetDateTime.now()
.- Returns:
- true if it has been active, false otherwise
-
-