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

boolean requirement #156

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

boolean requirement #156

wants to merge 1 commit into from

Conversation

FakEEE14
Copy link

i know you can check this with strings but this can be usefull to

Copy link
Member

@BlitzOffline BlitzOffline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello. The code looks good but I do have a question regarding clarity of what the requirement does.

public boolean evaluate(MenuHolder holder) {
String check = holder.setPlaceholdersAndArguments(bool);
try {
boolean bool = Boolean.parseBoolean(check);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not 100% sure if we want to use this method of parsing a boolean. It might cause confusion since if the value is anything other than "true" (ignoring case), it is considered to be "false". Maybe, instead, we might want to change the requirement name to "is true" or something similar to that?

@FakEEE14
Copy link
Author

FakEEE14 commented Dec 19, 2024

this is only for placeholders that return boolean that i named it after plugin.getConfig().getBoolean()
i know you can do this
input: 'true' output: 'true'
but want to add a simpler way to do it
i can make it to ignorecase and accept 0 and 1, should i ?

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.

2 participants