Code example for Objects.ToStringHelper

Methods: add, toString

0
	} 
 
	@Override 
	public String toString() {
		ToStringHelper helper = Objects.toStringHelper(CommandDefinition.class);
		helper.add("service", this.serviceName);
		helper.add("method", this.methodName);
		helper.add("return", this.returnType);
		helper.add("params", this.paramTypes);
		return helper.toString();
	} 
 
	@Override 
	public int hashCode() { 
		return Objects.hashCode(this.serviceName, this.methodName, this.returnType, this.paramTypes);
	} 
 
	@Override 
	public boolean equals(Object obj) { 
		if (obj instanceof CommandDefinition) { 
			CommandDefinition other = (CommandDefinition) obj;
			return Objects.equal(this.serviceName, other.serviceName)
				&& Objects.equal(this.methodName, other.methodName)
				&& Objects.equal(this.returnType, other.returnType)
				&& Objects.equal(this.paramTypes, other.paramTypes);
		} 
		return false; 
	} 
 
}