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 new Module util methods #4730

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

RacoonDog
Copy link
Contributor

@RacoonDog RacoonDog commented Jul 7, 2024

Type of change

  • Bug fix
  • New feature

Description

  • Add Module#enable as a shorthand for if (!module.isActive()) module.toggle();
  • Add Module#disable as a shorthand for if (module.isActive()) module.toggle();
  • Add Modules#getOptional for those who prefer a more functional programming style with Optionals
  • Rework SettingGroup#add generics:
    Previously, ColorSetting setting = sgGeneral.add(new ColorSetting(...)); was not possible without casting, as SettingGroup#add returned a typed Setting instance. It now returns the exact type that it received as input.

How Has This Been Tested?

works grate 👍

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

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