package com.atlassian.bitbucket.mesh.process.handler;

import javax.annotation.Nonnull;

@FunctionalInterface
public interface LineSink {

    /**
     * Offers a line to the sink for processing.
     *
     * @param line      the line
     * @param truncated {@code true} if one or more characters were omitted from the line due to limits; otherwise,
     *                  {@code false} if the line is complete
     * @return {@code true} if further lines should be provided; otherwise, {@code false} to end processing early
     */
    boolean accept(@Nonnull String line, boolean truncated);
}
