Because Collection
s do not have key/value or index behavior or get()
method. Let's look your example:
getProperty("returnConstraints")
returns a Set<String>
. In that case, what would be the [0]
on the Set
? Set
simply can not be used like this :)
Your example looks like your property has to be String[]
or List<String>
or (unlikely) Map<Integer, String>
.