Use a custom serializer if the data type is int, long, or double.