Skip to content

Add support for hashtables with enum/flags values#301

Merged
jwharm merged 2 commits intomainfrom
enum-hashtable
Nov 20, 2025
Merged

Add support for hashtables with enum/flags values#301
jwharm merged 2 commits intomainfrom
enum-hashtable

Conversation

@jwharm
Copy link
Owner

@jwharm jwharm commented Nov 20, 2025

  • Hashtables will no longer throw an exception when trying to insert an enum or flags value.
  • Enum and flags can now be constructed from a MemorySegment parameter.
  • The static factory method of(int) for flags classes now returns a Set instead of a single flag.

Fixes #297

For a Flags (i.e. bitfield) type, the Flags.of() static factory
method assumed the input value represented exactly one flag. This
is now fixed, and will return a Set<Flag> instead.

This is a breaking change for existing users of this method. But
because the old behavior was broken, I expect this will not be a
huge problem.
@jwharm jwharm merged commit 249341d into main Nov 20, 2025
@jwharm jwharm deleted the enum-hashtable branch November 20, 2025 08:47
@jwharm jwharm changed the title Add support hashtables with enum/flags values Add support for hashtables with enum/flags values Nov 24, 2025
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.

Unable to create HashTable with org.gnome.secret.SchemaAttributeType as value

1 participant