Created
January 28, 2024 10:01
-
-
Save MiguelCatalan/4effec9ac180a7c9fefc99738974c391 to your computer and use it in GitHub Desktop.
kotlin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.personio.payroll.concept.history.configuration.authentication | |
data class NewUserDomain( | |
val name: String, | |
) | |
data class UserDomain( | |
val name: String, | |
val id: String, | |
){ | |
fun algo (){} | |
} | |
data class UserDB( | |
val id: String? = null, | |
val name: String, | |
) { | |
fun mapToDomain(): UserDomain { | |
return UserDomain( | |
id = this.id ?: "", | |
name = this.name, | |
) | |
} | |
} | |
fun UserDomain.mapToDB(): UserDB { | |
return UserDB( | |
id = this.id, | |
name = this.name, | |
) | |
} | |
fun ConfigDomain.mapToDB(): ConfigDB | |
fun String.toMayus():String{ | |
return this.name | |
} | |
data class CosoConfiguration( | |
val color: Int, | |
val frequency: Int = 27, | |
///// | |
) | |
class LEDView( | |
val configuration: CosoConfiguration, | |
) { | |
} | |
class Coso { | |
fun toMayus(original: String): String{ | |
original.toM | |
return " " | |
} | |
val dataBase: UserDB = UserDB("", "") | |
val domain: UserDomain = dataBase.mapToDomain() | |
val DBKotlin = domain.mapToDB().mayus().save() | |
val coso = | |
val mayusculas = domain.name.toMayus() | |
val config = CosoConfiguration() | |
val led = LEDView(configuration = config) | |
fun addRandomID(originalUser: UserDomain): UserDomain { | |
return originalUser.copy(id = "") | |
} | |
fun main() { | |
val lista = listOf( | |
UserDomain( | |
name = "1", | |
id = "1", | |
), | |
UserDomain( | |
name = "2", | |
id = "2", | |
), | |
) | |
val user2 = lista.filter { hola -> | |
hola.id == "1" | |
} | |
// cosas randome | |
val originalUser = UserDomain( | |
name = "", | |
id = "", | |
) | |
val userWithId = addRandomID(originalUser) | |
// original no existe | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment