micro_utils.dokka
0.15.1

# Package-level declarations

## Types

ArgumentPropertyNonNullableDelegate
Link copied to clipboard
object ArgumentPropertyNonNullableDelegate
ArgumentPropertyNullableDelegate
Link copied to clipboard
object ArgumentPropertyNullableDelegate
ByteArrayAllocator
Link copied to clipboard
typealias ByteArrayAllocator = () -> ByteArray
ByteArrayAllocatorSerializer
Link copied to clipboard
object ByteArrayAllocatorSerializer : KSerializer<ByteArrayAllocator>
Diff
Link copied to clipboard
data class Diff<T>

Diff object which contains information about differences between two Iterables

Either
Link copied to clipboard
@Serializable(with = EitherSerializer::class)
interface Either<T1, T2>

Realization of this interface will contains at least one not null - optionalT1 or optionalT2

EitherFirst
Link copied to clipboard
@Serializable
data class EitherFirst<T1, T2>(val t1: T1) : Either<T1, T2>

This type Either will always have not nullable optionalT1

EitherSecond
Link copied to clipboard
@Serializable
data class EitherSecond<T1, T2>(val t2: T2) : Either<T1, T2>

This type Either will always have not nullable optionalT2

EitherSerializer
Link copied to clipboard
class EitherSerializer<T1, T2>(t1Serializer: KSerializer<T1>, t2Serializer: KSerializer<T2>) : KSerializer<Either<T1, T2>>
FileName
Link copied to clipboard
@Serializable
@JvmInline
value class FileName(val string: String)
MPPFile
Link copied to clipboard
expect class MPPFile
Optional
Link copied to clipboard
@Serializable
data class Optional<T>

This type represents T as not only potentially nullable data, but also as a data which can not be presented. This type will be useful in cases when T is nullable and null as valuable data too in time of data absence should be presented by some third type.

PreviewFeature
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FIELD, AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.FUNCTION, AnnotationTarget.TYPEALIAS])
annotation class PreviewFeature(val message: String = "It is possible, that behaviour of this thing will be changed or removed in future releases")
Progress
Link copied to clipboard
@Serializable
@JvmInline
value class Progress
SimpleMapper
Link copied to clipboard
interface SimpleMapper<T1, T2>
SimpleMapperImpl
Link copied to clipboard
class SimpleMapperImpl<T1, T2>(t1: (T2) -> T1, t2: (T1) -> T2) : SimpleMapper<T1, T2>
SimpleSuspendableMapper
Link copied to clipboard
interface SimpleSuspendableMapper<T1, T2>
SimpleSuspendableMapperImpl
Link copied to clipboard
class SimpleSuspendableMapperImpl<T1, T2>(t1: suspend (T2) -> T1, t2: suspend (T1) -> T2) : SimpleSuspendableMapper<T1, T2>
SuspendByteArrayAllocator
Link copied to clipboard
typealias SuspendByteArrayAllocator = suspend () -> ByteArray
Warning
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FIELD, AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.FUNCTION, AnnotationTarget.TYPEALIAS])
annotation class Warning(val message: String)

## Functions

applyDiff
Link copied to clipboard
fun <T> MutableList<T>.applyDiff(source: Iterable<T>, strictComparison: Boolean = false): Diff<T>

This method call calculateDiff with strict mode strictComparison and then apply differences to this mutable list

argumentOrNull
Link copied to clipboard
fun argumentOrNull(): ArgumentPropertyNullableDelegate
argumentOrThrow
Link copied to clipboard
fun argumentOrThrow(): ArgumentPropertyNonNullableDelegate
asAllocator
Link copied to clipboard
suspend fun SuspendByteArrayAllocator.asAllocator(): ByteArrayAllocator
bytes
Link copied to clipboard
suspend fun MPPFile.bytes(): ByteArray
bytesSync
Link copied to clipboard
fun MPPFile.bytesSync(): ByteArray
calculateDiff
Link copied to clipboard
fun <T> Iterable<T>.calculateDiff(other: Iterable<T>, strictComparison: Boolean = false): Diff<T>

Calculating Diff object

calculateStrictDiff
Link copied to clipboard
inline fun <T> Iterable<T>.calculateStrictDiff(other: Iterable<T>): Diff<T>

This method call calculateDiff with strict mode enabled

changeVisibility
Link copied to clipboard
fun View.changeVisibility(show: Boolean = !isShown, goneOnHide: Boolean = true)
collapse
Link copied to clipboard
fun View.collapse(duration: Long = 500)
collapseHorizontally
Link copied to clipboard
fun View.collapseHorizontally(duration: Long = 500)
compareTo
Link copied to clipboard
operator fun Progress.compareTo(other: Progress): Int
convert
Link copied to clipboard
@JvmName(name = "convertFromT2")
fun <T1, T2> SimpleMapper<T1, T2>.convert(from: T2): T1
@JvmName(name = "convertFromT1")
fun <T1, T2> SimpleMapper<T1, T2>.convert(from: T1): T2
@JvmName(name = "convertFromT2")
suspend fun <T1, T2> SimpleSuspendableMapper<T1, T2>.convert(from: T2): T1
@JvmName(name = "convertFromT1")
suspend fun <T1, T2> SimpleSuspendableMapper<T1, T2>.convert(from: T1): T2
dataOrElse
Link copied to clipboard
inline fun <T> Optional<T>.dataOrElse(block: () -> T): T

Returns Optional.data if Optional.dataPresented of this is true, or call block and returns the result of it

dataOrNull
Link copied to clipboard
fun <T> Optional<T>.dataOrNull(): T?

Returns Optional.data if Optional.dataPresented of this is true, or null otherwise

dataOrThrow
Link copied to clipboard
fun <T> Optional<T>.dataOrThrow(throwable: Throwable): T

Returns Optional.data if Optional.dataPresented of this is true, or throw throwable otherwise

Diff
Link copied to clipboard
inline fun <T> Iterable<T>.diff(other: Iterable<T>, strictComparison: Boolean = false): Diff<T>
disable
Link copied to clipboard
fun View.disable()
div
Link copied to clipboard
operator fun Progress.div(i: Byte): Progress
operator fun Progress.div(i: Double): Progress
operator fun Progress.div(i: Float): Progress
operator fun Progress.div(i: Int): Progress
operator fun Progress.div(i: Long): Progress
operator fun Progress.div(i: Short): Progress
downloadToTempFile
Link copied to clipboard
fun InputStream.downloadToTempFile(fileName: String = UUID.randomUUID().toString(), fileExtension: String? = ".temp", folder: File? = null): File
fun InputStream.downloadToTempFile(fileName: String = UUID.randomUUID().toString(), fileExtension: String? = ".temp", folder: File? = null): File
either
Link copied to clipboard
inline fun <T1, T2> Any.either(): <Error class: unknown class>
enable
Link copied to clipboard
fun View.enable()
expand
Link copied to clipboard
fun View.expand(duration: Long = 500, targetWidth: Int = ViewGroup.LayoutParams.MATCH_PARENT, targetHeight: Int = ViewGroup.LayoutParams.WRAP_CONTENT)
expandHorizontally
Link copied to clipboard
fun View.expandHorizontally(duration: Long = 500, targetWidth: Int = ViewGroup.LayoutParams.MATCH_PARENT, targetHeight: Int = ViewGroup.LayoutParams.WRAP_CONTENT)
findViewsByTag
Link copied to clipboard
fun Activity.findViewsByTag(tag: Any?): List<View>?
fun Fragment.findViewsByTag(tag: Any?): List<View>?
fun findViewsByTag(view: View, tag: Any?): List<View>
fun findViewsByTag(viewGroup: ViewGroup, tag: Any?): List<View>
fun Activity.findViewsByTag(key: Int, tag: Any?): List<View>?
fun Fragment.findViewsByTag(key: Int, tag: Any?): List<View>?
fun findViewsByTag(view: View, key: Int, tag: Any?): List<View>
fun findViewsByTag(viewGroup: ViewGroup, key: Int, tag: Any?): List<View>
findViewsByTagInActivity
Link copied to clipboard
fun Fragment.findViewsByTagInActivity(tag: Any?): List<View>?
fun Fragment.findViewsByTagInActivity(key: Int, tag: Any?): List<View>?
first
Link copied to clipboard
inline fun <T1, T2> <Error class: unknown class>.first(t1: T1): Either<T1, T2>
firstNotNull
Link copied to clipboard
fun <T> Iterable<T?>.firstNotNull(): <Error class: unknown class>
getDp
Link copied to clipboard
inline fun Resources.getDp(resId: Int): Float
getSp
Link copied to clipboard
inline fun Resources.getSp(resId: Int): Float
gone
Link copied to clipboard
inline fun View.gone()
hide
Link copied to clipboard
inline fun View.hide()
intersect
Link copied to clipboard
fun <T : Comparable<T>> ClosedRange<T>.intersect(other: ClosedRange<T>): Pair<T, T>?
fun IntRange.intersect(other: IntRange): IntRange?
fun LongRange.intersect(other: LongRange): LongRange?
joinTo
Link copied to clipboard
inline fun <I> Iterable<I>.joinTo(separator: I? = null, prefix: I? = null, postfix: I? = null): List<I>
inline fun <I> Iterable<I>.joinTo(separatorFun: (I) -> I?, prefix: I? = null, postfix: I? = null): List<I>
inline fun <I, R> Array<I>.joinTo(separator: R? = null, prefix: R? = null, postfix: R? = null, transform: (I) -> R?): Array<R>
inline fun <I, R> Array<I>.joinTo(separatorFun: (I) -> R?, prefix: R? = null, postfix: R? = null, transform: (I) -> R?): Array<R>
inline fun <I, R> Iterable<I>.joinTo(separator: R? = null, prefix: R? = null, postfix: R? = null, transform: (I) -> R?): List<R>
inline fun <I, R> Iterable<I>.joinTo(separatorFun: (I) -> R?, prefix: R? = null, postfix: R? = null, transform: (I) -> R?): List<R>
mapNotNullA
Link copied to clipboard
inline fun <T, R> Array<T>.mapNotNullA(mapper: (T) -> R?): List<R>
inline fun <T, R> Iterable<T>.mapNotNullA(transform: (T) -> R?): List<R>
mapOnAbsent
Link copied to clipboard
inline fun <T, R> Optional<T>.mapOnAbsent(block: () -> R): R?

Will call block when data presented (Optional.dataPresented == true)

mapOnFirst
Link copied to clipboard
inline fun <T1, R> Either<T1, *>.mapOnFirst(block: (T1) -> R): R?
mapOnPresented
Link copied to clipboard
inline fun <T, R> Optional<T>.mapOnPresented(block: (T) -> R): R?

Will call block when data presented (Optional.dataPresented == true)

mapOnSecond
Link copied to clipboard
inline fun <T2, R> Either<*, T2>.mapOnSecond(block: (T2) -> R): R?
minus
Link copied to clipboard
operator fun Progress.minus(other: Progress): Progress
operator fun Progress.minus(i: Byte): Progress
operator fun Progress.minus(i: Double): Progress
operator fun Progress.minus(i: Float): Progress
operator fun Progress.minus(i: Int): Progress
operator fun Progress.minus(i: Long): Progress
operator fun Progress.minus(i: Short): Progress
onAbsent
Link copied to clipboard
inline fun <T> Optional<T>.onAbsent(block: () -> Unit): Optional<T>

Will call block when data absent (Optional.dataPresented == false)

onFirst
Link copied to clipboard
inline fun <T1, T2, E : Either<T1, T2>> E.onFirst(block: (T1) -> Unit): E

Will call block in case when this is EitherFirst

onPresented
Link copied to clipboard
inline fun <T> Optional<T>.onPresented(block: (T) -> Unit): Optional<T>

Will call block when data presented (Optional.dataPresented == true)

onSecond
Link copied to clipboard
inline fun <T1, T2, E : Either<T1, T2>> E.onSecond(block: (T2) -> Unit): E

Will call block in case when this is EitherSecond

plus
Link copied to clipboard
operator fun Progress.plus(other: Progress): Progress
operator fun Progress.plus(i: Byte): Progress
operator fun Progress.plus(i: Double): Progress
operator fun Progress.plus(i: Float): Progress
operator fun Progress.plus(i: Int): Progress
operator fun Progress.plus(i: Long): Progress
operator fun Progress.plus(i: Short): Progress
rem
Link copied to clipboard
operator fun Progress.rem(i: Byte): Progress
operator fun Progress.rem(i: Double): Progress
operator fun Progress.rem(i: Float): Progress
operator fun Progress.rem(i: Int): Progress
operator fun Progress.rem(i: Long): Progress
operator fun Progress.rem(i: Short): Progress
repeatOnFailure
Link copied to clipboard
inline fun <R> repeatOnFailure(times: Int, onEachFailure: (Throwable) -> Unit = {}, action: (Int) -> R): Optional<R>

Executes the given action until getting of successful result specified number of times.

second
Link copied to clipboard
inline fun <T1, T2> <Error class: unknown class>.second(t2: T2): Either<T1, T2>
show
Link copied to clipboard
inline fun View.show()
simpleMapper
Link copied to clipboard
inline fun <T1, T2> simpleMapper(noinline t1: (T2) -> T1, noinline t2: (T1) -> T2): SimpleMapperImpl<T1, T2>
simpleSuspendableMapper
Link copied to clipboard
inline fun <T1, T2> simpleSuspendableMapper(noinline t1: suspend (T2) -> T1, noinline t2: suspend (T1) -> T2): SimpleSuspendableMapperImpl<T1, T2>
StrictDiff
Link copied to clipboard
inline fun <T> StrictDiff(old: Iterable<T>, new: Iterable<T>): Diff<T>
times
Link copied to clipboard
operator fun Progress.times(i: Byte): Progress
operator fun Progress.times(i: Double): Progress
operator fun Progress.times(i: Float): Progress
operator fun Progress.times(i: Int): Progress
operator fun Progress.times(i: Long): Progress
operator fun Progress.times(i: Short): Progress
toggleEnabledState
Link copied to clipboard
fun View.toggleEnabledState(enabled: Boolean)
toggleExpandHorizontallyState
Link copied to clipboard
fun View.toggleExpandHorizontallyState(duration: Long = 500): Boolean
toggleExpandState
Link copied to clipboard
fun View.toggleExpandState(duration: Long = 500): Boolean
toggleVisibility
Link copied to clipboard
fun View.toggleVisibility(goneOnHide: Boolean = true)

## Properties

asAllocator
Link copied to clipboard
val ByteArray.asAllocator: ByteArrayAllocator
asSuspendAllocator
Link copied to clipboard
val ByteArray.asSuspendAllocator: SuspendByteArrayAllocator
val ByteArrayAllocator.asSuspendAllocator: SuspendByteArrayAllocator
bytesAllocator
Link copied to clipboard
expect val MPPFile.bytesAllocator: SuspendByteArrayAllocator
bytesAllocatorSync
Link copied to clipboard
expect val MPPFile.bytesAllocatorSync: ByteArrayAllocator
disabled
Link copied to clipboard
val View.disabled: Boolean
enabled
Link copied to clipboard
val View.enabled: Boolean
filename
Link copied to clipboard
expect val MPPFile.filename: FileName
filesize
Link copied to clipboard
expect val MPPFile.filesize: Long
gone
Link copied to clipboard
val View.gone: Boolean
hidden
Link copied to clipboard
val View.hidden: Boolean
isCollapsed
Link copied to clipboard
val View.isCollapsed: Boolean
isExpanded
Link copied to clipboard
val View.isExpanded: Boolean
optional
Link copied to clipboard
val <T> T.optional: Optional<T>
optionalOrAbsentIfNull
Link copied to clipboard
val <T : Any> T?.optionalOrAbsentIfNull: Optional<T>
rootView
Link copied to clipboard
val Activity.rootView: View?
shown
Link copied to clipboard
val View.shown: Boolean