Skip to content

Commit 1c2e040

Browse files
authored
Fix javadoc (#136)
1 parent 7b8ef66 commit 1c2e040

2 files changed

Lines changed: 31 additions & 16 deletions

File tree

  • logback-classic/src/main/java/com/tersesystems/logback/classic
  • logback-ringbuffer/src/main/java/com/tersesystems/logback/ringbuffer

logback-classic/src/main/java/com/tersesystems/logback/classic/StartTime.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,24 @@
1414
import ch.qos.logback.core.Context;
1515
import ch.qos.logback.core.spi.ContextAware;
1616
import com.tersesystems.logback.core.ComponentContainer;
17+
1718
import java.time.Instant;
1819
import java.util.Iterator;
1920
import java.util.Optional;
21+
2022
import org.slf4j.Marker;
2123

22-
/** This class pulls an Instant from a StartTimeSupplier. */
24+
/**
25+
* This class pulls an Instant from a StartTimeSupplier.
26+
*/
2327
public final class StartTime {
2428

2529
/**
26-
* Returns an start time from the event, then marker, then finally if not found will use the
30+
* Returns a start time from the event, then marker, then finally if not found will use the
2731
* event's timestamp as the marker.
2832
*
2933
* @param context the logging context
30-
* @param event the logging event event
34+
* @param event the logging event
3135
* @return an instant representing the start time.
3236
*/
3337
public static Instant from(Context context, ILoggingEvent event) {
@@ -37,6 +41,10 @@ public static Instant from(Context context, ILoggingEvent event) {
3741
/**
3842
* Pulls a start time from the logging event, looking for the supplier on the event first, and
3943
* then looking for a StartTimeMarker.
44+
*
45+
* @param context the logback context
46+
* @param event the event
47+
* @return an optional start time, using both a container and marker as possible sources.
4048
*/
4149
public static Optional<Instant> fromOptional(Context context, ILoggingEvent event) {
4250
if (event instanceof ComponentContainer) {
@@ -48,7 +56,12 @@ public static Optional<Instant> fromOptional(Context context, ILoggingEvent even
4856
return fromMarker(context, event.getMarker());
4957
}
5058

51-
/** Looks for a StartTimeMarker in the marker and in all of the children of the marker. */
59+
/**
60+
* Looks for a StartTimeMarker in the marker and in all the children of the marker.
61+
* @param context the logback context
62+
* @param m the logback marker
63+
* @return an optional start time.
64+
*/
5265
public static Optional<Instant> fromMarker(Context context, Marker m) {
5366
if (m instanceof StartTimeSupplier) {
5467
StartTimeSupplier supplier = ((StartTimeSupplier) m);

logback-ringbuffer/src/main/java/com/tersesystems/logback/ringbuffer/RingBuffer.java

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ public interface RingBuffer<T> {
1010
interface Supplier<T> {
1111
/**
1212
* This method will return the next value to be written to the queue. As such the queue
13-
* implementations are commited to insert the value once the call is made.
13+
* implementations are committed to insert the value once the call is made.
1414
*
1515
* <p>Users should be aware that underlying queue implementations may upfront claim parts of the
16-
* queue for batch operations and this will effect the view on the queue from the supplier
16+
* queue for batch operations and this will affect the view on the queue from the supplier
1717
* method. In particular size and any offer methods may take the view that the full batch has
1818
* already happened.
1919
*
@@ -51,8 +51,6 @@ interface WaitStrategy {
5151
* This method can implement static or dynamic backoff. Dynamic backoff will rely on the counter
5252
* for estimating how long the caller has been idling. The expected usage is:
5353
*
54-
* <p>
55-
*
5654
* <pre>
5755
* <code>
5856
* int ic = 0;
@@ -172,8 +170,6 @@ interface ExitCondition {
172170
* Remove up to <i>limit</i> elements from the queue and hand to consume. This should be
173171
* semantically similar to:
174172
*
175-
* <p>
176-
*
177173
* <pre>{@code
178174
* M m;
179175
* int i = 0;
@@ -189,6 +185,8 @@ interface ExitCondition {
189185
* <p><b>WARNING</b>: Explicit assumptions are made with regards to {@link Consumer#accept} make
190186
* sure you have read and understood these before using this method.
191187
*
188+
* @param c the consumer
189+
* @param limit the limit
192190
* @return the number of polled elements
193191
* @throws IllegalArgumentException c is {@code null}
194192
* @throws IllegalArgumentException if limit is negative
@@ -198,8 +196,6 @@ interface ExitCondition {
198196
/**
199197
* Stuff the queue with up to <i>limit</i> elements from the supplier. Semantically similar to:
200198
*
201-
* <p>
202-
*
203199
* <pre>{@code
204200
* for(int i=0; i < limit && relaxedOffer(s.get()); i++);
205201
* }</pre>
@@ -210,6 +206,8 @@ interface ExitCondition {
210206
* <p><b>WARNING</b>: Explicit assumptions are made with regards to {@link Supplier#get} make sure
211207
* you have read and understood these before using this method.
212208
*
209+
* @param s the supplier
210+
* @param limit the limit
213211
* @return the number of offered elements
214212
* @throws IllegalArgumentException s is {@code null}
215213
* @throws IllegalArgumentException if limit is negative
@@ -233,6 +231,7 @@ interface ExitCondition {
233231
* <p><b>WARNING</b>: Explicit assumptions are made with regards to {@link Consumer#accept} make
234232
* sure you have read and understood these before using this method.
235233
*
234+
* @param c the consumer
236235
* @return the number of polled elements
237236
* @throws IllegalArgumentException c is {@code null}
238237
*/
@@ -253,6 +252,7 @@ interface ExitCondition {
253252
* <p><b>WARNING</b>: Explicit assumptions are made with regards to {@link Supplier#get} make sure
254253
* you have read and understood these before using this method.
255254
*
255+
* @param s the supplier
256256
* @return the number of offered elements
257257
* @throws IllegalArgumentException s is {@code null}
258258
*/
@@ -261,8 +261,6 @@ interface ExitCondition {
261261
/**
262262
* Remove elements from the queue and hand to consume forever. Semantically similar to:
263263
*
264-
* <p>
265-
*
266264
* <pre>
267265
* int idleCounter = 0;
268266
* while (exit.keepRunning()) {
@@ -281,15 +279,16 @@ interface ExitCondition {
281279
* <p><b>WARNING</b>: Explicit assumptions are made with regards to {@link Consumer#accept} make
282280
* sure you have read and understood these before using this method.
283281
*
282+
* @param c the consumer
283+
* @param wait the wait strategy
284+
* @param exit the exit condition
284285
* @throws IllegalArgumentException c OR wait OR exit are {@code null}
285286
*/
286287
void drain(Consumer<T> c, WaitStrategy wait, ExitCondition exit);
287288

288289
/**
289290
* Stuff the queue with elements from the supplier forever. Semantically similar to:
290291
*
291-
* <p>
292-
*
293292
* <pre>
294293
* <code>
295294
* int idleCounter = 0;
@@ -311,6 +310,9 @@ interface ExitCondition {
311310
* <p><b>WARNING</b>: Explicit assumptions are made with regards to {@link Supplier#get} make sure
312311
* you have read and understood these before using this method.
313312
*
313+
* @param s the supplier
314+
* @param wait the wait strategy
315+
* @param exit the exit condition
314316
* @throws IllegalArgumentException s OR wait OR exit are {@code null}
315317
*/
316318
void fill(Supplier<T> s, WaitStrategy wait, ExitCondition exit);

0 commit comments

Comments
 (0)