> + private final String type;
> +
> + Type(String type) {
> + this.type = type;
> + }
> +
> + public String type() {
> + return type;
> + }
> +
> + /**
> + * Used from jclouds builtin deserializer.
> + */
> + public static Type fromValue(String type) {
> + if (type != null) {
> + for (Type value : Type.values()) {
In previous revisions I had the following implementation:
```
private static final Map<String, Type> types;
static {
ImmutableMap.Builder<String, Type> builder = new
ImmutableMap.Builder<String, Type>();
for (Type t : values()) {
builder.put(t.type(), t);
}
types = builder.build();
}
...
/**
* Used from jclouds builtin deserializer.
*/
public static Type fromValue(String type) {
return types.get(type);
}
```
but @zack-shoylev suggested to switch to make it like in the example, see
previous related comments.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/339/files#r13038541