Java Code Examples for com.google.common.base.Objects.ToStringHelper

The following examples show how to use com.google.common.base.Objects.ToStringHelper. 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   Source 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
Source Project: brooklyn-server   Source File: Main.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public ToStringHelper string() {
    return super.string()
            .add("app", app)
            .add("script", script)
            .add("location", locations)
            .add("port", port)
            .add("bindAddress", bindAddress)
            .add("noConsole", noConsole)
            .add("noConsoleSecurity", noConsoleSecurity)
            .add("startupFailOnPersistenceErrors", startupFailOnPersistenceErrors)
            .add("startupFailsOnCatalogErrors", startupFailOnCatalogErrors)
            .add("startupContinueOnWebErrors", startupContinueOnWebErrors)
            .add("startupFailOnManagedAppsErrors", startupFailOnManagedAppsErrors)
            .add("catalogInitial", catalogInitial)
            .add("stopWhichAppsOnShutdown", stopWhichAppsOnShutdown)
            .add("stopOnKeyPress", stopOnKeyPress)
            .add("localBrooklynProperties", localBrooklynProperties)
            .add("persist", persist)
            .add("persistenceLocation", persistenceLocation)
            .add("persistenceDir", persistenceDir)
            .add("highAvailability", highAvailability)
            .add("exitAndLeaveAppsRunningAfterStarting", exitAndLeaveAppsRunningAfterStarting);
}
 
Example 3
Source Project: attic-stratos   Source File: AWSEC2TemplateOptions.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public ToStringHelper string() {
   ToStringHelper toString = super.string();
   if (monitoringEnabled)
      toString.add("monitoringEnabled", monitoringEnabled);
    if (publicIpAddressAssociated)
        toString.add("publicIpAddressAssociated", publicIpAddressAssociated);
   toString.add("placementGroup", placementGroup);
   if (noPlacementGroup)
      toString.add("noPlacementGroup", noPlacementGroup);
   toString.add("subnetId", subnetId);
   toString.add("spotPrice", spotPrice);
   if (spotOptions != RequestSpotInstancesOptions.NONE)
      toString.add("spotOptions", spotOptions);
   if (!groupIds.isEmpty())
      toString.add("groupIds", groupIds);
   toString.add("iamInstanceProfileArn", iamInstanceProfileArn);
   toString.add("iamInstanceProfileName", iamInstanceProfileName);
   toString.add("privateIpAddress", privateIpAddress);
   return toString;
}
 
Example 4
@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 5
Source Project: brooklyn-server   Source File: Main.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public ToStringHelper string() {
    return super.string()
            .add("localBrooklynProperties", localBrooklynProperties)
            .add("persistenceLocation", persistenceLocation)
            .add("persistenceDir", persistenceDir)
            .add("destinationDir", destinationDir);
}
 
Example 6
Source Project: brooklyn-server   Source File: PortForwardManagerImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected ToStringHelper string() {
    int size;
    synchronized (mutex) {
        size = mappings.size();
    }
    return super.string().add("scope", getScope()).add("mappingsSize", size);
}
 
Example 7
Source Project: bitherj   Source 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 8
@Override
public String toString() {
	ToStringHelper helper = Objects.toStringHelper(this);
	helper.add("name", this.name);
	helper.add("adress", this.address);
	return helper.toString();
}
 
Example 9
@Override
public String toString() {
	ToStringHelper helper = Objects.toStringHelper(this);
	helper.add("postCode", this.postCode);
	helper.add("city", this.city);
	return helper.toString();
}
 
Example 10
Source Project: brooklyn-library   Source File: AbstractZooKeeperImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected ToStringHelper toStringHelper() {
    return super.toStringHelper()
            .add("zookeeperPort", getZookeeperPort());
}
 
Example 11
Source Project: brooklyn-library   Source File: ActiveMQBrokerImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected ToStringHelper toStringHelper() {
    return super.toStringHelper().add("openWirePort", getAttribute(OPEN_WIRE_PORT));
}
 
Example 12
Source Project: brooklyn-library   Source File: RabbitDestination.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected ToStringHelper toStringHelper() {
    return super.toStringHelper().add("virtualHost", getParent().getVirtualHost()).add("exchange", getExchangeName());
}
 
Example 13
Source Project: brooklyn-library   Source File: RabbitBrokerImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected ToStringHelper toStringHelper() {
    return super.toStringHelper().add("amqpPort", getAmqpPort());
}
 
Example 14
Source Project: brooklyn-library   Source File: QpidBrokerImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected ToStringHelper toStringHelper() {
    return super.toStringHelper().add("amqpPort", getAmqpPort());
}
 
Example 15
Source Project: brooklyn-library   Source File: KafkaBrokerImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected ToStringHelper toStringHelper() {
    return super.toStringHelper()
            .add("kafkaPort", getKafkaPort());
}
 
Example 16
Source Project: brooklyn-library   Source File: DerbyDatabase.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected ToStringHelper toStringHelper() {
    return super.toStringHelper().add("jdbcPort", getAttribute(JDBC_PORT));
}
 
Example 17
Source Project: brooklyn-library   Source File: DerbySchema.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected ToStringHelper toStringHelper() {
    return super.toStringHelper().add("name", name);
}
 
Example 18
Source Project: brooklyn-server   Source File: AbstractMain.java    License: Apache License 2.0 4 votes vote down vote up
public ToStringHelper string() {
    return Objects.toStringHelper(getClass())
            .add("verbose", verbose)
            .add("quiet", quiet);
}
 
Example 19
Source Project: brooklyn-server   Source File: AbstractMain.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public ToStringHelper string() {
    return super.string()
            .add("arguments", arguments);
}
 
Example 20
Source Project: brooklyn-server   Source File: AbstractMain.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public ToStringHelper string() {
    return super.string()
            .add("defines", getDefines());
}
 
Example 21
Source Project: brooklyn-server   Source File: CloudExplorer.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public ToStringHelper string() {
    return super.string()
            .add("location", location);
}
 
Example 22
Source Project: brooklyn-server   Source File: CloudExplorer.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public ToStringHelper string() {
    return super.string()
            .add(GetImage.ARGUMENT_NAME, arguments);
}
 
Example 23
Source Project: brooklyn-server   Source File: CloudExplorer.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public ToStringHelper string() {
    return super.string()
            .add(TerminateInstances.ARGUMENT_NAME, arguments);
}
 
Example 24
Source Project: brooklyn-server   Source File: CloudExplorer.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public ToStringHelper string() {
    return super.string()
            .add(BlobstoreListContainer.ARGUMENT_NAME, arguments);
}
 
Example 25
Source Project: brooklyn-server   Source File: CloudExplorer.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public ToStringHelper string() {
    return super.string()
            .add("container", container)
            .add("blob", blob);
}
 
Example 26
Source Project: brooklyn-server   Source File: AbstractLocation.java    License: Apache License 2.0 4 votes vote down vote up
/** override this, adding to the returned value, to supply additional fields to include in the toString */
protected ToStringHelper string() {
    return Objects.toStringHelper(getClass()).add("id", getId()).add("name", name);
}
 
Example 27
Source Project: attic-stratos   Source File: AWSRunningInstance.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected ToStringHelper string() {
   return super.string().add("monitoringState", monitoringState).add("placementGroup", placementGroup)
            .add("subnetId", subnetId).add("spotInstanceRequestId", spotInstanceRequestId).add("vpcId", vpcId)
            .add("hypervisor", hypervisor).add("iamInstanceProfile", iamInstanceProfile.orNull());
}
 
Example 28
Source Project: brooklyn-server   Source File: AbstractEntity.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Override this to add to the toString(), e.g. {@code return super.toStringHelper().add("port", port);}
 *
 * Cannot be used in combination with overriding the deprecated toStringFieldsToInclude.
 */
protected ToStringHelper toStringHelper() {
    return Objects.toStringHelper(this).omitNullValues().add("id", getId());
}