Class Friendly

java.lang.Object
me.ahoo.cosid.codec.Friendly
All Implemented Interfaces:
IdCodec

public final class Friendly extends Object implements IdCodec
Encodes a time-based id as readable text, yyyyMMddHHmmssSSS-<node>-<seq>, from Layout.unpack(long); the time zone is always explicit (03-core-model.md ยง1). Formats through precomputed field widths into a char[], without DateTimeFormatter.

The text holds a local time without its offset. In a zone with daylight saving time, the hour repeated when the clocks go back reads twice: decode(String) resolves it to the earlier instant (as ZonedDateTime.of does, and as 4.x did), so ids of the later pass through that hour do not round-trip. Use UTC or a fixed-offset zone when ids must decode exactly.

  • Method Details