#502 Replaced usages of System.out with logger.
This commit is contained in:
@ -22,6 +22,9 @@
|
||||
*/
|
||||
package com.iluwatar.monad;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
@ -42,6 +45,8 @@ import java.util.function.Predicate;
|
||||
*/
|
||||
public class App {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
|
||||
|
||||
/**
|
||||
* Program entry point.
|
||||
*
|
||||
@ -49,7 +54,7 @@ public class App {
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
User user = new User("user", 24, Sex.FEMALE, "foobar.com");
|
||||
System.out.println(Validator.of(user).validate(User::getName, Objects::nonNull, "name is null")
|
||||
LOGGER.info(Validator.of(user).validate(User::getName, Objects::nonNull, "name is null")
|
||||
.validate(User::getName, name -> !name.isEmpty(), "name is empty")
|
||||
.validate(User::getEmail, email -> !email.contains("@"), "email doesn't containt '@'")
|
||||
.validate(User::getAge, age -> age > 20 && age < 30, "age isn't between...").get().toString());
|
||||
|
Reference in New Issue
Block a user