public class TLConfiguration
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
java.util.List<TLVariable> |
contents()
Returns all the variables in the configuration as a
List . |
boolean |
exists(java.lang.String name)
Checks the existence of a variable with such name.
|
boolean |
exists(TLVariable var)
Checks the existence of the provided variable.
|
java.util.List<TLVariable> |
getByValue(java.lang.String value)
Returns a
List of all the variables with the specified value. |
int |
getFailed()
Returns the number of lines failed to load during the last reload of the configuration.
|
java.io.File |
getSource()
Returns the absolute
File that is the source of this configuration. |
java.lang.String |
getValue(java.lang.String name)
Returns the String representation of the value of the variable by the specified name, ignoring case.
|
java.lang.String |
getValue(java.lang.String name,
java.lang.String def)
Returns the String representation of the value of the variable by the specified name, ignoring case.
|
TLVariable |
getVariable(java.lang.String name)
Returns a
TLVariable by the specified name, ignoring case. |
TLVariable |
getVariable(java.lang.String name,
TLVariable def)
Returns a
TLVariable by the specified name, ignoring case. |
int |
reload()
Reloads the configuration from the
source . |
int |
size()
Returns the total amount of variables contained in the configuration.
|
public final java.io.File getSource()
File
that is the source of this configuration.public final int getFailed()
public TLVariable getVariable(java.lang.String name)
TLVariable
by the specified name, ignoring case.name
- The name to search against. If null is provided, "null" is used instead.public TLVariable getVariable(java.lang.String name, TLVariable def)
TLVariable
by the specified name, ignoring case.name
- The name to search against. If null is provided, "null" is used instead.def
- The default value used in case no variable is found.public java.lang.String getValue(java.lang.String name)
name
- The name to search against. If null is provided, "null" is used instead.public java.lang.String getValue(java.lang.String name, java.lang.String def)
name
- The name to search against. If null is provided, "null" is used instead.def
- The default value used in case no variable is found.public java.util.List<TLVariable> getByValue(java.lang.String value)
List
of all the variables with the specified value. Case-sensitive.value
- The name to search against. If null is provided, "null" is used instead.public boolean exists(java.lang.String name)
name
- The name to check against. If null is provided, "null" is used instead.public boolean exists(TLVariable var)
var
- The variable to check against. If null is provided, "null" is used instead.public java.util.List<TLVariable> contents()
List
.public int size()
public int reload() throws java.io.IOException, TLException
source
.
In case of an exception the contents do not change.TLException
- If the file could not be red correctly or doesn't exist anymore.java.io.IOException
- If an IO error occurs.TurretLang.load(File)