Package com.google.common.base.Objects

Examples of com.google.common.base.Objects.ToStringHelper


      return this.begin == that.begin && this.end == that.end;
    }

    @Override
    public String toString() {
      ToStringHelper builder = Objects.toStringHelper(this);
      builder.add("begin", this.begin);
      builder.add("end", this.end);
      return builder.toString();
    }
View Full Code Here


        evaluators.add(evaluator);
        return this;
    }

    public String toStringOf(Object p, String propertyNames) {
        final ToStringHelper stringHelper = Objects.toStringHelper(p);
        for (final Clause clause : iterable(propertyNames)) {
            stringHelper.add(clause.getPropertyName(), asString(clause, p));
        }
        return stringHelper.toString();
    }
View Full Code Here

   public String toString() {
      return string().toString();
   }

   protected ToStringHelper string() {
      ToStringHelper toString = Objects.toStringHelper("").omitNullValues();
      toString.add("loginUser", loginUser);
      if (loginPassword != null)
         toString.add("loginPasswordPresent", true);
      if (loginPrivateKey != null)
         toString.add("loginPrivateKeyPresent", true);
      toString.add("authenticateSudo", authenticateSudo);
      if (port != -1 && seconds != -1) // TODO: not primitives
         toString.add("blockOnPort:seconds", port + ":" + seconds);
      toString.add("taskName", taskName);
      if (!runAsRoot)
         toString.add("runAsRoot", runAsRoot);
      if (!blockOnComplete)
         toString.add("blockOnComplete", blockOnComplete);
      if (!wrapInInitScript)
         toString.add("wrapInInitScript", wrapInInitScript);
      return toString;
   }
View Full Code Here

      return ownerId;
   }
  
   @Override
   protected ToStringHelper string() {
      ToStringHelper helper = computeToStringPrefix();
      if (ipPermissions.size() > 0)
         helper.add("ipPermissions", ipPermissions);
      return addComputeToStringSuffix(helper);
   }
View Full Code Here

   }

   // equals and toString from super are sufficient to establish identity equivalence

   protected ToStringHelper string() {
      ToStringHelper helper = computeToStringPrefix();
      helper.add("group", getGroup()).add("imageId", getImageId()).add("os", getOperatingSystem())
               .add("status", formatStatus(this)).add("loginPort", getLoginPort()).add("hostname", getHostname());
      if (getPrivateAddresses().size() > 0)
         helper.add("privateAddresses", getPrivateAddresses());
      if (getPublicAddresses().size() > 0)
         helper.add("publicAddresses", getPublicAddresses());
      helper.add("hardware", getHardware()).add("loginUser", credentials != null ? credentials.identity : null);
      return addComputeToStringSuffix(helper);
   }
View Full Code Here

   public String toString() {
      return string().toString();
   }

   protected ToStringHelper string() {
      ToStringHelper helper = Objects.toStringHelper("").omitNullValues().add("image", image).add("hardware", hardware)
               .add("location", location);
      if (!options.equals(defaultOptions()))
         helper.add("options", options);
      return helper;
   }
View Full Code Here

   }

   // equals and toString from super are sufficient to establish identity equivalence

   protected ToStringHelper string() {
      ToStringHelper helper = computeToStringPrefix();
      helper.add("os", getOperatingSystem()).add("description", getDescription()).add("version", getVersion())
               .add("status", formatStatus(this))
               .add("loginUser", defaultCredentials != null ? defaultCredentials.identity : null);
      return addComputeToStringSuffix(helper);
   }
View Full Code Here

                              securityGroups, userMetadata, nodeNames);
   }

   @Override
   public ToStringHelper string() {
      ToStringHelper toString = super.string();
      if (!DEFAULT_INBOUND_PORTS.equals(inboundPorts))
         toString.add("inboundPorts", inboundPorts);
      if (script != null)
         toString.add("scriptPresent", true);
      if (publicKey != null)
         toString.add("publicKeyPresent", true);
      if (privateKey != null)
         toString.add("privateKeyPresent", true);
      if (!blockUntilRunning)
         toString.add("blockUntilRunning", blockUntilRunning);
      if (tags.size() != 0)
         toString.add("tags", tags);
      if (!nodeNames.isEmpty())
         toString.add("nodeNames", nodeNames);
      if (securityGroups.size() != 0)
         toString.add("securityGroups", securityGroups);
      if (userMetadata.size() != 0)
         toString.add("userMetadata", userMetadata);
      return toString;
   }
View Full Code Here

      return Objects.hashCode(enabled, type, policy, natRules);
   }

   @Override
   public String toString() {
      ToStringHelper helper = Objects.toStringHelper("").omitNullValues().add("enabled", enabled)
            .add("type", type).add("policy", policy);
      if (natRules.size() > 0)
         helper.add("natRules", natRules);
      return helper.toString();
   }
View Full Code Here

      return Objects.hashCode(inherited, gateway, netmask, dns1, dns2, dnsSuffix, ipRanges, allocatedIpAddresses);
   }

   @Override
   public String toString() {
      ToStringHelper helper = Objects.toStringHelper("").omitNullValues().add("inherited", inherited).add("gateway", gateway)
            .add("netmask", netmask).add("dns1", dns1).add("dns2", dns2).add("dnsSuffix", dnsSuffix);
      if (ipRanges.size() > 0)
         helper.add("ipRanges", ipRanges);
      if (allocatedIpAddresses.size() > 0)
         helper.add("allocatedIpAddresses", allocatedIpAddresses);
      return helper.toString();
   }
View Full Code Here

TOP

Related Classes of com.google.common.base.Objects.ToStringHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.