class 与 "IPv4" 的驼峰命名法
Camel case name for class with "IPv4"
我有 class 名为 Ipv4Address
。它的惯用驼峰命名法是什么?惯用语是指会见 Google Java Style and meeting Checkstyle AbbreviationAsWordInName 检查。
This question 没有回答我的问题 - 我在这里专门询问如何处理字母 "v" 已经是小写的首字母缩略词。
Ipv
可能暗示有单词 "ipv" 或缩写词 "IPV"。但实际的首字母缩略词是 "IPv",它由两个词组成:"IP" 和 "version"
嗯,根据第一个站点:
Convert the phrase to plain ASCII and remove any apostrophes. For example, "Müller's algorithm" might become "Muellers algorithm"
Divide this result into words, splitting on spaces and any remaining punctuation (typically hyphens).
Recommended: if any word already has a conventional camel-case appearance in common usage, split this into its constituent parts (e.g., "AdWords" becomes "ad words"). Note that a word such as "iOS" is not really in camel case per se; it defies any convention, so this recommendation does not apply.
Now lowercase everything (including acronyms), then uppercase only the first character of:
... each word, to yield upper camel case, or
... each word except the first, to yield lower camel case
Finally, join all the words into a single identifier.
所以:
IPv4 地址
IPv 4 地址
ipv 4 地址
Ipv 4 地址
Ipv4Address
他们给出的一个例子包括 IPv
:
“iOS 支持 IPv6?” -> supportsIpv6OnIos
因此,Google 似乎并不关心“v”代表“版本”,因此他们将其视为单个单词“IPv”的一部分。
如果您 dead-set 清楚地表明“v”是“版本”,您可能可以不用 IpVersion4Address
,尽管我更喜欢 Ipv4Address
的外观.
我有 class 名为 Ipv4Address
。它的惯用驼峰命名法是什么?惯用语是指会见 Google Java Style and meeting Checkstyle AbbreviationAsWordInName 检查。
This question 没有回答我的问题 - 我在这里专门询问如何处理字母 "v" 已经是小写的首字母缩略词。
Ipv
可能暗示有单词 "ipv" 或缩写词 "IPV"。但实际的首字母缩略词是 "IPv",它由两个词组成:"IP" 和 "version"
嗯,根据第一个站点:
Convert the phrase to plain ASCII and remove any apostrophes. For example, "Müller's algorithm" might become "Muellers algorithm"
Divide this result into words, splitting on spaces and any remaining punctuation (typically hyphens).
Recommended: if any word already has a conventional camel-case appearance in common usage, split this into its constituent parts (e.g., "AdWords" becomes "ad words"). Note that a word such as "iOS" is not really in camel case per se; it defies any convention, so this recommendation does not apply.
Now lowercase everything (including acronyms), then uppercase only the first character of:
... each word, to yield upper camel case, or
... each word except the first, to yield lower camel case
Finally, join all the words into a single identifier.
所以:
IPv4 地址
IPv 4 地址
ipv 4 地址
Ipv 4 地址
Ipv4Address
他们给出的一个例子包括 IPv
:
“iOS 支持 IPv6?” -> supportsIpv6OnIos
因此,Google 似乎并不关心“v”代表“版本”,因此他们将其视为单个单词“IPv”的一部分。
如果您 dead-set 清楚地表明“v”是“版本”,您可能可以不用 IpVersion4Address
,尽管我更喜欢 Ipv4Address
的外观.