public boolean contains(final long logIndex) {
        this.readLock.lock();
        try {
            return logIndex >= this.header.firstLogIndex && logIndex <= this.lastLogIndex;
        } finally {
            this.readLock.unlock();
        }
    }
Returns true when the segment file contains the log index.

@param logIndex the log index
@return true if the segment file contains the log index, otherwise return false
jraft-core/src/main/java/com/alipay/sofa/jraft/storage/log/SegmentFile.java