Quick Tip: Java 8 Quick Output

For Java 8, I have an ArrayList of Strings I want to display.   Couldn't be easier.   Using SLF4J for logging and running in Spring Boot. 

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;

        list.stream().forEach(value -> log.debug("Value: [{}]", value));

 

 

Written By bunkertor

Leave a Reply

Your email address will not be published. Required fields are marked *