/** * Generate a reference token from an integer * * @param index the integer * @return a token */ public static ReferenceToken fromInt(final int index) { final String s = Integer.toString(index); return new ReferenceToken(s, s); }
/** * Generate a reference token from an integer * * @param index the integer * @return a token */ public static ReferenceToken fromInt(final int index) { final String s = Integer.toString(index); return new ReferenceToken(s, s); }
/** * Generate a reference token from a decoded (raw) representation * * @param raw the input * @return a token * @throws NullPointerException null input */ public static ReferenceToken fromRaw(final String raw) { BUNDLE.checkNotNull(raw, "nullInput"); return new ReferenceToken(asCooked(raw), raw); }
/** * Generate a reference token from a decoded (raw) representation * * @param raw the input * @return a token * @throws NullPointerException null input */ public static ReferenceToken fromRaw(final String raw) { BUNDLE.checkNotNull(raw, "nullInput"); return new ReferenceToken(asCooked(raw), raw); }
/** * Generate a reference token from an encoded (cooked) representation * * @param cooked the input * @return a token * @throws JsonPointerException illegal token (bad encode sequence) * @throws NullPointerException null input */ public static ReferenceToken fromCooked(final String cooked) throws JsonPointerException { BUNDLE.checkNotNull(cooked, "nullInput"); return new ReferenceToken(cooked, asRaw(cooked)); }
/** * Generate a reference token from an encoded (cooked) representation * * @param cooked the input * @return a token * @throws JsonPointerException illegal token (bad encode sequence) * @throws NullPointerException null input */ public static ReferenceToken fromCooked(final String cooked) throws JsonPointerException { BUNDLE.checkNotNull(cooked, "nullInput"); return new ReferenceToken(cooked, asRaw(cooked)); }