@ Override public Optional < SoyMapData > toSoyMap ( @ Nullable final Object model ) throws Exception { if ( model instanceof SoyMapData ) { return Optional . of ( ( SoyMapData ) model ) ; } if ( model instanceof Map ) { return Optional . of ( new SoyMapData ( model ) ) ; } return Optional . of ( new SoyMapData ( ) ) ; }
Pass a model object and return a SoyMapData if a model object happens to be a SoyMapData .