added working test casres for groovy style markup builders
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package std.util
|
||||
|
||||
import java.util.Map as JMap
|
||||
import java.util.Map.Entry as JEntry
|
||||
|
||||
// Map APIs
|
||||
|
||||
@@ -12,6 +13,14 @@ val JMap<*,*>.size : Int
|
||||
val JMap<*,*>.empty : Boolean
|
||||
get() = isEmpty()
|
||||
|
||||
/** Returns the key of the entry */
|
||||
val <K,V> JEntry<K,V>.key : K
|
||||
get() = getKey()
|
||||
|
||||
/** Returns the value of the entry */
|
||||
val <K,V> JEntry<K,V>.value : V
|
||||
get() = getValue()
|
||||
|
||||
/** Returns the value for the given key or returns the result of the defaultValue function if there was no entry for the given key */
|
||||
inline fun <K,V> java.util.Map<K,V>.getOrElse(key: K, defaultValue: ()-> V) : V {
|
||||
val current = this.get(key)
|
||||
|
||||
Reference in New Issue
Block a user