本文整理匯總了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();
}