Skip to content

Commit

Permalink
moved getByKey method from Env object
Browse files Browse the repository at this point in the history
  • Loading branch information
Hidanio committed Dec 8, 2023
1 parent 873420b commit abada63
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/com/vk/admstorm/env/Env.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ data class EnvConfig(
var services: List<Service> = listOf(),
)

fun List<Service>.getByKey(key: String) = firstOrNull { it.key == key }

object Env {
private val LOG = logger<Env>()

Expand All @@ -75,8 +77,6 @@ object Env {
private var myIsResolved = false
var data = EnvConfig()

fun List<Service>.getByKey(key: String) = firstOrNull { it.key == key }

private fun checkPropertyNotEmpty(name: String, value: String) =
value.ifEmpty { throw IllegalArgumentException(name) }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.vk.admstorm.highlight.markers.admmarker

import com.vk.admstorm.env.Env
import com.vk.admstorm.env.Env.getByKey
import com.vk.admstorm.env.getByKey
import com.vk.admstorm.highlight.markers.impl.IMarkerBrowser
import com.vk.admstorm.ui.AdmIcons

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.vk.admstorm.highlight.markers.admmarker

import com.vk.admstorm.env.Env
import com.vk.admstorm.env.Env.getByKey
import com.vk.admstorm.env.getByKey
import com.vk.admstorm.highlight.markers.impl.IMarkerBrowser
import com.vk.admstorm.ui.AdmIcons

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.vk.admstorm.highlight.markers.admmarker

import com.vk.admstorm.env.Env
import com.vk.admstorm.env.Env.getByKey
import com.vk.admstorm.env.getByKey
import com.vk.admstorm.highlight.markers.impl.IMarkerBrowser
import com.vk.admstorm.ui.AdmIcons

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.vk.admstorm.highlight.markers.admmarker

import com.vk.admstorm.env.Env
import com.vk.admstorm.env.Env.getByKey
import com.vk.admstorm.env.getByKey
import com.vk.admstorm.highlight.markers.impl.IMarkerBrowser
import com.vk.admstorm.ui.AdmIcons

Expand Down

0 comments on commit abada63

Please sign in to comment.