gpt4 book ai didi

xtend - 访问类类型

转载 作者:行者123 更新时间:2023-12-01 11:16:27 24 4
gpt4 key购买 nike

我正在尝试将以下 java 片段转换为 Xtend,但我做不到。我无法访问静态属性“类”。

public class SyncService{
private static final String LOGT = SyncService.class.getSimpleName();
}

我尝试了以下方法,

class SyncService {
val LOGT = SyncService.class.getSimpleName();
}
class SyncService {
val LOGT = SyncService::class.getSimpleName();
}

最佳答案

根据documentation这是

SyncService.simpleName

或使用旧语法:

typeof(SyncService).simpleName

关于xtend - 访问类类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11246374/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com