Skip to content

Commit 638ba26

Browse files
committed
Fix javadoc errors in ocpp-common
1 parent e8d006f commit 638ba26

6 files changed

Lines changed: 118 additions & 15 deletions

File tree

ocpp-common/src/main/java/eu/chargetime/ocpp/Communicator.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ of this software and associated documentation files (the "Software"), to deal
2727
SOFTWARE.
2828
*/
2929

30+
import eu.chargetime.ocpp.feature.Feature;
3031
import eu.chargetime.ocpp.model.*;
3132
import java.util.ArrayDeque;
3233
import org.slf4j.Logger;
@@ -54,6 +55,7 @@ public abstract class Communicator {
5455
* @param payload the raw formatted payload.
5556
* @param type the expected return type.
5657
* @return the unpacked payload.
58+
* @param <T> the type of the unpacked payload.
5759
* @throws Exception error occurred while converting.
5860
*/
5961
public abstract <T> T unpackPayload(Object payload, Class<T> type) throws Exception;
@@ -70,7 +72,7 @@ public abstract class Communicator {
7072
* Create a call result envelope to transmit.
7173
*
7274
* @param uniqueId the id the receiver expects.
73-
* @param action action name of the feature.
75+
* @param action action name of the {@link Feature}.
7476
* @param payload packed payload.
7577
* @return a fully packed message ready to send.
7678
*/
@@ -80,7 +82,7 @@ public abstract class Communicator {
8082
* Create a call envelope to transmit to the server.
8183
*
8284
* @param uniqueId the id the receiver must reply with.
83-
* @param action action name of the feature.
85+
* @param action action name of the {@link Feature}.
8486
* @param payload packed payload.
8587
* @return a fully packed message ready to send.
8688
*/
@@ -90,6 +92,7 @@ public abstract class Communicator {
9092
* Create a call error envelope to transmit.
9193
*
9294
* @param uniqueId the id the receiver expects.
95+
* @param action action name of the {@link Feature}.
9396
* @param errorCode an OCPP error code.
9497
* @param errorDescription an associated error description.
9598
* @return a fully packed message ready to send.
@@ -101,6 +104,7 @@ protected abstract Object makeCallError(
101104
* Create a call result error envelope to transmit.
102105
*
103106
* @param uniqueId the id the receiver expects.
107+
* @param action action name of the {@link Feature}.
104108
* @param errorCode an OCPP error code.
105109
* @param errorDescription an associated error description.
106110
* @return a fully packed message ready to send.
@@ -112,7 +116,7 @@ protected abstract Object makeCallResultError(
112116
* Create a send envelope to transmit to the server.
113117
*
114118
* @param uniqueId the id of the message.
115-
* @param action action name of the feature.
119+
* @param action action name of the {@link Feature}.
116120
* @param payload packed payload.
117121
* @return a fully packed message ready to send.
118122
*/
@@ -177,7 +181,7 @@ public void accept(CommunicatorEvents events) {
177181
* Request}s.
178182
*
179183
* @param uniqueId the id the receiver should use to reply.
180-
* @param action action name of the {@link eu.chargetime.ocpp.feature.Feature}.
184+
* @param action action name of the {@link Feature}.
181185
* @param request the outgoing {@link Request}
182186
*/
183187
public synchronized void sendCall(String uniqueId, String action, Request request) {
@@ -222,6 +226,7 @@ public synchronized void sendCall(String uniqueId, String action, Request reques
222226
* Send a {@link Confirmation} reply to a {@link Request}.
223227
*
224228
* @param uniqueId the id the receiver expects.
229+
* @param action action name of the {@link Feature}.
225230
* @param confirmation the outgoing {@link Confirmation}
226231
*/
227232
public void sendCallResult(String uniqueId, String action, Confirmation confirmation) {
@@ -255,7 +260,8 @@ public void sendCallResult(String uniqueId, String action, Confirmation confirma
255260
* Send an error. If offline, the message is thrown away.
256261
*
257262
* @param uniqueId the id the receiver expects a response to.
258-
* @param errorCode an OCPP error Code
263+
* @param action action name of the {@link Feature}.
264+
* @param errorCode an OCPP error Code.
259265
* @param errorDescription a associated error description.
260266
*/
261267
public void sendCallError(
@@ -282,7 +288,8 @@ public void sendCallError(
282288
* Send a call result error. If offline, the message is thrown away.
283289
*
284290
* @param uniqueId the id the receiver expects a response to.
285-
* @param errorCode an OCPP error Code
291+
* @param action action name of the {@link Feature}.
292+
* @param errorCode an OCPP error Code.
286293
* @param errorDescription a associated error description.
287294
*/
288295
public void sendCallResultError(
@@ -310,7 +317,7 @@ public void sendCallResultError(
310317
* Send a {@link Request} which has no confirmation.
311318
*
312319
* @param uniqueId the id of the {@link Request}.
313-
* @param action action name of the {@link eu.chargetime.ocpp.feature.Feature}.
320+
* @param action action name of the {@link Feature}.
314321
* @param request the outgoing {@link Request}
315322
*/
316323
public synchronized void send(String uniqueId, String action, Request request) {

ocpp-common/src/main/java/eu/chargetime/ocpp/Server.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ public void close() {
227227
* @throws UnsupportedFeatureException Thrown if the feature isn't among the list of supported
228228
* features.
229229
* @throws OccurenceConstraintException Thrown if the request isn't valid.
230+
* @throws NotConnectedException Thrown if session with passed sessionIndex is not found
230231
*/
231232
public CompletableFuture<Confirmation> send(UUID sessionIndex, Request request)
232233
throws UnsupportedFeatureException, OccurenceConstraintException, NotConnectedException {
@@ -275,6 +276,9 @@ public CompletableFuture<Confirmation> send(UUID sessionIndex, Request request)
275276
* @param confirmation the {@link Confirmation} to the original {@link Request}.
276277
* @return a boolean indicating if pending request was found.
277278
* @throws NotConnectedException Thrown if session with passed sessionIndex is not found
279+
* @throws UnsupportedFeatureException Thrown if the feature isn't among the list of supported
280+
* features.
281+
* @throws OccurenceConstraintException Thrown if the request isn't valid.
278282
*/
279283
public boolean asyncCompleteRequest(UUID sessionIndex, String uniqueId, Confirmation confirmation)
280284
throws NotConnectedException, UnsupportedFeatureException, OccurenceConstraintException {

ocpp-common/src/main/java/eu/chargetime/ocpp/Session.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ public class Session implements ISession {
6464
*
6565
* @param communicator send and receive messages.
6666
* @param queue store and restore requests based on unique ids.
67+
* @param fulfiller the {@link PromiseFulfiller} to use
68+
* @param featureRepository the {@link IFeatureRepository} to use
6769
*/
6870
public Session(
6971
Communicator communicator,
@@ -150,6 +152,7 @@ public void removeRequest(String ticket) {
150152
* Send a {@link Confirmation} to a {@link Request}
151153
*
152154
* @param uniqueId the unique identification the receiver expects.
155+
* @param action action name to identify the feature.
153156
* @param confirmation the {@link Confirmation} payload to send.
154157
*/
155158
public void sendConfirmation(String uniqueId, String action, Confirmation confirmation) {

ocpp-common/src/main/java/eu/chargetime/ocpp/SessionEvents.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ public interface SessionEvents {
4747
*
4848
* @param request the {@link Request}.
4949
* @return a {@link Confirmation} to send as a response or {@code null} if none to send.
50+
* @throws UnsupportedFeatureException Thrown if the feature isn't among the list of supported
51+
* features.
5052
*/
5153
@Nullable
5254
Confirmation handleRequest(Request request) throws UnsupportedFeatureException;
@@ -57,6 +59,9 @@ public interface SessionEvents {
5759
* @param uniqueId the unique id used for the {@link Request}.
5860
* @param confirmation the {@link Confirmation} to the {@link Request}.
5961
* @return a boolean indicating if pending request was found.
62+
* @throws UnsupportedFeatureException Thrown if the feature isn't among the list of supported
63+
* features.
64+
* @throws OccurenceConstraintException Thrown if the request isn't valid.
6065
*/
6166
boolean asyncCompleteRequest(String uniqueId, Confirmation confirmation)
6267
throws UnsupportedFeatureException, OccurenceConstraintException;

ocpp-common/src/main/java/eu/chargetime/ocpp/utilities/MoreObjects.java

Lines changed: 77 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ static ToStringHelperImpl toStringHelper(Class<?> clazz) {
697697
* Object#getClass()}.
698698
*
699699
* @param className the name of the instance type
700+
* @return an instance of {@link ToStringHelperImpl}
700701
*/
701702
public static ToStringHelperImpl toStringHelper(String className) {
702703
return new ToStringHelperImpl(className);
@@ -722,6 +723,8 @@ private ToStringHelperImpl(String className) {
722723
* Configures the {@link ToStringHelperImpl} so {@link #toString()} will ignore properties with
723724
* null value. The order of calling this method, relative to the {@code add()}/{@code
724725
* addValue()} methods, is not significant.
726+
*
727+
* @return this instance of {@link ToStringHelperImpl}
725728
*/
726729
public ToStringHelperImpl omitNullValues() {
727730
omitNullValues = true;
@@ -732,42 +735,88 @@ public ToStringHelperImpl omitNullValues() {
732735
* Adds a name/value pair to the formatted output in {@code name=value} format. If {@code value}
733736
* is {@code null}, the string {@code "null"} is used, unless {@link #omitNullValues()} is
734737
* called, in which case this name/value pair will not be added.
738+
*
739+
* @param name the name
740+
* @param value the {@link Object} value
741+
* @return this instance of {@link ToStringHelperImpl}
735742
*/
736743
public ToStringHelperImpl add(String name, Object value) {
737744
return addHolder(name, value);
738745
}
739746

740-
/** Adds a name/value pair to the formatted output in {@code name=value} format. */
747+
/**
748+
* Adds a name/value pair to the formatted output in {@code name=value} format.
749+
*
750+
* @param name the name
751+
* @param value the {@link ZonedDateTime} value
752+
* @return this instance of {@link ToStringHelperImpl}
753+
*/
741754
public ToStringHelperImpl add(String name, ZonedDateTime value) {
742755
return addHolder(name, value);
743756
}
744757

745-
/** Adds a name/value pair to the formatted output in {@code name=value} format. */
758+
/**
759+
* Adds a name/value pair to the formatted output in {@code name=value} format.
760+
*
761+
* @param name the name
762+
* @param value the {@code boolean} value
763+
* @return this instance of {@link ToStringHelperImpl}
764+
*/
746765
public ToStringHelperImpl add(String name, boolean value) {
747766
return addHolder(name, String.valueOf(value));
748767
}
749768

750-
/** Adds a name/value pair to the formatted output in {@code name=value} format. */
769+
/**
770+
* Adds a name/value pair to the formatted output in {@code name=value} format.
771+
*
772+
* @param name the name
773+
* @param value the {@code char} value
774+
* @return this instance of {@link ToStringHelperImpl}
775+
*/
751776
public ToStringHelperImpl add(String name, char value) {
752777
return addHolder(name, String.valueOf(value));
753778
}
754779

755-
/** Adds a name/value pair to the formatted output in {@code name=value} format. */
780+
/**
781+
* Adds a name/value pair to the formatted output in {@code name=value} format.
782+
*
783+
* @param name the name
784+
* @param value the {@code double} value
785+
* @return this instance of {@link ToStringHelperImpl}
786+
*/
756787
public ToStringHelperImpl add(String name, double value) {
757788
return addHolder(name, String.valueOf(value));
758789
}
759790

760-
/** Adds a name/value pair to the formatted output in {@code name=value} format. */
791+
/**
792+
* Adds a name/value pair to the formatted output in {@code name=value} format.
793+
*
794+
* @param name the name
795+
* @param value the {@code float} value
796+
* @return this instance of {@link ToStringHelperImpl}
797+
*/
761798
public ToStringHelperImpl add(String name, float value) {
762799
return addHolder(name, String.valueOf(value));
763800
}
764801

765-
/** Adds a name/value pair to the formatted output in {@code name=value} format. */
802+
/**
803+
* Adds a name/value pair to the formatted output in {@code name=value} format.
804+
*
805+
* @param name the name
806+
* @param value the {@code int} value
807+
* @return this instance of {@link ToStringHelperImpl}
808+
*/
766809
public ToStringHelperImpl add(String name, int value) {
767810
return addHolder(name, String.valueOf(value));
768811
}
769812

770-
/** Adds a name/value pair to the formatted output in {@code name=value} format. */
813+
/**
814+
* Adds a name/value pair to the formatted output in {@code name=value} format.
815+
*
816+
* @param name the name
817+
* @param value the {@code long} value
818+
* @return this instance of {@link ToStringHelperImpl}
819+
*/
771820
public ToStringHelperImpl add(String name, long value) {
772821
return addHolder(name, String.valueOf(value));
773822
}
@@ -777,6 +826,9 @@ public ToStringHelperImpl add(String name, long value) {
777826
*
778827
* <p>It is strongly encouraged to use {@link #add(String, Object)} instead and give value a
779828
* readable name.
829+
*
830+
* @param value the {@link Object} value
831+
* @return this instance of {@link ToStringHelperImpl}
780832
*/
781833
public ToStringHelperImpl addValue(Object value) {
782834
return addHolder(value);
@@ -787,6 +839,9 @@ public ToStringHelperImpl addValue(Object value) {
787839
*
788840
* <p>It is strongly encouraged to use {@link #add(String, boolean)} instead and give value a
789841
* readable name.
842+
*
843+
* @param value the {@code boolean} value
844+
* @return this instance of {@link ToStringHelperImpl}
790845
*/
791846
public ToStringHelperImpl addValue(boolean value) {
792847
return addHolder(String.valueOf(value));
@@ -797,6 +852,9 @@ public ToStringHelperImpl addValue(boolean value) {
797852
*
798853
* <p>It is strongly encouraged to use {@link #add(String, char)} instead and give value a
799854
* readable name.
855+
*
856+
* @param value the {@code char} value
857+
* @return this instance of {@link ToStringHelperImpl}
800858
*/
801859
public ToStringHelperImpl addValue(char value) {
802860
return addHolder(String.valueOf(value));
@@ -807,6 +865,9 @@ public ToStringHelperImpl addValue(char value) {
807865
*
808866
* <p>It is strongly encouraged to use {@link #add(String, double)} instead and give value a
809867
* readable name.
868+
*
869+
* @param value the {@code double} value
870+
* @return this instance of {@link ToStringHelperImpl}
810871
*/
811872
public ToStringHelperImpl addValue(double value) {
812873
return addHolder(String.valueOf(value));
@@ -817,6 +878,9 @@ public ToStringHelperImpl addValue(double value) {
817878
*
818879
* <p>It is strongly encouraged to use {@link #add(String, float)} instead and give value a
819880
* readable name.
881+
*
882+
* @param value the {@code float} value
883+
* @return this instance of {@link ToStringHelperImpl}
820884
*/
821885
public ToStringHelperImpl addValue(float value) {
822886
return addHolder(String.valueOf(value));
@@ -827,6 +891,9 @@ public ToStringHelperImpl addValue(float value) {
827891
*
828892
* <p>It is strongly encouraged to use {@link #add(String, int)} instead and give value a
829893
* readable name.
894+
*
895+
* @param value the {@code int} value
896+
* @return this instance of {@link ToStringHelperImpl}
830897
*/
831898
public ToStringHelperImpl addValue(int value) {
832899
return addHolder(String.valueOf(value));
@@ -837,6 +904,9 @@ public ToStringHelperImpl addValue(int value) {
837904
*
838905
* <p>It is strongly encouraged to use {@link #add(String, long)} instead and give value a
839906
* readable name.
907+
*
908+
* @param value the {@code long} value
909+
* @return this instance of {@link ToStringHelperImpl}
840910
*/
841911
public ToStringHelperImpl addValue(long value) {
842912
return addHolder(String.valueOf(value));

ocpp-common/src/main/java/eu/chargetime/ocpp/utilities/Stopwatch.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,28 @@ public interface Ticker {
5252

5353
/**
5454
* Creates (but does not start) a new stopwatch using {@link System#nanoTime} as its time source.
55+
*
56+
* @return the new stopwatch (not started)
5557
*/
5658
public static Stopwatch createUnstarted() {
5759
return new Stopwatch();
5860
}
5961

60-
/** Creates (and starts) a new stopwatch using {@link System#nanoTime} as its time source. */
62+
/**
63+
* Creates (and starts) a new stopwatch using {@link System#nanoTime} as its time source.
64+
*
65+
* @return the new stopwatch (started)
66+
*/
6167
public static Stopwatch createStarted() {
6268
return new Stopwatch().start();
6369
}
6470

6571
/**
6672
* Returns {@code true} if {@link #start()} has been called on this stopwatch, and {@link #stop()}
6773
* has not been called since the last call to {@code start()}.
74+
*
75+
* @return {@code true} if {@link #start()} has been called on this stopwatch, and {@link #stop()}
76+
* has not been called since the last call to {@code start()}.
6877
*/
6978
public boolean isRunning() {
7079
return isRunning;
@@ -125,6 +134,9 @@ private long elapsedNanos() {
125134
* <p>It is generally not a good idea to use an ambiguous, unitless {@code long} to represent
126135
* elapsed time. Therefore, we recommend using {@link #elapsed()} instead, which returns a
127136
* strongly-typed {@link Duration} instance.
137+
*
138+
* @param desiredUnit the desired time unit
139+
* @return the current elapsed time shown on this stopwatch
128140
*/
129141
public long elapsed(TimeUnit desiredUnit) {
130142
return desiredUnit.convert(elapsedNanos(), NANOSECONDS);
@@ -133,6 +145,8 @@ public long elapsed(TimeUnit desiredUnit) {
133145
/**
134146
* Returns the current elapsed time shown on this stopwatch as a {@link Duration}. Unlike {@link
135147
* #elapsed(TimeUnit)}, this method does not lose any precision due to rounding.
148+
*
149+
* @return the current elapsed time shown on this stopwatch as a {@link Duration}.
136150
*/
137151
public Duration elapsed() {
138152
return Duration.ofNanos(elapsedNanos());

0 commit comments

Comments
 (0)