HashtagsXRep/hashtagsxrep

View on GitHub
src/main/java/cat/xarxarepublicana/hashtagsxrep/domain/poll/Proposal.java

Summary

Maintainability
A
1 hr
Test Coverage
package cat.xarxarepublicana.hashtagsxrep.domain.poll;

import java.time.LocalDateTime;

public class Proposal {

  private final String pollId;
  private final String authorId;
  private final String authorNickname;
  private final LocalDateTime creationDate;
  private final Integer votes;
  private String hashtag;
  private String subject;
  private String cancelationReason;
  private String moderatorNickname;

  public Proposal(
      String pollId,
      String authorId,
      String authorNickname,
      String hashtag,
      String subject,
      String cancelationReason,
      String moderatorNickname,
      LocalDateTime creationDate,
      Integer votes) {
    this.pollId = pollId;
    this.authorId = authorId;
    this.authorNickname = authorNickname;
    this.hashtag = hashtag;
    this.subject = subject;
    this.cancelationReason = cancelationReason;
    this.moderatorNickname = moderatorNickname;
    this.creationDate = creationDate;
    this.votes = votes;
  }

  public void update(String hashtag, String subject) {
    this.hashtag = hashtag;
    this.subject = subject;
    this.cancelationReason = null;
    this.moderatorNickname = null;
  }

  public void update(String hashtag, String subject, String cancelationReason, String moderatorNickname) {
    this.hashtag = hashtag;
    this.subject = subject;
    this.cancelationReason = cancelationReason;
    this.moderatorNickname = moderatorNickname;
  }

  public String getPollId() {
    return pollId;
  }

  public String getAuthorId() {
    return authorId;
  }

  public String getAuthorNickname() {
    return authorNickname;
  }

  public String getHashtag() {
    return hashtag;
  }

  public String getSubject() {
    return subject;
  }

  public LocalDateTime getCreationDate() {
    return creationDate;
  }

  public Integer getVotes() {
    return votes;
  }

  public String getCancelationReason() {
    return cancelationReason;
  }

  public String getModeratorNickname() {
    return moderatorNickname;
  }
}