github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/mobile/bind/testdata/vars.java.golden (about)

     1  // Java class go.vars.Vars is a proxy for talking to a Go program.
     2  //   gobind -lang=java vars
     3  //
     4  // File is generated by gobind. Do not edit.
     5  package go.vars;
     6  
     7  import go.Seq;
     8  
     9  public abstract class Vars {
    10      private Vars() {} // uninstantiable
    11      
    12      public static void setABool(boolean v) {
    13          Seq in = new Seq();
    14          Seq out = new Seq();
    15          in.writeBool(v);
    16          Seq.send("vars.ABool", 1, in, out);
    17      }
    18      
    19      public static boolean getABool() {
    20          Seq in = new Seq();
    21          Seq out = new Seq();
    22          Seq.send("vars.ABool", 2, in, out);
    23          boolean v = out.readBool();
    24          return v;
    25      }
    26      
    27      public static void setAFloat(double v) {
    28          Seq in = new Seq();
    29          Seq out = new Seq();
    30          in.writeFloat64(v);
    31          Seq.send("vars.AFloat", 1, in, out);
    32      }
    33      
    34      public static double getAFloat() {
    35          Seq in = new Seq();
    36          Seq out = new Seq();
    37          Seq.send("vars.AFloat", 2, in, out);
    38          double v = out.readFloat64();
    39          return v;
    40      }
    41      
    42      public static void setAFloat32(float v) {
    43          Seq in = new Seq();
    44          Seq out = new Seq();
    45          in.writeFloat32(v);
    46          Seq.send("vars.AFloat32", 1, in, out);
    47      }
    48      
    49      public static float getAFloat32() {
    50          Seq in = new Seq();
    51          Seq out = new Seq();
    52          Seq.send("vars.AFloat32", 2, in, out);
    53          float v = out.readFloat32();
    54          return v;
    55      }
    56      
    57      public static void setAFloat64(double v) {
    58          Seq in = new Seq();
    59          Seq out = new Seq();
    60          in.writeFloat64(v);
    61          Seq.send("vars.AFloat64", 1, in, out);
    62      }
    63      
    64      public static double getAFloat64() {
    65          Seq in = new Seq();
    66          Seq out = new Seq();
    67          Seq.send("vars.AFloat64", 2, in, out);
    68          double v = out.readFloat64();
    69          return v;
    70      }
    71      
    72      public static void setAString(String v) {
    73          Seq in = new Seq();
    74          Seq out = new Seq();
    75          in.writeString(v);
    76          Seq.send("vars.AString", 1, in, out);
    77      }
    78      
    79      public static String getAString() {
    80          Seq in = new Seq();
    81          Seq out = new Seq();
    82          Seq.send("vars.AString", 2, in, out);
    83          String v = out.readString();
    84          return v;
    85      }
    86      
    87      public static void setAStructPtr(S v) {
    88          Seq in = new Seq();
    89          Seq out = new Seq();
    90          in.writeRef(v.ref());
    91          Seq.send("vars.AStructPtr", 1, in, out);
    92      }
    93      
    94      public static S getAStructPtr() {
    95          Seq in = new Seq();
    96          Seq out = new Seq();
    97          Seq.send("vars.AStructPtr", 2, in, out);
    98          S v = new S(out.readRef());
    99          return v;
   100      }
   101      
   102      public static void setAnInt(long v) {
   103          Seq in = new Seq();
   104          Seq out = new Seq();
   105          in.writeInt(v);
   106          Seq.send("vars.AnInt", 1, in, out);
   107      }
   108      
   109      public static long getAnInt() {
   110          Seq in = new Seq();
   111          Seq out = new Seq();
   112          Seq.send("vars.AnInt", 2, in, out);
   113          long v = out.readInt();
   114          return v;
   115      }
   116      
   117      public static void setAnInt16(short v) {
   118          Seq in = new Seq();
   119          Seq out = new Seq();
   120          in.writeInt16(v);
   121          Seq.send("vars.AnInt16", 1, in, out);
   122      }
   123      
   124      public static short getAnInt16() {
   125          Seq in = new Seq();
   126          Seq out = new Seq();
   127          Seq.send("vars.AnInt16", 2, in, out);
   128          short v = out.readInt16();
   129          return v;
   130      }
   131      
   132      public static void setAnInt32(int v) {
   133          Seq in = new Seq();
   134          Seq out = new Seq();
   135          in.writeInt32(v);
   136          Seq.send("vars.AnInt32", 1, in, out);
   137      }
   138      
   139      public static int getAnInt32() {
   140          Seq in = new Seq();
   141          Seq out = new Seq();
   142          Seq.send("vars.AnInt32", 2, in, out);
   143          int v = out.readInt32();
   144          return v;
   145      }
   146      
   147      public static void setAnInt64(long v) {
   148          Seq in = new Seq();
   149          Seq out = new Seq();
   150          in.writeInt64(v);
   151          Seq.send("vars.AnInt64", 1, in, out);
   152      }
   153      
   154      public static long getAnInt64() {
   155          Seq in = new Seq();
   156          Seq out = new Seq();
   157          Seq.send("vars.AnInt64", 2, in, out);
   158          long v = out.readInt64();
   159          return v;
   160      }
   161      
   162      public static void setAnInt8(byte v) {
   163          Seq in = new Seq();
   164          Seq out = new Seq();
   165          in.writeInt8(v);
   166          Seq.send("vars.AnInt8", 1, in, out);
   167      }
   168      
   169      public static byte getAnInt8() {
   170          Seq in = new Seq();
   171          Seq out = new Seq();
   172          Seq.send("vars.AnInt8", 2, in, out);
   173          byte v = out.readInt8();
   174          return v;
   175      }
   176      
   177      public static void setAnInterface(I v) {
   178          Seq in = new Seq();
   179          Seq out = new Seq();
   180          in.writeRef(v.ref());
   181          Seq.send("vars.AnInterface", 1, in, out);
   182      }
   183      
   184      public static I getAnInterface() {
   185          Seq in = new Seq();
   186          Seq out = new Seq();
   187          Seq.send("vars.AnInterface", 2, in, out);
   188          I v = new I.Proxy(out.readRef());
   189          return v;
   190      }
   191      
   192      public interface I extends go.Seq.Object {
   193          public static abstract class Stub implements I {
   194              static final String DESCRIPTOR = "go.vars.I";
   195              
   196              private final go.Seq.Ref ref;
   197              public Stub() {
   198                  ref = go.Seq.createRef(this);
   199              }
   200              
   201              public go.Seq.Ref ref() { return ref; }
   202              
   203              public void call(int code, go.Seq in, go.Seq out) {
   204                  switch (code) {
   205                  default:
   206                      throw new RuntimeException("unknown code: "+ code);
   207                  }
   208              }
   209          }
   210          
   211          static final class Proxy implements I {
   212              static final String DESCRIPTOR = Stub.DESCRIPTOR;
   213          
   214              private go.Seq.Ref ref;
   215          
   216              Proxy(go.Seq.Ref ref) { this.ref = ref; }
   217          
   218              public go.Seq.Ref ref() { return ref; }
   219          
   220              public void call(int code, go.Seq in, go.Seq out) {
   221                  throw new RuntimeException("cycle: cannot call proxy");
   222              }
   223          
   224          }
   225      }
   226      
   227      public static final class S implements go.Seq.Object {
   228          private static final String DESCRIPTOR = "go.vars.S";
   229          
   230          private go.Seq.Ref ref;
   231          
   232          private S(go.Seq.Ref ref) { this.ref = ref; }
   233          
   234          public go.Seq.Ref ref() { return ref; }
   235          
   236          public void call(int code, go.Seq in, go.Seq out) {
   237              throw new RuntimeException("internal error: cycle: cannot call concrete proxy");
   238          }
   239          
   240          @Override public boolean equals(Object o) {
   241              if (o == null || !(o instanceof S)) {
   242                  return false;
   243              }
   244              S that = (S)o;
   245              return true;
   246          }
   247          
   248          @Override public int hashCode() {
   249              return java.util.Arrays.hashCode(new Object[] {});
   250          }
   251          
   252          @Override public String toString() {
   253              StringBuilder b = new StringBuilder();
   254              b.append("S").append("{");
   255              return b.append("}").toString();
   256          }
   257          
   258      }
   259      
   260      private static final String DESCRIPTOR = "vars";
   261  }