List of usage examples for com.google.common.base MoreObjects.ToStringHelper toString
public String toString()
From source file:net.morimekta.config.util.ConfigUtil.java
/** * Make a proper toString value for the config. * * @param config The config to make toString for. * @return The toString value.//from w ww . ja v a2s . c om */ public static String toString(Config config) { MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(config); for (String key : config.keySet()) { helper.add(key, config.get(key)); } return helper.toString(); }
From source file:org.apache.bookkeeper.proto.RequestUtils.java
/** * this toSafeString method filters out body and masterKey from the output. * masterKey contains the password of the ledger and body is customer data, * so it is not appropriate to have these in logs or system output. *//*from w w w .j av a2s .c o m*/ public static String toSafeString(BookkeeperProtocol.Request request) { MoreObjects.ToStringHelper stringHelper = MoreObjects.toStringHelper(request); BookkeeperProtocol.BKPacketHeader header = request.getHeader(); if (request.hasAddRequest()) { BookkeeperProtocol.AddRequest addRequest = request.getAddRequest(); includeHeaderFields(stringHelper, header); stringHelper.add("ledgerId", addRequest.getLedgerId()); stringHelper.add("entryId", addRequest.getEntryId()); if (addRequest.hasFlag()) { stringHelper.add("flag", addRequest.getFlag()); } if (addRequest.hasWriteFlags()) { stringHelper.add("writeFlags", addRequest.getWriteFlags()); } return stringHelper.toString(); } else if (request.hasReadRequest()) { BookkeeperProtocol.ReadRequest readRequest = request.getReadRequest(); includeHeaderFields(stringHelper, header); stringHelper.add("ledgerId", readRequest.getLedgerId()); stringHelper.add("entryId", readRequest.getEntryId()); if (readRequest.hasFlag()) { stringHelper.add("flag", readRequest.getFlag()); } if (readRequest.hasPreviousLAC()) { stringHelper.add("previousLAC", readRequest.getPreviousLAC()); } if (readRequest.hasTimeOut()) { stringHelper.add("timeOut", readRequest.getTimeOut()); } return stringHelper.toString(); } else if (request.hasWriteLacRequest()) { BookkeeperProtocol.WriteLacRequest writeLacRequest = request.getWriteLacRequest(); includeHeaderFields(stringHelper, header); stringHelper.add("ledgerId", writeLacRequest.getLedgerId()); stringHelper.add("lac", writeLacRequest.getLac()); return stringHelper.toString(); } else if (request.hasForceLedgerRequest()) { BookkeeperProtocol.ForceLedgerRequest forceLedgerRequest = request.getForceLedgerRequest(); includeHeaderFields(stringHelper, header); stringHelper.add("ledgerId", forceLedgerRequest.getLedgerId()); return stringHelper.toString(); } else { return request.toString(); } }
From source file:org.onosproject.cpman.ControlResourceRequest.java
@Override public String toString() { MoreObjects.ToStringHelper helper; helper = toStringHelper(this).add("type", type); return helper.toString(); }
From source file:com.github.nyrkovalex.deploy.me.descriptor.DeploymentDescriptor.java
@Override public String toString() { MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(this); applications.forEach(app -> helper.add("application", app)); return helper.toString(); }
From source file:com.codeabovelab.dm.common.gateway.ConnectionEvent.java
@Override public String toString() { MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(this); toString(helper);//from w ww. jav a 2s . com return helper.toString(); }
From source file:talkeeg.bf.schema.Base.java
@Override public final String toString() { MoreObjects.ToStringHelper sb = MoreObjects.toStringHelper(this); toString(sb);/* ww w . j a va2 s.c om*/ return sb.toString(); }
From source file:org.graylog.collector.MessageFields.java
@Override public String toString() { final MoreObjects.ToStringHelper stringHelper = MoreObjects.toStringHelper(this); for (Map.Entry<String, Object> entry : asMap().entrySet()) { stringHelper.add(entry.getKey(), entry.getValue()); }/* w w w . ja v a2s.co m*/ return stringHelper.toString(); }
From source file:org.onosproject.cpman.ControlLoadSnapshot.java
@Override public String toString() { MoreObjects.ToStringHelper helper; helper = toStringHelper(this).add("latest", latest).add("average", average).add("time", time).add("recent", recent);//from ww w . j a v a2 s.c om return helper.toString(); }
From source file:fr.putnami.pwt.core.editor.client.impl.SimpleEditorContext.java
@Override public String toString() { MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(this); helper.add("editor", this.editor.getClass().getSimpleName()); helper.add("path", this.path); return helper.toString(); }
From source file:com.google.javascript.jscomp.newtypes.TypeEnv.java
@Override public String toString() { MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(this); for (String key : typeMap.keySet()) { helper.add(key, getType(key));/*from ww w . ja v a2s . c om*/ } return helper.toString(); }