java u0002_Java中的KOTLIN转换失去了集合的专业化?

我正在为Android开发一个基于注释处理器的库。我正在努力提高库与Kotlin的兼容性。我有以下情况:

@BindType(value = "rss")

class RssFeed(

@BindSqlColumn(columnType = ColumnType.UNIQUE)

val uid: String,

@BindXml(xmlType = XmlType.ATTRIBUTE)

val version: String,

@Bind("channel")

@BindSqlRelation(foreignKey = "rssFeedId")

val channels: List,

val id: Long

)

正如您在Kotlin中看到的,这是一个简单的数据类。我的图书馆会认为每一个收藏都是“专门的”(一般的)。当我试图用Java中的等价物对这个类进行反编译时,我得到:

@BindType("rss")

@Metadata(

mv = {1, 1, 10},

bv = {1, 0, 2},

k = 1,

d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\t\b\u0007\u0018\u00002\u00020\u0001B+\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0003\u0012\f\u0010\u0005\u001a\b\u0012\u0004\u0012\u00020\u00070\u0006\u0012\u0006\u0010\b\u001a\u00020\t¢\u0006\u0002\u0010\nR\u001c\u0010\u0005\u001a\b\u0012\u0004\u0012\u00020\u00070\u00068\u0006X\u0087\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u000b\u0010\fR\u0011\u0010\b\u001a\u00020\t¢\u0006\b\n\u0000\u001a\u0004\b\r\u0010\u000eR\u0016\u0010\u0002\u001a\u00020\u00038\u0006X\u0087\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u000f\u0010\u0010R\u0016\u0010\u0004\u001a\u00020\u00038\u0006X\u0087\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0011\u0010\u0010¨\u0006\u0012"},

d2 = {"Lcom/abubusoft/rssreader/service/model/RssFeed;", "", "uid", "", "version", "channels", "", "Lcom/abubusoft/rssreader/service/model/Channel;", "id", "", "(Ljava/lang/String;Ljava/lang/String;Ljava/util/List;J)V", "getChannels", "()Ljava/util/List;", "getId", "()J", "getUid", "()Ljava/lang/String;", "getVersion", "production sources for module app"}

)

public final class RssFeed {

@BindSqlColumn(

columnType = ColumnType.UNIQUE

)

@NotNull

private final String uid;

@BindXml(

xmlType = XmlType.ATTRIBUTE

)

@NotNull

private final String version;

@Bind("channel")

@BindSqlRelation(

foreignKey = "rssFeedId"

)

@NotNull

private final List channels;

private final long id;

@NotNull

public final String getUid() {

return this.uid;

}

@NotNull

public final String getVersion() {

return this.version;

}

@NotNull

public final List getChannels() {

return this.channels;

}

public final long getId() {

return this.id;

}

public RssFeed(@NotNull String uid, @NotNull String version, @NotNull List channels, long id) {

Intrinsics.checkParameterIsNotNull(uid, "uid");

Intrinsics.checkParameterIsNotNull(version, "version");

Intrinsics.checkParameterIsNotNull(channels, "channels");

super();

this.uid = uid;

this.version = version;

this.channels = channels;

this.id = id;

}

}

正如您可以注意到的,有关通道字段专门化的信息将丢失:它作为列表签名。

预计Java版本的类具有列表的专用性。

这是我犯的错误,或者只是Kotlin用这种方式工作?

更新

这是一种很奇怪的行为。识别接口上使用的泛型,即类号上的泛型。

import android.arch.lifecycle.LiveData

import com.abubusoft.kripton.android.annotation.BindDao

import com.abubusoft.kripton.android.annotation.BindSqlDynamicWhere

import com.abubusoft.kripton.android.annotation.BindSqlSelect

import com.abubusoft.kripton.android.annotation.BindSqlUpdate

import com.abubusoft.kripton.example.rssreader.service.model.Article

@BindDao(Article::class)

interface DaoArticle {

@BindSqlUpdate(where = "id=:id")

fun update(id: Long, read: Boolean)

@BindSqlSelect

fun selectByChannel(@BindSqlDynamicWhere where: String): LiveData>

@BindSqlSelect(where = "id=:id")

fun selectById(id: Long): List

@BindSqlSelect(where = "id in (:ids)")

fun selectByChannelUd(ids: List): List

@BindSqlSelect(where = "guid=:guid")

fun selectByGuid(guid: String): Article

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值