com.github.mati1979.play.soyplugin.data.EmptyToSoyDataConverter Maven / Gradle / Ivy
package com.github.mati1979.play.soyplugin.data;
import java.util.Optional;
import com.google.template.soy.data.SoyMapData;
/**
* Created with IntelliJ IDEA.
* User: mati
* Date: 20/06/2013
* Time: 22:34
*
* An implementation that always returns an Optional.empty(), implements
* Null Object Pattern
*/
public class EmptyToSoyDataConverter implements ToSoyDataConverter {
@Override
public Optional toSoyMap(final Object model) {
return Optional.of(new SoyMapData());
}
}