github.com/c-darwin/mobile@v0.0.0-20160313183840-ff625c46f7c9/bind/testdata/issue12328.java.golden (about)

     1  // Java Package issue12328 is a proxy for talking to a Go program.
     2  //   gobind -lang=java issue12328
     3  //
     4  // File is generated by gobind. Do not edit.
     5  package go.issue12328;
     6  
     7  import go.Seq;
     8  
     9  public abstract class Issue12328 {
    10      private Issue12328() {} // uninstantiable
    11      
    12      public static final class T implements go.Seq.Object {
    13          private static final String DESCRIPTOR = "go.issue12328.T";
    14          private static final int FIELD_Err_GET = 0x00f;
    15          private static final int FIELD_Err_SET = 0x01f;
    16          
    17          private go.Seq.Ref ref;
    18          
    19          private T(go.Seq.Ref ref) { this.ref = ref; }
    20          
    21          public go.Seq.Ref ref() { return ref; }
    22          
    23          public void call(int code, go.Seq in, go.Seq out) {
    24              throw new RuntimeException("internal error: cycle: cannot call concrete proxy");
    25          }
    26          
    27          public String getErr() {
    28              Seq in = new Seq();
    29              Seq out = new Seq();
    30              in.writeRef(ref);
    31              Seq.send(DESCRIPTOR, FIELD_Err_GET, in, out);
    32              return out.readString();
    33          }
    34          
    35          public void setErr(String v) {
    36              Seq in = new Seq();
    37              Seq out = new Seq();
    38              in.writeRef(ref);
    39              in.writeString(v);
    40              Seq.send(DESCRIPTOR, FIELD_Err_SET, in, out);
    41          }
    42          
    43          @Override public boolean equals(Object o) {
    44              if (o == null || !(o instanceof T)) {
    45                  return false;
    46              }
    47              T that = (T)o;
    48              String thisErr = getErr();
    49              String thatErr = that.getErr();
    50              if (thisErr == null) {
    51                  if (thatErr != null) {
    52                      return false;
    53                  }
    54              } else if (!thisErr.equals(thatErr)) {
    55                  return false;
    56              }
    57              return true;
    58          }
    59          
    60          @Override public int hashCode() {
    61              return java.util.Arrays.hashCode(new Object[] {getErr()});
    62          }
    63          
    64          @Override public String toString() {
    65              StringBuilder b = new StringBuilder();
    66              b.append("T").append("{");
    67              b.append("Err:").append(getErr()).append(",");
    68              return b.append("}").toString();
    69          }
    70          
    71      }
    72      
    73      private static final String DESCRIPTOR = "issue12328";
    74  }