All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.squareup.inject.assisted.processor.internal.kotlinStdlib.kt Maven / Gradle / Ivy

There is a newer version: 0.8.1
Show newest version
package com.squareup.inject.assisted.processor.internal

// TODO https://youtrack.jetbrains.com/issue/KT-4734
fun  Map.filterNotNullValues(): Map {
  @Suppress("UNCHECKED_CAST")
  return filterValues { it != null } as Map
}

/** Equivalent to `this as T` for use in function chains. */
@Suppress("UNCHECKED_CAST", "NOTHING_TO_INLINE")
inline fun  Any.cast(): T = this as T

@Suppress("UNCHECKED_CAST", "NOTHING_TO_INLINE")
inline fun  Iterable<*>.castEach() = map { it as T }

inline fun  T.applyEach(items: Iterable, func: T.(I) -> Unit): T {
  items.forEach { item -> func(item) }
  return this
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy