Spring Util Map Annotation with Enum key

I wanted create java.util.Map in spring context xml file which injects the Map to one of my service class, but i was struggling with this because my Map's key is an enum value, Finally I was able fix that issue as following, in Spring we can specify the key-type and value-type specifically with generics values. That part was the interesting and new part i found time. All it goes as follows.

        <entry key="ENUM_VALUE"  value-ref="leastLoadedAssignmentMechanism" />


Popular posts from this blog

Solr Cloud 4.5

PostgreSQL bytea and oid

Microservices Architecture with Spring Boot in 15mins