public final class KVFile extends Object
Properties.
However, it is easier to work with in the fxgl asset management context.
Example of a .kv file: hp = 100.50 level = 5 name = Test Name canJump = true
Only primitive types and String are supported. The resulting data type will be determined by the field type with matching name.
| Constructor and Description |
|---|
KVFile(List<String> fileLines)
Constructs KVFile from lines of plain text.
|
| Modifier and Type | Method and Description |
|---|---|
static KVFile |
from(Object data)
A factory constructor for KVFile, which also populates the
created instance with key-value data from given object using
its declared fields.
|
<T> T |
to(Class<T> type)
Converts an instance of KVFile to instance of the data
structure and populates its fields with appropriate values.
|
String |
toString() |
public static KVFile from(Object data)
data - object to convert to kv filepublic <T> T to(Class<T> type)
type - data structure typeCopyright © 2018. All rights reserved.