Jump to content

Menu


Recommended Posts

Posted (edited)

Alright,

I log this;

entity.getName().trim()

it returns entity name for example; Oak (nothing else)

 

then when i use;

menuOption.name.equalsIgnoreCase(entity.getName().trim())

for filter, it doesn't recognize it even though in logger it returns Oak and there shouldn't be anything else,

Any ideas ?

Edited by iJodix
Posted

oh right, it'll return <col=ffff>Oak but that is why i included .trim(); at entity.getName() so it removes that bs

trim doesn't remove "that bs", trim removes spaces

 

To remove "that bs" you probably gonna have to use a substring

//X = length of <col=fff>
String name = menu.name.substring(X, menu.name.length);
if (name.equalsIgnoreCase(...
Posted

MethodProvider#stripFormatting removes HTML tags smile.png

Thanks, did

        Optional<Option> ourOptionFilters = getMenuAPI().getMenu().stream().filter(menuOption -> stripFormatting(action).equalsIgnoreCase(stripFormatting(menuOption.action)) && stripFormatting(entity.getName()).equalsIgnoreCase(stripFormatting(menuOption.name))).findFirst();
 
and works perfectly :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...