private void addEquals ( TypeSpec . Builder classBuilder ) { MethodSpec . Builder methodBuilder = MethodSpec . methodBuilder ( "equals" ) . addModifiers ( Modifier . PUBLIC ) . addParameter ( ClassName . get ( Object . class ) , "obj" ) . returns ( boolean . class ) . addAnnotation ( Override . class ) . addStatement ( "return (obj instanceof " + getRemoterInterfaceClassName ( ) + ClassBuilder . PROXY_SUFFIX + ") && obj.hashCode() == hashCode()" ) ; classBuilder . addMethod ( methodBuilder . build ( ) ) ; }
Add proxy method for equals