2 * Rhynodge - Output.java - Copyright © 2013 David Roden
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package net.pterodactylus.rhynodge.output;
20 import net.pterodactylus.rhynodge.Trigger;
23 * Defines the output of a {@link Trigger}. As different output has to be
24 * generated for different media, the {@link #text(String, int)} method takes as
25 * an argument the MIME type of the desired output.
27 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
29 public interface Output {
32 * Returns a short summary that can be included e. g. in the subject of an
35 * @return A short summary of the output
40 * Returns the text for the given MIME type and the given maximum length.
41 * Note that the maximum length does not need to be enforced at all costs;
42 * implementation are free to return texts longer than the given number of
46 * The MIME type of the text (“text/plain” and “text/html” should
47 * be supported by all {@link Trigger}s)
49 * The maximum length of the returned text (may be < {@code 0}
50 * to indicate no length restriction)
51 * @return The text for the given MIME type, or {@code null} if there is no
52 * text defined for the given MIME type
54 String text(String mimeType, int maxLength);