public abstract class PluginData extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
analysisOnly
Determines if the datapoint should only be used for the analysis page.
|
protected List<AnalysisType> |
analysisTypes
A list containing the AnalysisType enums that determine what should be
done with the data on the analysis page.
|
protected String |
icon
Font Awesome icon name.
|
protected String |
placeholder
Placeholder string, for example "stepsTaken".
|
protected String |
prefix
Prefix shown before the data, for example "Steps taken: ".
|
protected String |
sourcePlugin
Name of the plugin the data is coming from.
|
protected String |
suffix
Suffix shown after the data, for example " steps".
|
Constructor and Description |
---|
PluginData(String sourcePlugin,
String placeholder)
Constructor for Inspect-page only data point.
|
PluginData(String sourcePlugin,
String placeholder,
AnalysisType... analysisTypes)
Constructor for accepting single, multiple and arrays of AnalysisType.
|
PluginData(String sourcePlugin,
String placeholder,
List<AnalysisType> analysisTypes)
Main constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
analysisOnly()
Used to get the analysisOnly parameter.
|
boolean |
equals(Object obj)
If a PluginData object has same placeholder, sourcePlugin and
analysisTypes, it is considired equal.
|
List<AnalysisType> |
getAnalysisTypes()
Returns the list of AnalysisTypes.
|
abstract String |
getHtmlReplaceValue(String modifierPrefix,
UUID uuid)
Used to get the string for the html page.
|
String |
getPlaceholder(String modifier)
Used to get the full placeholder.
|
String |
getPrefix()
Used to get the prefix.
|
String |
getSourcePlugin()
Used to get the source plugin's name.
|
String |
getSuffix()
Used to get the suffix.
|
abstract Serializable |
getValue(UUID uuid)
Used to get the value for analysis.
|
int |
hashCode() |
String |
parseContainer(String modifier,
String contents)
This method should be used with the return values of
getHtmlReplaceValue(String, UUID).
|
void |
setAnalysisOnly(boolean analysisOnly)
Used to set the analysisOnly parameter.
|
void |
setIcon(String iconName)
Used to set the Font Awesome icon.
|
void |
setPrefix(String prefix)
Used to set the prefix.
|
void |
setSuffix(String suffix)
Used to set the suffix.
|
protected String placeholder
protected String sourcePlugin
protected boolean analysisOnly
protected String icon
protected String prefix
protected String suffix
protected List<AnalysisType> analysisTypes
public PluginData(String sourcePlugin, String placeholder, List<AnalysisType> analysisTypes)
sourcePlugin
- Name of the plugin the data is coming fromplaceholder
- Placeholder string, for example "stepsTaken"analysisTypes
- A list containing the AnalysisType enums that
determine what should be done with the data on the analysis pagepublic PluginData(String sourcePlugin, String placeholder, AnalysisType... analysisTypes)
sourcePlugin
- Name of the plugin the data is coming fromplaceholder
- Placeholder string, for example "stepsTaken"analysisTypes
- AnalysisType enums that determine what should be
done with the data on the analysis pagepublic final List<AnalysisType> getAnalysisTypes()
public final String parseContainer(String modifier, String contents)
modifier
- For example "Average " - Determined by value of
AnalysisType's modifier-variable.contents
- The data, number/string/html that should be placed on the
page.AnalysisType
public final String getPlaceholder(String modifier)
modifier
- Modifier determined by AnalysisType's
placeholderModifier-variable.AnalysisType
public final String getSourcePlugin()
public abstract String getHtmlReplaceValue(String modifierPrefix, UUID uuid)
modifierPrefix
- Modifier determined by AnalysisType's
modifier-variable.uuid
- UUID of the player or random UUID if AnalysisType.HTML is
used.public abstract Serializable getValue(UUID uuid)
uuid
- UUID of the player the value belongs to.public final void setPrefix(String prefix)
prefix
- for example "Steps Taken: " or a Html start tag.public final void setSuffix(String suffix)
suffix
- for example " steps" or a html end tag.public final void setIcon(String iconName)
iconName
- Icon's name http://fontawesome.io/icons/public final void setAnalysisOnly(boolean analysisOnly)
analysisOnly
- true/falsepublic final boolean analysisOnly()
public final String getPrefix()
public final String getSuffix()
public final boolean equals(Object obj)
Copyright © 2017. All rights reserved.