Class ClajConfig.Field<T>
java.lang.Object
com.xpdustry.claj.server.ClajConfig.Field<T>
- All Implemented Interfaces:
Autosaver.Saveable
- Direct Known Subclasses:
ClajConfig.SetField
- Enclosing class:
ClajConfig
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds changed callback.protected TcheckValue(T value) Tries to decode the value from aStringby parsing and decoding as Json.protected TdecodeValue(String value) get()booleanvoidload()protected Tbooleanmodified()name()Used for logging.protected voidvoidreload()voidsave()protected voidvoidvoidtoString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Autosaver.Saveable
forceSave
-
Field Details
-
key
-
desc
-
defaultValue
-
type
-
changed
-
value
-
loaded
protected boolean loaded -
modified
protected boolean modified
-
-
Constructor Details
-
Field
-
Field
-
Field
-
Field
-
-
Method Details
-
name
Description copied from interface:Autosaver.SaveableUsed for logging.- Specified by:
namein interfaceAutosaver.Saveable- Returns:
- "field '" +
key+ "'".
-
modified
public boolean modified()- Specified by:
modifiedin interfaceAutosaver.Saveable
-
checkValue
-
loadValue
-
reload
public void reload() -
load
public void load() -
saveValue
protected void saveValue() -
save
public void save()- Specified by:
savein interfaceAutosaver.Saveable
-
get
-
set
-
notifyChange
protected void notifyChange() -
getDefault
-
setDefault
public void setDefault() -
isDefault
public boolean isDefault() -
changed
Adds changed callback. -
toString
-
decodeValue
-
decode
Tries to decode the value from aStringby parsing and decoding as Json.- Throws:
IllegalArgumentException- if decoding failed, or decoded type is not the same.
-