TransWikia.com

Maintain a list of words in Java 8

Stack Overflow Asked by Sansel on August 30, 2020

I am using Java 8. My response object will contain a string of words. My requirement is to compare if the string contains a specific word, from a list of search words.

I have created an enum to hold the search words. Currently there are only 10 words in enum. This list can grow in future. What is the best approach to maintain this list of search words? Can I continue adding the words to enum or is there any other scalable alternative to maintain the list of words.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP