Skip to content

Commit 49f44fb

Browse files
committed
docs(simple-jwt): Optimised Javadoc.
Closes #18
1 parent c0aa871 commit 49f44fb

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

simple-jwt-facade/src/main/java/cn/org/codecrafters/simplejwt/annotations/TokenEnum.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,25 @@
2525
import java.lang.annotation.Target;
2626

2727
/**
28-
* JwtEnum
28+
* This annotation marks the enum field declared in payload class will be
29+
* handled as basic data types in {@link TokenDataType}.
2930
*
3031
* @author Zihlu Wang
3132
*/
3233
@Retention(RetentionPolicy.RUNTIME)
3334
@Target({ElementType.FIELD})
3435
public @interface TokenEnum {
3536

37+
/**
38+
* The name of the field of the base data corresponding to the
39+
* enumeration data.
40+
*/
3641
String propertyName();
3742

43+
/**
44+
* The attribute {@code dataType} specifies what base data type to treat
45+
* this enum as.
46+
*/
3847
TokenDataType dataType();
3948

4049
}

simple-jwt-facade/src/main/java/cn/org/codecrafters/simplejwt/constants/TokenDataType.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,47 @@
2020
import lombok.Getter;
2121

2222
/**
23-
* TokenDataType
23+
* The base data types used to process enum data.
2424
*
2525
* @author Zihlu Wang
2626
*/
2727
@Getter
2828
public enum TokenDataType {
2929

30+
/**
31+
* Marks enumeration being processed as Boolean.
32+
*/
3033
BOOLEAN(Boolean.class),
34+
35+
/**
36+
* Marks enumeration being processed as Double.
37+
*/
3138
DOUBLE(Long.class),
39+
40+
/**
41+
* Marks enumeration being processed as Float.
42+
*/
3243
FLOAT(Float.class),
44+
45+
/**
46+
* Marks enumeration being processed as Integer.
47+
*/
3348
INTEGER(Integer.class),
49+
50+
/**
51+
* Marks enumeration being processed as Long.
52+
*/
3453
LONG(Long.class),
54+
55+
/**
56+
* Marks enumeration being processed as String.
57+
*/
3558
STRING(String.class),
3659
;
3760

61+
/**
62+
* The mapped class to this mark.
63+
*/
3864
private final Class<?> mappedClass;
3965

4066
TokenDataType(Class<?> mappedClass) {

0 commit comments

Comments
 (0)