Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add toString() methods for GType and GVariant #170

Merged
merged 1 commit into from
Dec 21, 2024
Merged

Conversation

jwharm
Copy link
Owner

@jwharm jwharm commented Dec 21, 2024

This PR adds a toString() method to the Java classes for GType and GVariant for easier printing and debugging.

The Type.toString() method calls g_type_name(). It is added on the Type class in GObject, because g_type_name is in the GObject namespace, so it's pretty useless as long as Java-GI is completely built around the Type class in GLib.

The Variant.toString() method calls g_variant_print(true) so it displays both the value and the type information.

@jwharm jwharm merged commit b3a05cf into main Dec 21, 2024
@jwharm jwharm deleted the tostring-methods branch December 21, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant