public static @ NonNull GsonBuilder populate ( final @ NonNull GsonBuilder builder ) { builder . registerTypeHierarchyAdapter ( Component . class , INSTANCE ) . registerTypeAdapter ( ClickEvent . Action . class , new NameMapSerializer <> ( "click action" , ClickEvent . Action . NAMES ) ) . registerTypeAdapter ( HoverEvent . Action . class , new NameMapSerializer <> ( "hover action" , HoverEvent . Action . NAMES ) ) . registerTypeAdapter ( TextColorWrapper . class , new TextColorWrapper . Serializer ( ) ) . registerTypeAdapter ( TextColor . class , new NameMapSerializer <> ( "text color" , TextColor . NAMES ) ) . registerTypeAdapter ( TextDecoration . class , new NameMapSerializer <> ( "text decoration" , TextDecoration . NAMES ) ) ; return builder ; }
Populate a builder with our serializers .