Code example for Objects.ToStringHelper

0
      BillingToken that = BillingToken.class.cast(obj);
      return Objects.equal(this.id, that.id)
               && Objects.equal(this.name, that.name)
               && Objects.equal(this.price, that.price);
   } 
    
   protected ToStringHelper string() {
      return Objects.toStringHelper(this)
            .add("id", id).add("name", name).add("price", price);
   } 
    
   @Override 
   public String toString() {
      return string().toString();
   } 
 
   @Override 
   public int compareTo(BillingToken o) {
      return Longs.compare(id, o.getId());
   } 
Experience pair programming with AI  Get Codota for Java