Skip to content

Commit

Permalink
Add deprecation warning to ComponentSerializer.toString(Object)
Browse files Browse the repository at this point in the history
Its error-prone, the overloads are fine tho
  • Loading branch information
Janmm14 committed Apr 14, 2024
1 parent 6282295 commit 6cb2be9
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ public static JsonElement toJson(ComponentStyle style)
return gson.toJsonTree( style );
}

/**
* @param object the object to serialize
* @return the JSON string representation of the object
* @deprecated Error-prone, be careful which object you input here
*/
@Deprecated
public static String toString(Object object)
{
return gson.toJson( object );
Expand Down

0 comments on commit 6cb2be9

Please sign in to comment.