CharacterMetadata is an Immutable Record that represents the inline style and entity information for a single character.
Key Concept: Pooling
CharacterMetadata objects are aggressively pooled and shared to keep the memory footprint small. If two characters share the same inline style and entity, they point to the exact same object.
Important Usage Rule:
Because of this pooling mechanism, you must never attempt to instantiate or modify these objects directly. You must use the provided static methods (create, applyStyle, removeStyle, applyEntity) to ensure that the pooling logic is correctly utilized and that you receive either a matching pooled object or a new pooled instance.