Added documentation

This commit is contained in:
moandji.ezana 2015-04-28 12:07:34 +02:00
parent a0bd307f58
commit 15c014a327
3 changed files with 15 additions and 0 deletions

View file

@ -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

View file

@ -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.

View file

@ -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>();