Ok. If you could, I would like to understand how to fix that error though incase I need to use an ArrayList and add items.
On another note, rethinking my plugin structure I was able to do this:
keywords:
topic-name:
words:
negative:
- - word1
- word2
- - word1
- word2
positive:
- - word1
- word2
- - word1
- word2
reply:
what: Your auto-response goes here.
how: Your auto-response goes here.
when: Your auto-response goes here.
where: Your auto-response goes here.
why: Your auto-response goes here.
who: Your auto-response goes here.
using this:
private HashMap<String, Object> configDefaults = new HashMap<String, Object>();
private String[] defaultPositiveWordsList1 = {"word1","word2"};
private String[] defaultPositiveWordsList2 = {"word1","word2"};
private String[] defaultNegativeWordsList1 = {"word1","word2"};
private String[] defaultNegativeWordsList2 = {"word1","word2"};
private Object[] defaultPositiveWordList = {defaultPositiveWordsList1,defaultPositiveWordsList2};
private Object[] defaultNegativeWordList = {defaultNegativeWordsList1,defaultNegativeWordsList2};
private String defaultReply = "Your auto-response goes here.";
public AssistantConfig(File configFile){
this.config = new Configuration(configFile);
this.configDefaults.put("keywords.topic-name.words.positive", defaultPositiveWordList);
this.configDefaults.put("keywords.topic-name.words.negative", defaultNegativeWordList);
this.configDefaults.put("keywords.topic-name.reply.who", defaultReply);
this.configDefaults.put("keywords.topic-name.reply.what", defaultReply);
this.configDefaults.put("keywords.topic-name.reply.where", defaultReply);
this.configDefaults.put("keywords.topic-name.reply.when", defaultReply);
this.configDefaults.put("keywords.topic-name.reply.why", defaultReply);
this.configDefaults.put("keywords.topic-name.reply.how", defaultReply);
But is there a way to make my config file look like this instead?
keywords:
topic-name:
words:
negative:
- [word1,word2]
- [word1,word2]
positive:
- [word1,word2]
- [word1,word2]
Again, thanks for your help.