src/main/java/com/tallcraft/chatreplay/ChatReplay.java
/**
     * Update existing chatBuffer or create a new one with config options
     */
Update existing chatBuffer or create a new one with config options
Update existing chatBuffer or create a new one with config options
private void configureBuffer() {
        int bufferSize = config.getInt("bufferSize");
        int viewSize = config.getInt("viewSize");
        if (bufferSize <= 0) {
            throw new IllegalArgumentException(this.getName() + ": Invalid bufferSize " + bufferSize + "! Must be greater 0");
        }
        if (viewSize > bufferSize) {
            throw new IllegalArgumentException(this.getName() + ": Invalid viewSize. Can not be smaller than total buffer size");
        }
        String timestampFormat = config.getString("timestampFormat");
        String replayHeader = config.getString("replayHeader");
        String replayFooter = config.getString("replayFooter");
        String replayMsgFormat = config.getString("replayMsgFormat");
        String replayMsgHover = config.getString("replayMsgHover");
        String navigateHistoryButtonText = config.getString("navigateHistoryButtonText");
        if (chatBuffer == null) {
            chatBuffer = new ChatBuffer(
                    bufferSize,
                    viewSize,
                    timestampFormat,
                    replayHeader,
                    replayFooter,
                    replayMsgFormat,
                    replayMsgHover,
                    navigateHistoryButtonText);
        } else {
            chatBuffer.setBufferSize(bufferSize);
            chatBuffer.setViewSize(viewSize);
            chatBuffer.setTimestampFormat(timestampFormat);
            chatBuffer.setReplayHeader(replayHeader);
            chatBuffer.setReplayFooter(replayFooter);
            chatBuffer.setReplayMsgFormat(replayMsgFormat);
            chatBuffer.setReplayMsgHover(replayMsgHover);
            chatBuffer.setNavigateHistoryButtonText(navigateHistoryButtonText);
        }
    }
private void configureBuffer ( ) { int bufferSize = config . getInt ( "bufferSize" ) ; int viewSize = config . getInt ( "viewSize" ) ; if ( bufferSize <= 0 ) { throw new IllegalArgumentException ( this . getName ( ) + ": Invalid bufferSize " + bufferSize + "! Must be greater 0" ) ; } if ( viewSize > bufferSize ) { throw new IllegalArgumentException ( this . getName ( ) + ": Invalid viewSize. Can not be smaller than total buffer size" ) ; } String timestampFormat = config . getString ( "timestampFormat" ) ; String replayHeader = config . getString ( "replayHeader" ) ; String replayFooter = config . getString ( "replayFooter" ) ; String replayMsgFormat = config . getString ( "replayMsgFormat" ) ; String replayMsgHover = config . getString ( "replayMsgHover" ) ; String navigateHistoryButtonText = config . getString ( "navigateHistoryButtonText" ) ; if ( chatBuffer == null ) { chatBuffer = new ChatBuffer ( bufferSize , viewSize , timestampFormat , replayHeader , replayFooter , replayMsgFormat , replayMsgHover , navigateHistoryButtonText ) ; } else { chatBuffer . setBufferSize ( bufferSize ) ; chatBuffer . setViewSize ( viewSize ) ; chatBuffer . setTimestampFormat ( timestampFormat ) ; chatBuffer . setReplayHeader ( replayHeader ) ; chatBuffer . setReplayFooter ( replayFooter ) ; chatBuffer . setReplayMsgFormat ( replayMsgFormat ) ; chatBuffer . setReplayMsgHover ( replayMsgHover ) ; chatBuffer . setNavigateHistoryButtonText ( navigateHistoryButtonText ) ; } }
Update existing chatBuffer or create a new one with config options
Update existing chatBuffer or create a new one with config options