MCPcopy Index your code
hub / github.com/auth0/java-jwt / Claim

Interface Claim

lib/src/main/java/com/auth0/jwt/interfaces/Claim.java:13–131  ·  view source on GitHub ↗

The Claim class holds the value in a generic way so that it can be recovered in many representations.

Source from the content-addressed store, hash-verified

11 * The Claim class holds the value in a generic way so that it can be recovered in many representations.
12 */
13public interface Claim {
14
15 /**
16 * Whether this Claim has a null value or not.
17 * If the claim is not present, it will return false hence checking {@link Claim#isMissing} is advised as well
18 *
19 * @return whether this Claim has a null value or not.
20 */
21 boolean isNull();
22
23 /**
24 * Can be used to verify whether the Claim is found or not.
25 * This will be true even if the Claim has {@code null} value associated to it.
26 *
27 * @return whether this Claim is present or not
28 */
29 boolean isMissing();
30
31 /**
32 * Get this Claim as a Boolean.
33 * If the value isn't of type Boolean or it can't be converted to a Boolean, {@code null} will be returned.
34 *
35 * @return the value as a Boolean or null.
36 */
37 Boolean asBoolean();
38
39 /**
40 * Get this Claim as an Integer.
41 * If the value isn't of type Integer or it can't be converted to an Integer, {@code null} will be returned.
42 *
43 * @return the value as an Integer or null.
44 */
45 Integer asInt();
46
47 /**
48 * Get this Claim as an Long.
49 * If the value isn't of type Long or it can't be converted to a Long, {@code null} will be returned.
50 *
51 * @return the value as an Long or null.
52 */
53 Long asLong();
54
55 /**
56 * Get this Claim as a Double.
57 * If the value isn't of type Double or it can't be converted to a Double, {@code null} will be returned.
58 *
59 * @return the value as a Double or null.
60 */
61 Double asDouble();
62
63 /**
64 * Get this Claim as a String.
65 * If the value isn't of type String, {@code null} will be returned. For a String representation of non-textual
66 * claim types, clients can call {@code toString()}.
67 *
68 * @return the value as a String or null if the underlying value is not a string.
69 */
70 String asString();

Implementers 2

JsonNodeClaimlib/src/main/java/com/auth0/jwt/impl/J
ClaimImplForTestlib/src/test/java/com/auth0/jwt/interf

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…