velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matela <>
Subject Re: Can't acces map values when get() is overriden
Date Fri, 01 Jul 2011 08:27:23 GMT

The Map<V, K> interface declares method
public V get(Object key)
and not
public V get(K key)
The idea is that, for example, for Map<String, String>, you're free to pass
any Object as key but you should simply get null if you pass anything that
is not String. That's why I thought the best option should be to override
get(Object key) method, and not to add get(String key) method (which is not
declared in the original Map interface). Turns out the latter option
actually works with Velocity.

At first I was using Velocity 1.4, but I see that version 1.7 behaves the
same way.
View this message in context:
Sent from the Velocity - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message