*
* @author Thomas Pantelis
*/
-public class ImmutableElectionTerm implements ElectionTerm {
+public final class ImmutableElectionTerm implements ElectionTerm {
private final long currentTerm;
private final String votedFor;
- private ImmutableElectionTerm(long currentTerm, String votedFor) {
+ private ImmutableElectionTerm(final long currentTerm, final String votedFor) {
this.currentTerm = currentTerm;
this.votedFor = votedFor;
}
}
@Override
- public void update(long newTerm, String newVotedFor) {
+ public void update(final long newTerm, final String newVotedFor) {
throw new UnsupportedOperationException();
}
@Override
- public void updateAndPersist(long newTerm, String newVotedFor) {
+ public void updateAndPersist(final long newTerm, final String newVotedFor) {
throw new UnsupportedOperationException();
}
return "ImmutableElectionTerm [currentTerm=" + currentTerm + ", votedFor=" + votedFor + "]";
}
- public static ElectionTerm copyOf(ElectionTerm from) {
+ public static ElectionTerm copyOf(final ElectionTerm from) {
return new ImmutableElectionTerm(from.getCurrentTerm(), from.getVotedFor());
}
}