Java Code Examples for com.google.common.base.Objects.ToStringHelper#toString()

The following examples show how to use com.google.common.base.Objects.ToStringHelper#toString() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: phoenix-omid   File: CellUtils.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public String toString() {
    ToStringHelper helper = Objects.toStringHelper(this);
    helper.add("row", Bytes.toStringBinary(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength()));
    helper.add("family", Bytes.toString(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength()));
    helper.add("is shadow cell?", isShadowCell);
    helper.add("qualifier",
            Bytes.toString(cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength()));
    if (isShadowCell()) {
        int qualifierLength = qualifierLengthFromShadowCellQualifier(cell.getQualifierArray(),
                cell.getQualifierOffset(),
                cell.getQualifierLength());
        byte[] cellWithoutSc = removeShadowCellSuffixPrefix(cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength());
        helper.add("qualifier whithout shadow cell suffix", Bytes.toString(cellWithoutSc));
    }
    helper.add("ts", cell.getTimestamp());
    return helper.toString();
}
 
Example 2
@Override
public String toString() {
	ToStringHelper helper = Objects.toStringHelper(this)
			.add("challenger", this.challenger.getName())
			.add("challenged", this.challenged.getName())
			.add("accepted", this.isAccepted());
	return helper.toString();
}
 
Example 3
Source Project: bitherj   File: DeterministicKey.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    final ToStringHelper helper = Objects.toStringHelper(this).omitNullValues();
    helper.add("pub", Utils.bytesToHexString(pub));
    helper.add("chainCode", Utils.bytesToHexString(chainCode));
    helper.add("path", getPathAsString());
    if (creationTimeSeconds > 0)
        helper.add("creationTimeSeconds", creationTimeSeconds);
    helper.add("isEncrypted", isEncrypted());
    helper.add("isPubKeyOnly", isPubKeyOnly());
    return helper.toString();
}
 
Example 4
@Override
public String toString() {
	ToStringHelper helper = Objects.toStringHelper(this);
	helper.add("name", this.name);
	helper.add("adress", this.address);
	return helper.toString();
}
 
Example 5
@Override
public String toString() {
	ToStringHelper helper = Objects.toStringHelper(this);
	helper.add("postCode", this.postCode);
	helper.add("city", this.city);
	return helper.toString();
}