toJson abstract method

Map<String, Object> toJson()

Serializes this resource to a JSON-encodable map.

Returns:

  • A map containing all relevant resource metadata
  • Should include at minimum a 'type' field identifying the resource kind
  • Must contain only JSON-encodable values

Implementation Requirements:

  • Must be overridden by subclasses
  • Should include all identifying metadata
  • Should maintain backward compatibility

Example Output:

{
  "type": "font",
  "family": "Roboto",
  "files": ["Roboto-Regular.ttf", "Roboto-Bold.ttf"]
}

Implementation

Map<String, Object> toJson();