Annotation Interface AsString


@Target({FIELD,METHOD}) @Retention(RUNTIME) @Inherited public @interface AsString
Writes a long / Long id as JSON text and reads it back (07-runtime-and-spring.md ยง5).

The text is either the codec of a runtime generator (generator(), which needs a CosIdJacksonModule bound to the runtime) or an inline codec():


 @AsString long id;                                                    // radix 62, 11 digits, padded (as in 4.x)
 @AsString(generator = "order") long orderId;                          // the codec of generator "order"
 @AsString(codec = Codec.TO_STRING) long a;                            // decimal text
 @AsString(radix = 36, width = 13, padStart = false) long b;
 @AsString(codec = Codec.FRIENDLY, layout = Preset.SNOWFLAKE_S, zone = "Asia/Shanghai") long c;
 @AsString(codec = Codec.FRIENDLY, timeBits = 41, nodeBits = 5, seqBits = 17) long d;
 
Reading also accepts a JSON number that the codec could have written, and reads an empty string as null.