class RaftState implements ReadableRaftState {

    public void update( Outcome outcome ) throws IOException
    {
        if ( termState().update( outcome.getTerm() ) )
        {
            termStorage.persistStoreData( termState() );
        }
        if ( voteState().update( outcome.getVotedFor(), outcome.getTerm() ) )
        {
            voteStorage.persistStoreData( voteState() );
        }

        logIfLeaderChanged( outcome.getLeader() );
        leader = outcome.getLeader();
        leaderInfo = new LeaderInfo( outcome.getLeader(), outcome.getTerm() );

        leaderCommit = outcome.getLeaderCommit();
        votesForMe = outcome.getVotesForMe();
        preVotesForMe = outcome.getPreVotesForMe();
        heartbeatResponses = outcome.getHeartbeatResponses();
        lastLogIndexBeforeWeBecameLeader = outcome.getLastLogIndexBeforeWeBecameLeader();
        followerStates = outcome.getFollowerStates();
        isPreElection = outcome.isPreElection();

        for ( RaftLogCommand logCommand : outcome.getLogCommands() )
        {
            logCommand.applyTo( entryLog, log );
            logCommand.applyTo( inFlightCache, log );
        }
        commitIndex = outcome.getCommitIndex();
    }

    public  RaftState( MemberId myself,
                      StateStorage<TermState> termStorage,
                      RaftMembership membership,
                      RaftLog entryLog,
                      StateStorage<VoteState> voteStorage,
                      InFlightCache inFlightCache, LogProvider logProvider, boolean supportPreVoting,
                      boolean refuseToBeLeader
            );

}