@@ -58,6 +58,7 @@ public interface LoggingEventBuilder {
58
58
59
59
/**
60
60
* Add an argument to the event being built.
61
+ * Synonymous with {@link #arg(Object)}.
61
62
*
62
63
* @param p an Object to add.
63
64
* @return a LoggingEventBuilder, usually <b>this</b>.
@@ -66,15 +67,153 @@ public interface LoggingEventBuilder {
66
67
LoggingEventBuilder addArgument (Object p );
67
68
68
69
/**
69
- * Add an argument supplier to the event being built.
70
+ * Add an argument to the event being built.
71
+ * Synonymous with {@link #addArgument(Object)}.
70
72
*
73
+ * @param p an Object to add.
74
+ * @return a LoggingEventBuilder, usually <b>this</b>.
75
+ * @since 2.1.0
76
+ */
77
+ @ CheckReturnValue
78
+ default LoggingEventBuilder arg (Object p ) {
79
+ return addArgument (p );
80
+ }
81
+
82
+ /**
83
+ * <p>Add an argument supplier to the event being built. Synonymous with {@link #arg(Supplier)}.
84
+ * </p>
71
85
* @param objectSupplier an Object supplier to add.
72
86
* @return a LoggingEventBuilder, usually <b>this</b>.
73
87
*/
74
88
@ CheckReturnValue
75
89
LoggingEventBuilder addArgument (Supplier <?> objectSupplier );
76
90
77
91
92
+ /**
93
+ * <p>Add an argument supplier to the event being built. Synonymous with {@link #addArgument(Supplier)}.
94
+ * </p>
95
+ *
96
+ * @param objectSupplier an Object supplier to add.
97
+ * @return a LoggingEventBuilder, usually <b>this</b>.
98
+ * @since 2.1.0
99
+ */
100
+ @ CheckReturnValue
101
+ default LoggingEventBuilder arg (Supplier <?> objectSupplier ) {
102
+ return addArgument (objectSupplier );
103
+ }
104
+
105
+ /**
106
+ * Add a value of type <code>boolean</code> to the event being built.
107
+ *
108
+ * <p>The default implementation simply casts to <code>Boolean</code>. However, However, the NOP implementation, i.e.
109
+ * {@link NOPLoggingEventBuilder}, skips the cast.</p>
110
+ *
111
+ * @param b a value of type <code>boolean</code> value to add.
112
+ * @return a LoggingEventBuilder, usually <b>this</b>.
113
+ * @since 2.1.0
114
+ */
115
+ default public LoggingEventBuilder arg (boolean b ) {
116
+ return addArgument ((Boolean ) b );
117
+ }
118
+
119
+ /**
120
+ * Add a value of type <code>char</code> to the event being built.
121
+ *
122
+ * <p>The default implementation simply casts to <code>Character</code>. However, the NOP implementation, i.e.
123
+ * {@link NOPLoggingEventBuilder}, skips the cast.</p>
124
+ *
125
+ * @param c a value of type <code>char</code> value to add.
126
+ * @return a LoggingEventBuilder, usually <b>this</b>.
127
+ * @since 2.1.0
128
+ */
129
+ default public LoggingEventBuilder arg (char c ) {
130
+ return addArgument ((Character ) c );
131
+ }
132
+
133
+ /**
134
+ * Add a value of type <code>byte</code> to the event being built.
135
+ *
136
+ * <p>The default implementation simply casts to <code>Byte</code>. However, the NOP implementation, i.e.
137
+ * {@link NOPLoggingEventBuilder}, skips the cast.</p>
138
+ *
139
+ * @param b a value of type <code>byte</code> value to add.
140
+ * @return a LoggingEventBuilder, usually <b>this</b>.
141
+ * @since 2.1.0
142
+ */
143
+ default public LoggingEventBuilder arg (byte b ) {
144
+ return addArgument ((Byte ) b );
145
+ }
146
+
147
+ /**
148
+ * Add a value of type <code>short</code> to the event being built.
149
+ *
150
+ * <p>The default implementation simply casts to <code>Short</code>. However, the NOP implementation, i.e.
151
+ * {@link NOPLoggingEventBuilder}, skips the cast.</p>
152
+ *
153
+ * @param s a value of type <code>short</code> value to add.
154
+ * @return a LoggingEventBuilder, usually <b>this</b>.
155
+ * @since 2.1.0
156
+ */
157
+ default public LoggingEventBuilder arg (short s ) {
158
+ return addArgument ((Short ) s );
159
+ }
160
+
161
+ /**
162
+ * Add a value of type <code>int</code> to the event being built.
163
+ *
164
+ * <p>The default implementation simply casts to <code>Integer</code>. However, the NOP implementation, i.e.
165
+ * {@link NOPLoggingEventBuilder}, skips the cast.</p>
166
+ *
167
+ * @param i a value of type <code>int</code> value to add.
168
+ * @return a LoggingEventBuilder, usually <b>this</b>.
169
+ * @since 2.1.0
170
+ */
171
+ default public LoggingEventBuilder arg (int i ) {
172
+ return addArgument ((Integer ) i );
173
+ }
174
+
175
+ /**
176
+ * Add a value of type <code>long</code> to the event being built.
177
+ *
178
+ * <p>The default implementation simply casts to <code>Long</code>. However, the NOP implementation, i.e.
179
+ * {@link NOPLoggingEventBuilder}, skips the cast.</p>
180
+ *
181
+ * @param l a value of type <code>long</code> value to add.
182
+ * @return a LoggingEventBuilder, usually <b>this</b>.
183
+ * @since 2.1.0
184
+ */
185
+ default public LoggingEventBuilder arg (long l ) {
186
+ return addArgument ((Long ) l );
187
+ }
188
+
189
+ /**
190
+ * Add a value of type <code>float</code> to the event being built.
191
+ *
192
+ * <p>The default implementation simply casts to <code>Float</code>. However, the NOP implementation, i.e.
193
+ * {@link NOPLoggingEventBuilder}, skips the cast.</p>
194
+ *
195
+ * @param f a value of type <code>float</code> value to add.
196
+ * @return a LoggingEventBuilder, usually <b>this</b>.
197
+ * @since 2.1.0
198
+ */
199
+ default public LoggingEventBuilder arg (float f ) {
200
+ return addArgument ((Float ) f );
201
+ }
202
+
203
+ /**
204
+ * Add a value of type <code>double</code> to the event being built.
205
+ *
206
+ * <p>The default implementation simply casts to <code>Double</code>. However, the NOP implementation skips the cast.</p>
207
+ *
208
+ * @param d a value of type <code>double</code> value to add.
209
+ * @return a LoggingEventBuilder, usually <b>this</b>.
210
+ * @since 2.1.0
211
+ */
212
+ default LoggingEventBuilder arg (double d ) {
213
+ return arg ((Double ) d );
214
+ }
215
+
216
+
78
217
/**
79
218
* Add a {@link org.slf4j.event.KeyValuePair key value pair} to the event being built.
80
219
*
0 commit comments