src/main/java/au/id/djc/jena/util/ModelOperations.java (596B) - raw
1 package au.id.djc.jena.util; 2 3 import com.hp.hpl.jena.rdf.model.Model; 4 5 public interface ModelOperations { 6 7 public static interface ModelExecutionCallback<T> { 8 T execute(Model model); 9 } 10 public static abstract class ModelExecutionCallbackWithoutResult implements ModelExecutionCallback<Object> { 11 @Override 12 final public Object execute(Model model) { 13 executeWithoutResult(model); 14 return null; 15 } 16 protected abstract void executeWithoutResult(Model model); 17 } 18 19 <T> T withModel(ModelExecutionCallback<T> callback); 20 21 }