org.jclouds.rest.annotations
Annotation Type Unwrap


@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface Unwrap

Unwraps the only value in a nested json reponse ex. { "foo" :"bar" } becomes "bar"

Author:
Adrian Cole

Optional Element Summary
 int depth
          level to unwrap.
 Class<?> edgeCollection
          final collection type ex.
 

depth

public abstract int depth
level to unwrap. ex. if default (1) { "foo" :"bar" } becomes "bar" ex. if (2) { "foo" : {"bar" : ["baz"]} } becomes ["baz"]

Returns:
nestingLevel
Default:
1

edgeCollection

public abstract Class<?> edgeCollection
final collection type ex. if depth(2), edgeCollection(Map.class) { "foo" : {"bar" : ["baz"]} } becomes ["baz"] ex. if depth(3), edgeCollection(Set.class) { "foo" : {"bar" : ["baz"]} } becomes "baz"

Note

only Map and Set are valid

Returns:
Default:
java.util.Map.class


Copyright © 2009-2011 jclouds. All Rights Reserved.