gpt4 book ai didi

kotlin - KDoc:更改参数顺序

转载 作者:行者123 更新时间:2023-12-02 13:20:06 28 4
gpt4 key购买 nike

我在Kotlin上的同伴对象中具有以下参数

    companion object Constants {
/**
* Values for the various type of connection that a device can have.
*/
const val CONNECTION_KEY = "Connection_type"
const val CONNECTION_AUX = "AUX"
const val CONNECTION_BLUETOOTH = "Bluetooth"
const val CONNECTION_USB = "USB"

/**
* Unique IDs respectively for devices and media elements.
*/
const val DEVICE_ID_KEY = "Device_ID"
const val MEDIA_ID_KEY = "Media_ID"

/**
* Various keys that you can find in [Bundle] returned by [getMediaItems].
*/
const val MEDIA_NAME_KEY = "Media_name"
const val SONG_IDS_KEY = "Songs_ids"
const val GENRE_IDS_KEY = "Genres_ids"
const val ARTIST_IDS_KEY = "Artists_ids"
}

问题是,在Kdoc结果中,我发现它们按字母顺序排列

ARTIST_IDS_KEY

const val ARTIST_IDS_KEY: String

CONNECTION_AUX

const val CONNECTION_AUX: String

CONNECTION_BLUETOOTH

const val CONNECTION_BLUETOOTH: String

CONNECTION_KEY

Values for the various type of connection that a device can have.

const val CONNECTION_KEY: String

CONNECTION_USB

const val CONNECTION_USB: String

DEVICE_ID_KEY

Unique IDs respectively for devices and media elements.

const val DEVICE_ID_KEY: String

GENRE_IDS_KEY

const val GENRE_IDS_KEY: String

MEDIA_ID_KEY

const val MEDIA_ID_KEY: String

MEDIA_NAME_KEY

Various keys that you can find in Bundle returned by getMediaItems.

const val MEDIA_NAME_KEY: String

SONG_IDS_KEY

const val SONG_IDS_KEY: String



...是否有办法维持原始订单?

最佳答案

您可以通过在代码中对元素进行分组来对kDoc中的元素进行分组:

companion object Constants {
/**
* Values for the various type of connection that a device can have.
*/
object Connection {
const val KEY = "Connection_type"
const val AUX = "AUX"
const val BLUETOOTH = "Bluetooth"
const val USB = "USB"
}

/**
* Unique IDs respectively for devices and media elements.
*/
object IDs {
const val DEVICE = "Device_ID"
const val MEDIA = "Media_ID"
}

/**
* Various keys that you can find in [Bundle] returned by [getMediaItems].
*/
object BundleKeys {
const val MEDIA_NAME = "Media_name"
const val SONG_IDS = "Songs_ids"
const val GENRE_IDS = "Genres_ids"
const val ARTIST_IDS = "Artists_ids"
}
}

关于kotlin - KDoc:更改参数顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58880906/

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