Skip to content

Commit

Permalink
fixed some mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
RealYusufIsmail committed Sep 11, 2022
1 parent d6f8cd3 commit 19acf03
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ import com.fasterxml.jackson.databind.ObjectMapper
import java.io.File
import java.io.IOException

/**
* Used to build a [JConfigBuilder] object.
*/
/** Used to build a [JConfigBuilder] object. */
class JConfigBuilder {
private var filename = "config.json"
private var directoryPath = "./"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,14 @@
*/
package io.github.realyusufismail.jconfig

import java.util.stream.Collectors

class JConfigImpl(entries: List<JsonEntry>) : JConfig {

private var mapEntries: Map<String, Any> = HashMap()
private var jsonEntries: Set<JsonEntry> = HashSet()

init {
this.mapEntries = JsonEntry.toMap(entries)
jsonEntries =
this.mapEntries.entries
.stream()
.map { entry: Map.Entry<String, Any> -> JsonEntry(entry.key, entry.value) }
.collect(Collectors.toSet())
jsonEntries = this.mapEntries.map { JsonEntry(it.key, it.value) }.toSet()
}

override val entries: Set<JsonEntry>
Expand Down

0 comments on commit 19acf03

Please sign in to comment.