public abstract class

BaseWrapper

extends Object
java.lang.Object
   ↳ org.mule.modules.google.api.model.BaseWrapper<T extends com.google.api.client.json.GenericJson>

Class Overview

Generic wrapper for classes that extend com.google.api.client.json.GenericJson Because the GenericJson class from Google's client extends java.util.Map but still has the structure of a Pojo, Mule's DataMapper cannot handle it as both, Map and Pojo. Implementations of this class wraps this classes allowing DataMapper to treat them as Pojos

Summary

Fields
protected T extends GenericJson wrapped
Public Constructors
BaseWrapper(T wrapped)
Public Methods
static <G extends GenericJson, T extends BaseWrapper<?>> List<G> unwrapp(Collection<T> models, Class<G> returnClass)
Returns a new list with the wrapped objects
static <T extends BaseWrapper<?>, G extends GenericJson> List<T> valueOf(Collection<G> googles, Class<T> returnClass)
takes a collection of com.google.api.client.json.GenericJson and returns a list of wrappers of class returnClass
T wrapped()
Returns the wrapped object
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected T extends GenericJson wrapped

Public Constructors

public BaseWrapper (T wrapped)

Parameters
wrapped

Public Methods

public static List<G> unwrapp (Collection<T> models, Class<G> returnClass)

Returns a new list with the wrapped objects

Parameters
models The wrappers
returnClass The return type
Returns
  • a list of wrapped objects

public static List<T> valueOf (Collection<G> googles, Class<T> returnClass)

takes a collection of com.google.api.client.json.GenericJson and returns a list of wrappers of class returnClass

Parameters
googles A collection of google objects
returnClass The class of the objects returned
Returns
  • a list of returnClass

public T wrapped ()

Returns the wrapped object

Returns
  • the wrapped object