kschlesselmann
01/21/2019, 4:16 PMSet<Foo>
and one with Set<Bar>
? It seems only the Set
part is used to check the JVM declaration 🤷♂️Casey Brooks
01/21/2019, 4:17 PMCasey Brooks
01/21/2019, 4:19 PMfradiati
12/09/2019, 8:21 AMfradiati
12/09/2019, 8:24 AMmax
12/09/2019, 8:51 AMPacane
12/09/2019, 9:43 PMbbaldino
12/10/2019, 12:06 AMobject
have to include a class body (even if it would be empty?) e.g.:
abstract class Foo(val num: Int)
// Error: expecting a class body
val x = object : Foo(42)
// Works
val y = object : Foo(42) {}
user
12/10/2019, 7:00 AMAshutosh Panda
12/10/2019, 7:49 AMerror: unresolved reference: b
Ashutosh Panda
12/10/2019, 7:49 AMfun removePages():Int=b.pages-Random().nextInt(0,100)
Ashutosh Panda
12/10/2019, 7:49 AMShootingStar
12/11/2019, 12:43 AMAiden
12/11/2019, 3:10 AMAiden
12/11/2019, 3:10 AMPacane
12/11/2019, 10:19 PMAlexjok
12/12/2019, 12:14 PMas Any
with gray collor and want to remove it but it doesn't work as we can see from first sample.Konstantin Tskhovrebov
12/12/2019, 12:46 PMProperty Wrapper
https://docs.swift.org/swift-book/LanguageGuide/Properties.html#ID617Ashutosh Panda
12/12/2019, 1:04 PMnapperley
12/13/2019, 6:45 AMclass MainWindow {
// ...
var winPtr: CPointer<GtkWidget>? = null
var title: String
set(value) = gtk_window_set_title(winPtr?.reinterpret(), value)
get() = gtk_window_get_title(winPtr?.reinterpret())?.toKString() ?: ""
// ...
}
trathschlag
12/13/2019, 10:49 AMOgasky
12/13/2019, 11:55 AMNikky
12/13/2019, 3:57 PMjef
12/13/2019, 11:04 PM{
"responseCode": 200
"responseMessage": "You did something successfully"
}
{
"errorCode": 401
"errorDescription": "Permission denied"
}
And I want to deserialize this message with some data classes that I created based on these messages through polymorphism (see abstract class in next code block):
data class MyDataClass(
val responseCode: Int,
val responseMessage: String
): MyAbstractClass()
data class MyOtherDataClass(
val errorCode: Int,
val errorDescription: String
): MyAbstractClass()
And I am resolving these messages through a function that will use the Jackson Object Mapper to deserialize the stringified JSON payload:
@JsonSubTypes(
JsonSubTypes.Type(value = MyDataClass::class),
JsonSubTypes.Type(value = MyOtherDataClass::class)
)
@JsonIgnoreProperties(ignoreProperties = true)
abstract class MyAbstractClass
fun receiveMessage(message: String) {
val convertedMessage = jacksonObjectMapper().readValue<MyAbstractClass>(message)
<http://log.info|log.info>(convertedMessage)
/* prints either:
MyDataClass(responseCode=200, responseMessage=You did something successfully)
OR
MyOtherDataClass(errorCode=401, errorDescription=Permission denied)
*/
}
But since I haven't described how to identify the data class (using @JsonTypeInfo
), it fails.
To repeat, I am curious if there is a way that I can deserialize the incoming message to one of my polymorphic types without having to specify the @JsonTypeInfo
.LeoColman
12/14/2019, 12:37 AMproperty testing
. We would like some opinion from the community as we're going to do some changes for the next major release (4.0).
Please, feel free to join the discussion: https://github.com/kotlintest/kotlintest/issues/1121ShootingStar
12/14/2019, 3:06 AMShootingStar
12/14/2019, 3:08 AMThe superclass constructor that gets invoked is the one with all the parameters, with supplied defaults.
ShootingStar
12/14/2019, 3:08 AMShootingStar
12/14/2019, 3:10 AM