mirror of
https://github.com/plexusorg/toml4j.git
synced 2024-12-28 19:24:15 +00:00
Added documentation
This commit is contained in:
parent
a0bd307f58
commit
15c014a327
3 changed files with 15 additions and 0 deletions
|
@ -9,6 +9,7 @@
|
|||
### Added
|
||||
|
||||
* Support for underscores in numbers (the feature branch had accidentally not been merged! :( )
|
||||
* Toml#entrySet()
|
||||
* Overloaded getters that take a default value. Thanks to __[udiabon](https://github.com/udiabon)__.
|
||||
|
||||
## 0.4.0 / 2015-02-16
|
||||
|
|
11
README.md
11
README.md
|
@ -204,6 +204,17 @@ Long tableD = toml.getLong("table.d"); // returns null, not 5, because of shallo
|
|||
Long arrayD = toml.getLong("array[0].d"); // returns 3
|
||||
```
|
||||
|
||||
### Reflection
|
||||
|
||||
`Toml#entrySet()` returns a Set of Toml.Entry instances exposing the name and value of each entry.
|
||||
|
||||
You can also convert a Toml instance to a `Map<String, Object>`:
|
||||
|
||||
```java
|
||||
Toml toml = new Toml().parse("a = 1");
|
||||
Map<String, Object> map = toml.to(Map.class);
|
||||
```
|
||||
|
||||
### Limitations
|
||||
|
||||
Date precision is limited to milliseconds.
|
||||
|
|
|
@ -283,6 +283,9 @@ public class Toml {
|
|||
return DEFAULT_GSON.fromJson(json, targetClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a {@link Set} of Toml.Entry instances, each exposing a name and a deserialised value.
|
||||
*/
|
||||
public Set<Toml.Entry> entrySet() {
|
||||
Set<Toml.Entry> entries = new LinkedHashSet<Toml.Entry>();
|
||||
|
||||
|
|
Loading…
Reference in a new issue