velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matela <mmat...@man.poznan.pl>
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: http://old.nabble.com/Can%27t-acces-map-values-when-get%28%29-is-overriden-tp31955214p31971816.html
Sent from the Velocity - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message