0

I've an Enum class

public enum MyEnum{
    ABC;
}

And i have this spring xml configuration.

<util:map id="myMap">
    <entry key="ABC" value-ref="myObj" />
</util:map>

<bean id="mick" class="com.x.Mick">
    <property name="myMap" ref="myMap" />
</bean>

Above setup works fine and key to the map is passed as enum. But now my requirement is to pass the Key in String type from enum i.e. My map will look Map<String,String> instead of Map<MyEnum,String>

Any suggestions on how to go about this?

Lokesh
  • 7,810
  • 6
  • 48
  • 78

1 Answers1

0

Take a look at this post: Using Enum values as String literals

I guess that is just the Thing you want if i understand you correctly.

Community
  • 1
  • 1
JGR
  • 33
  • 5