Skip to content

Commit 0dcfa19

Browse files
committed
check for return value in some oggingEventBuilder methods
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
1 parent e7ca8d1 commit 0dcfa19

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

slf4j-api/src/main/java/org/slf4j/spi/LoggingEventBuilder.java

+10
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
import org.slf4j.Marker;
3030

31+
import javax.annotation.CheckReturnValue;
32+
3133
/**
3234
* This is the main interface in slf4j's fluent API for creating
3335
* {@link org.slf4j.event.LoggingEvent logging events}.
@@ -42,6 +44,7 @@ public interface LoggingEventBuilder {
4244
* @param cause a throwable
4345
* @return a LoggingEventBuilder, usually <b>this</b>.
4446
*/
47+
@CheckReturnValue
4548
LoggingEventBuilder setCause(Throwable cause);
4649

4750
/**
@@ -50,6 +53,7 @@ public interface LoggingEventBuilder {
5053
* @param marker a Marker instance to add.
5154
* @return a LoggingEventBuilder, usually <b>this</b>.
5255
*/
56+
@CheckReturnValue
5357
LoggingEventBuilder addMarker(Marker marker);
5458

5559
/**
@@ -58,6 +62,7 @@ public interface LoggingEventBuilder {
5862
* @param p an Object to add.
5963
* @return a LoggingEventBuilder, usually <b>this</b>.
6064
*/
65+
@CheckReturnValue
6166
LoggingEventBuilder addArgument(Object p);
6267

6368
/**
@@ -66,6 +71,7 @@ public interface LoggingEventBuilder {
6671
* @param objectSupplier an Object supplier to add.
6772
* @return a LoggingEventBuilder, usually <b>this</b>.
6873
*/
74+
@CheckReturnValue
6975
LoggingEventBuilder addArgument(Supplier<?> objectSupplier);
7076

7177

@@ -76,6 +82,7 @@ public interface LoggingEventBuilder {
7682
* @param value the value of the key value pair.
7783
* @return a LoggingEventBuilder, usually <b>this</b>.
7884
*/
85+
@CheckReturnValue
7986
LoggingEventBuilder addKeyValue(String key, Object value);
8087

8188
/**
@@ -85,13 +92,15 @@ public interface LoggingEventBuilder {
8592
* @param valueSupplier a supplier of a value for the key value pair.
8693
* @return a LoggingEventBuilder, usually <b>this</b>.
8794
*/
95+
@CheckReturnValue
8896
LoggingEventBuilder addKeyValue(String key, Supplier<Object> valueSupplier);
8997

9098
/**
9199
* Sets the message of the logging event.
92100
*
93101
* @since 2.0.0-beta0
94102
*/
103+
@CheckReturnValue
95104
LoggingEventBuilder setMessage(String message);
96105

97106
/**
@@ -100,6 +109,7 @@ public interface LoggingEventBuilder {
100109
* @param messageSupplier supplies a String to be used as the message for the event
101110
* @since 2.0.0-beta0
102111
*/
112+
@CheckReturnValue
103113
LoggingEventBuilder setMessage(Supplier<String> messageSupplier);
104114

105115
/**

0 commit comments

Comments
 (0)