org.silverpeas.contribution.model
Class ContributionValidation

java.lang.Object
  extended by org.silverpeas.contribution.model.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 Summary
ContributionValidation()
          Constructs an empty contribution validation.
ContributionValidation(ContributionStatus status, UserDetail validator, Date validationDate)
          Constructs a contribution validation that was done by the specified validator at the given date.
ContributionValidation(ContributionStatus status, UserDetail 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.
 
Method Summary
 String getComment()
          Gets the comment written by the validator of the contribution.
 Date getDate()
          Gets the date of the validation of the contribution.
 ContributionStatus getStatus()
          Gets the status of the validation of the contribution.
 UserDetail getValidator()
          Gets the validator of the contribution.
 boolean isInDraft()
          Is that the status of the contribution is draft?
 boolean isPendingValidation()
          Is that the status of the contribution is pending validation?
 boolean isRefused()
          Is that the status of the contribution is refused?
 boolean isValidated()
          Is that the status of the contribution is validated?
 void setComment(String validationComment)
          Sets the comment written by the validator of the contribution.
 void setDate(Date validationDate)
          Sets the date of the effective validation of the contribution.
 void setStatus(ContributionStatus status)
          Sets the status of the effective validation of the contribution.
 void setValidator(UserDetail validator)
          Sets the validator of the contribution.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContributionValidation

public ContributionValidation()
Constructs an empty contribution validation.


ContributionValidation

public ContributionValidation(ContributionStatus status,
                              UserDetail 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,
                              UserDetail 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 UserDetail getValidator()
Gets the validator of the contribution.

Returns:
a user detail object that represents the validator of the contribution.

setValidator

public void setValidator(UserDetail validator)
Sets the validator of the contribution.

Parameters:
validator - the validator of the contribution.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2016 Silverpeas. All Rights Reserved.