me.jacklin213.lincore.utils
Class DataStorage

java.lang.Object
  extended by me.jacklin213.lincore.utils.DataStorage

public class DataStorage
extends Object

DataStorage class, Contains basic variables and methods to set them. To add extra variables create a local class and extend DataStorage. Make sure to use the setVariables methods afterwards to store them in this class.

Author:
jacklin213

Constructor Summary
DataStorage(Plugin instance, PluginDescriptionFile pdfFile)
          DataStorage constructor for LinPlugin series.
 
Method Summary
 void addVariable(String key, String value)
          Adds a variable to the local HashMap.
 boolean contains(String key)
          Checks to see if the local HashMap contains a variable.
 String getVaribale(String variable)
          Accesses the private HashMap: variables and gets the variable value.
 void removeVariable(String key)
          Removes variable from the local HashMap.
 void setAuthor(String author)
          Sets the author variable.
 void setChatPluginName(String chatPluginName)
          Sets the chatPluginName with color and formatting.
 void setDescription(String description)
          Sets the description.
 void setInvalidCommand(String invalidCommand)
          Sets the invalidCommand message.
 void setInvalidNumber(String invalidNumber)
          Sets the invalidNumber message.
 void setInvalidPlayer(String invalidPlayer)
          Sets the invalidPlayer message
 void setPDFVariables()
          Set the Name, Version, Description Variables from the PluginDescriptionFile
 void setPermMessage(String permMessage)
          Sets the permMessage.
 void setPlayerOnly(String playerOnly)
          Sets the playerOnly message.
 void setPluginDescriptionFile()
          Sets the PluginDescriptionFile(Does not need to be used, DataStorage constructor already does this).
 void setPluginName(String pluginName)
          Sets the plain pluginName, stripped of color/formatting.
 void setVariables()
          SetVariables method - Runs the setPDFVariables method, Clears the local variable HashMap and stores all the new variables inside
 void setVersion(String version)
          Sets the version.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataStorage

public DataStorage(Plugin instance,
                   PluginDescriptionFile pdfFile)
DataStorage constructor for LinPlugin series. Runs the setVariables method.

Parameters:
instance -
pdfFile -
Method Detail

getVaribale

public String getVaribale(String variable)
Accesses the private HashMap: variables and gets the variable value.

Parameters:
variable - Key/Variable name
Returns:
Value/Variable value

addVariable

public void addVariable(String key,
                        String value)
Adds a variable to the local HashMap.

Parameters:
key - Variable name
value - Variable value

removeVariable

public void removeVariable(String key)
Removes variable from the local HashMap.

Parameters:
key - Variable name

contains

public boolean contains(String key)
Checks to see if the local HashMap contains a variable.

Parameters:
key - Varible name
Returns:
true If HashMap contains key

setAuthor

public void setAuthor(String author)
Sets the author variable.

Parameters:
author - String grabbed from the PluginDescriptionFile

setChatPluginName

public void setChatPluginName(String chatPluginName)
Sets the chatPluginName with color and formatting.

Parameters:
chatPluginName - Formatted pluginName

setDescription

public void setDescription(String description)
Sets the description.

Parameters:
description - String grabbed from the PluginDescriptionFile

setPluginName

public void setPluginName(String pluginName)
Sets the plain pluginName, stripped of color/formatting.

Parameters:
pluginName - String grabbed from the PluginDescriptionFile

setVersion

public void setVersion(String version)
Sets the version.

Parameters:
version - String grabbed from the PluginDescriptionFile

setInvalidCommand

public void setInvalidCommand(String invalidCommand)
Sets the invalidCommand message.

Parameters:
invalidCommand - Formatted invalidCommand message

setInvalidNumber

public void setInvalidNumber(String invalidNumber)
Sets the invalidNumber message.

Parameters:
invalidNumber - Formatted invalidNumber message

setInvalidPlayer

public void setInvalidPlayer(String invalidPlayer)
Sets the invalidPlayer message

Parameters:
invalidPlayer - Formatted invalidPlayer message

setPlayerOnly

public void setPlayerOnly(String playerOnly)
Sets the playerOnly message.

Parameters:
playerOnly - Formatted playerOnly message

setPluginDescriptionFile

public void setPluginDescriptionFile()
Sets the PluginDescriptionFile(Does not need to be used, DataStorage constructor already does this).


setPermMessage

public void setPermMessage(String permMessage)
Sets the permMessage.

Parameters:
permMessage - Formatted permMessage

setPDFVariables

public void setPDFVariables()
Set the Name, Version, Description Variables from the PluginDescriptionFile


setVariables

public void setVariables()
SetVariables method - Runs the setPDFVariables method, Clears the local variable HashMap and stores all the new variables inside