| 1 | package com.github.dakusui.actionunit.core.context; | |
| 2 | ||
| 3 | import com.github.dakusui.actionunit.utils.InternalUtils; | |
| 4 | ||
| 5 | import java.util.Formattable; | |
| 6 | import java.util.Formatter; | |
| 7 | import java.util.function.Consumer; | |
| 8 | ||
| 9 | @FunctionalInterface | |
| 10 | public interface FormattableConsumer<T> extends Consumer<T>, Formattable { | |
| 11 | FormattableConsumer<?> NOP = new FormattableConsumer<Object>() { | |
| 12 | @Override | |
| 13 | public void accept(Object t) { | |
| 14 | } | |
| 15 | ||
| 16 | public void formatTo(Formatter formatter, int i, int i1, int i2) { | |
| 17 | formatter.format("%s", "(nop)"); | |
| 18 | } | |
| 19 | }; | |
| 20 | ||
| 21 | @Override | |
| 22 | default void formatTo(Formatter formatter, int i, int i1, int i2) { | |
| 23 | formatter.format("%s", InternalUtils.toStringIfOverriddenOrNoname(this)); | |
| 24 | } | |
| 25 | ||
| 26 | @SuppressWarnings("unchecked") | |
| 27 | static <T> FormattableConsumer<T> nopConsumer() { | |
| 28 |
1
1. nopConsumer : replaced return value with null for com/github/dakusui/actionunit/core/context/FormattableConsumer::nopConsumer → SURVIVED |
return (FormattableConsumer<T>) NOP; |
| 29 | } | |
| 30 | } | |
Mutations | ||
| 28 |
1.1 |