Class ContributionValidation

  • All Implemented Interfaces:
    Serializable

    @Embeddable
    public class ContributionValidation
    extends Object
    implements Serializable
    This embeddable entity permits to get a common management of contribution validation persistence.
    Author:
    Yohann Chastagnier
    See Also:
    Serialized Form
    • Constructor Detail

      • ContributionValidation

        public ContributionValidation()
        Constructs an empty contribution validation.
      • ContributionValidation

        public ContributionValidation​(ContributionStatus status,
                                      User validator,
                                      Date validationDate)
        Constructs a contribution validation that was done by the specified validator at the given date.
        Parameters:
        status - the status of the validation.
        validator - the validator that emitted this validation.
        validationDate - the date at which this validation was done.
      • ContributionValidation

        public ContributionValidation​(ContributionStatus status,
                                      User validator,
                                      Date validationDate,
                                      String comment)
        Constructs a contribution validation that was done by the specified validator at the given date and with the specified comment.
        Parameters:
        status - the status of the validation.
        validator - the validator that emitted this validation.
        validationDate - the date at which this validation was done.
        comment - the comment about validation done by the validator.
    • Method Detail

      • isInDraft

        public boolean isInDraft()
        Is that the status of the contribution is draft?
        Returns:
        true if it is the case, false otherwise.
      • isRefused

        public boolean isRefused()
        Is that the status of the contribution is refused?
        Returns:
        true if it is the case, false otherwise.
      • isPendingValidation

        public boolean isPendingValidation()
        Is that the status of the contribution is pending validation?
        Returns:
        true if it is the case, false otherwise.
      • isValidated

        public boolean isValidated()
        Is that the status of the contribution is validated?
        Returns:
        true if it is the case, false otherwise.
      • getStatus

        public ContributionStatus getStatus()
        Gets the status of the validation of the contribution.
        Returns:
        the status of the validation of the contribution.
      • setStatus

        public void setStatus​(ContributionStatus status)
        Sets the status of the effective validation of the contribution.
        Parameters:
        status - the status of the validation.
      • getDate

        public Date getDate()
        Gets the date of the validation of the contribution.
        Returns:
        the date of the validation of the contribution.
      • setDate

        public void setDate​(Date validationDate)
        Sets the date of the effective validation of the contribution.
        Parameters:
        validationDate - the date of the validation.
      • getComment

        public String getComment()
        Gets the comment written by the validator of the contribution.
        Returns:
        the comment written by a validator.
      • setComment

        public void setComment​(String validationComment)
        Sets the comment written by the validator of the contribution.
        Parameters:
        validationComment - the comment written by the validator.
      • getValidator

        public User getValidator()
        Gets the validator of the contribution.
        Returns:
        a user detail object that represents the validator of the contribution.
      • setValidationBy

        public void setValidationBy​(String validatedBy)
        Sets the validator of the contribution.
        Parameters:
        validatedBy - the identifier of the validator of the contribution.
      • setValidator

        public void setValidator​(User validator)
        Sets the validator of the contribution.
        Parameters:
        validator - the validator of the contribution.