001package org.intellimate.izou.sdk.output; 002 003import com.google.common.reflect.TypeToken; 004import org.intellimate.izou.events.EventModel; 005import org.intellimate.izou.sdk.Context; 006 007/** 008 * an OutputExtension without an Argument 009 * @param <T> the return type 010 * @author Leander Kurscheidt 011 * @version 1.0 012 */ 013public abstract class OutputExtension<T> extends OutputExtensionArgument<T, Object> { 014 /** 015 * creates a new outputExtension with a new id 016 * 017 * @param context the context of the addon 018 * @param id the id to be set to the id of outputExtension 019 * @param pluginId the ID of the Plugin the OutputExtension is associated with 020 */ 021 public OutputExtension(Context context, String id, String pluginId) { 022 super(context, id, pluginId); 023 } 024 025 /** 026 * creates a new outputExtension with a new id 027 * 028 * @param id the id to be set to the id of outputExtension 029 * @param context the context of the addon 030 */ 031 public OutputExtension(String id, Context context) { 032 super(id, context); 033 } 034 035 /** 036 * returns the Type of the argument for the OutputExtensions, or null if none 037 * 038 * @return the type of the Argument 039 */ 040 @Override 041 public TypeToken<Object> getArgumentType() { 042 return null; 043 } 044 045 /** 046 * generates the data for the given Event 047 * 048 * @param event the event to generate for 049 * @param o the optional argument 050 * @return the result 051 */ 052 @Override 053 public T generate(EventModel event, Object o) { 054 return generate(event); 055 } 056 057 /** 058 * generates the data for the given Event 059 * 060 * @param event the event to generate for 061 * @return the result 062 */ 063 public abstract T generate(EventModel event); 064}