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
          Deprecated. 
 Class<?> edgeCollection
          Deprecated. 
 

depth

@Deprecated
public abstract int depth
Deprecated. 

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

Deprecation

Note that using @SelectJson("bar") is more effective than guessing the depth

See Also:
SelectJson
Default:
1

edgeCollection

@Deprecated
public abstract Class<?> edgeCollection
Deprecated. 

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

Deprecation

Note that using @SelectJson("bar") @OnlyElement will have the same effect

See Also:
SelectJson, OnlyElement
Default:
java.util.Map.class


Copyright © 2009-2011 jclouds. All Rights Reserved.