File tree Expand file tree Collapse file tree 2 files changed +37
-2
lines changed
simple-jwt-facade/src/main/java/cn/org/codecrafters/simplejwt Expand file tree Collapse file tree 2 files changed +37
-2
lines changed Original file line number Diff line number Diff line change 2525import 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 })
3435public @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}
Original file line number Diff line number Diff line change 2020import lombok .Getter ;
2121
2222/**
23- * TokenDataType
23+ * The base data types used to process enum data.
2424 *
2525 * @author Zihlu Wang
2626 */
2727@ Getter
2828public 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 ) {
You can’t perform that action at this time.
0 commit comments