Event JSON
{
"id": "80e47e9c6ad8f927eb6bf49cd09c372db38c8d501901e29533b0ea696abf3865",
"pubkey": "ee9d979e7e1418a9f7472baf82dc96082a0d4251b77bcb170a6ecec93fadff64",
"created_at": 1732821117,
"kind": 1,
"tags": [
[
"t",
"Kotlin"
],
[
"t",
"kotlin"
],
[
"t",
"Java"
],
[
"t",
"java"
],
[
"t",
"JVM"
],
[
"t",
"jvm"
],
[
"t",
"String"
],
[
"t",
"string"
],
[
"t",
"DefaultArguments"
],
[
"t",
"defaultarguments"
],
[
"t",
"NamedArguments"
],
[
"t",
"namedarguments"
],
[
"t",
"SoftwareDevelopment"
],
[
"t",
"softwaredevelopment"
],
[
"r",
"https://haven.accioly.social/7b6972ccdab390e59366162e124db1ff507d5b9fd62eddfa1463c5dc61c41989.png"
],
[
"r",
"https://haven.accioly.social/8c7646bcbaddfb21da384e4fff7248f5f46279165d0710fea6d6924e7a9c022d.png"
],
[
"r",
"https://kotlinlang.org/docs/functions.html#named-arguments"
],
[
"imeta",
"url https://haven.accioly.social/7b6972ccdab390e59366162e124db1ff507d5b9fd62eddfa1463c5dc61c41989.png",
"m image/png",
"alt Generated with OpenAI: The image shows a snippet of Kotlin code that defines a data class named KeepAlive. This class has four properties: connections of type UInt, requests of type UInt with a default value of 1000u, time of type Duration with a default value of 1.hours, and timeout of type Duration with a default value of 60.seconds. The code also includes an instance of the KeepAlive class named keepAlive, initialized with connections set to 64u.\n\nThe code imports the necessary components from the kotlin.time package to handle durations in hours and seconds.\n\nThis code is interesting because it demonstrates how to set default values for class properties.",
"x 7b6972ccdab390e59366162e124db1ff507d5b9fd62eddfa1463c5dc61c41989",
"size 112944",
"dim 912x754",
"blurhash #73v%Kt6tVnitpWXk]S5cHtTsnoLjsjua}a#WXWYpMjZozkCkCn%jHe:a#kZfkfjj[juayjbaya#pMkBkCf6j]WpbHjuf6bxa{oLfkayjbf6jZjZtpafbHf+ayj[jsfPjY",
"ox 7b6972ccdab390e59366162e124db1ff507d5b9fd62eddfa1463c5dc61c41989"
],
[
"imeta",
"url https://haven.accioly.social/8c7646bcbaddfb21da384e4fff7248f5f46279165d0710fea6d6924e7a9c022d.png",
"m image/png",
"alt Generated with OpenAI: The image shows a Java code snippet defining a record named KeepAlive. The code imports the java.time.Duration class and defines the KeepAlive record with four fields: int connections, int requests, Duration time, and Duration timeout. There are two constructor overloads: one that initializes all the fields, and another that only requires the connections field while setting default values for the others (1000 for requests, Duration.ofHours(1) for time, and Duration.ofSeconds(60) for timeout). Additionally, there is a validation block that throws an IllegalArgumentException if the connections or requests fields are negative.",
"x 8c7646bcbaddfb21da384e4fff7248f5f46279165d0710fea6d6924e7a9c022d",
"size 178478",
"dim 1522x1094",
"blurhash r52s@IxatVjYktWBp1azpLo%oeofn+n%jYjZjaj[pMayofoLofoLoMj@jbtTo0jZj?j[j[j[juf8tpaxj[j[ofoLj]f8a}tTf7ayfibHj[fRjaf6",
"ox 8c7646bcbaddfb21da384e4fff7248f5f46279165d0710fea6d6924e7a9c022d"
]
],
"content": "\"Small\" things I highly appreciate about Kotlin coming from Java - Chapter 3\n\nššššš®š„š \u0026 ššš¦šš šš«š š®š¦šš§šš¬\n\nhttps://haven.accioly.social/7b6972ccdab390e59366162e124db1ff507d5b9fd62eddfa1463c5dc61c41989.png\n\nhttps://haven.accioly.social/8c7646bcbaddfb21da384e4fff7248f5f46279165d0710fea6d6924e7a9c022d.png\n\nhttps://kotlinlang.org/docs/functions.html#named-arguments\n\nCleaner, more flexible syntax. No more explosion of method/constructor overloads. No more Builders for every class or record. No more abusing Maps for passing optional parameters around.\n\n#Kotlin #Java #JVM #String #DefaultArguments #NamedArguments #SoftwareDevelopment",
"sig": "13564bc3b181409c34940ba7fc415279dcd6cf3fddd12bda1ed1dc06d005038790ec8d1ea89df255324710d274080b31c23eb5af523fe41c54971553c98b6f43"
}