本文整理汇总了Java中com.google.common.base.MoreObjects类的典型用法代码示例。如果您正苦于以下问题:Java MoreObjects类的具体用法?Java MoreObjects怎么用?Java MoreObjects使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MoreObjects类属于com.google.common.base包,在下文中一共展示了MoreObjects类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toString
import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
final ToStringHelper stringHelper = MoreObjects.toStringHelper(this)
.add("name", name());
if (creator() != null) {
stringHelper.add("creator", creator());
}
if (headRevision() != null) {
stringHelper.add("headRevision", headRevision());
}
if (createdAt() != null) {
stringHelper.add("createdAt", createdAt());
}
return stringHelper.toString();
}
示例2: generateUriPredicate
import com.google.common.base.MoreObjects; //导入依赖的package包/类
private Predicate<URI> generateUriPredicate(FileInput fileInput, @Nullable Predicate<URI> globPredicate) {
Predicate<URI> moduloPredicate;
boolean sharedStorage = MoreObjects.firstNonNull(shared, fileInput.sharedStorageDefault());
if (sharedStorage) {
moduloPredicate = new Predicate<URI>() {
@Override
public boolean apply(URI input) {
int hash = input.hashCode();
if (hash == Integer.MIN_VALUE) {
hash = 0; // Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE
}
return Math.abs(hash) % numReaders == readerNumber;
}
};
} else {
moduloPredicate = MATCH_ALL_PREDICATE;
}
if (globPredicate != null) {
return Predicates.and(moduloPredicate, globPredicate);
}
return moduloPredicate;
}
示例3: dump
import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override public String dump() {
lock.lock();
try {
return addSubclassFields(
MoreObjects.toStringHelper(this).add("seed", BinaryUtils.convertBytesToHexString(seed))
.add("entropyBits", entropyBits.get()).add("seedGenerator", seedGenerator))
.toString();
} finally {
lock.unlock();
}
}
示例4: toString
import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("value", value)
.add("userdata", userData)
.add("created", created)
.add("modified", modified)
.add("comment", comment)
.toString();
}
示例5: toString
import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("number", portNumber())
.add("isEnabled", isEnabled())
.add("type", type())
.add("minFrequency", minFrequency)
.add("maxFrequency", maxFrequency)
.add("grid", grid)
.add("annotations", annotations())
.toString();
}
示例6: toString
import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString()
{
return MoreObjects.toStringHelper(this)
.add("version", version)
.add("modLoaders", modLoaders)
.toString();
}
示例7: debugString
import com.google.common.base.MoreObjects; //导入依赖的package包/类
public String debugString()
{
return MoreObjects.toStringHelper(this)
.add("name", name)
.add("type", type)
.add("kind", kind)
.add("position", position)
.toString();
}
示例8: toString
import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.omitNullValues()
.add("administrativeGroup", administrativeGroup)
.add("ipv4InterfaceAddress", ipv4InterfaceAddress)
.add("ipv4NeighborAddress", ipv4NeighborAddress)
.add("maximumLinkBandwidth", maximumLinkBandwidth)
.add("maximumReservableLinkBandwidth", maximumReservableLinkBandwidth)
.add("teDefaultMetric", teDefaultMetric)
.toString();
}
示例9: toString
import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("transactionId", transactionId)
.add("updates", updates)
.toString();
}
示例10: toString
import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
if (friendlyName != NO_NAME) {
return MoreObjects.toStringHelper(getClass())
.omitNullValues()
.add("friendlyName", friendlyName)
// omit lengthy detail, when there's a name
.toString();
}
return MoreObjects.toStringHelper(getClass())
.add("registeredBlocks", registeredBlocks)
.toString();
}
示例11: toString
import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("nodeId", nodeId)
.add("term", term)
.add("termStartTime", termStartTime)
.toString();
}
示例12: toString
import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.omitNullValues()
.add("externalInformation", externalInformation)
.add("irdpInformationType", irdpInformationType)
.toString();
}
示例13: toString
import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("ident", ident)
.add("method", method)
.add("columns", columns)
.add("properties", properties)
.toString();
}
示例14: toString
import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("symbol", symbol)
.add("earnings", earnings)
.toString();
}
示例15: toString
import com.google.common.base.MoreObjects; //导入依赖的package包/类
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("domain", domain)
.add("ordinal", ordinal)
.toString();
}