Skip to content

Instantly share code, notes, and snippets.

@MiguelCatalan
Created January 28, 2024 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MiguelCatalan/4effec9ac180a7c9fefc99738974c391 to your computer and use it in GitHub Desktop.
Save MiguelCatalan/4effec9ac180a7c9fefc99738974c391 to your computer and use it in GitHub Desktop.
kotlin.kt
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