
// auto generated by ../../../../gentests.rb

package com.johnholdsworth.swiftbindings;

import com.johnholdsworth.swiftbindings.SwiftHelloTypes.TextListener;
import com.johnholdsworth.swiftbindings.SwiftHelloTypes.ListenerMap;
import com.johnholdsworth.swiftbindings.SwiftHelloTypes.ListenerMapList;

public interface SwiftHelloTest {

    public interface TestListener {

        public void setLoopback( TestListener loopback );

        public boolean booleanMethod( boolean arg );
        public boolean[] booleanArrayMethod( boolean arg[] );
        public boolean[][] boolean2dArrayMethod( boolean arg[][] );

        public byte byteMethod( byte arg );
        public byte[] byteArrayMethod( byte arg[] );
        public byte[][] byte2dArrayMethod( byte arg[][] );

        public char charMethod( char arg );
        public char[] charArrayMethod( char arg[] );
        public char[][] char2dArrayMethod( char arg[][] );

        public short shortMethod( short arg );
        public short[] shortArrayMethod( short arg[] );
        public short[][] short2dArrayMethod( short arg[][] );

        public int intMethod( int arg );
        public int[] intArrayMethod( int arg[] );
        public int[][] int2dArrayMethod( int arg[][] );

        public long longMethod( long arg );
        public long[] longArrayMethod( long arg[] );
        public long[][] long2dArrayMethod( long arg[][] );

        public float floatMethod( float arg );
        public float[] floatArrayMethod( float arg[] );
        public float[][] float2dArrayMethod( float arg[][] );

        public double doubleMethod( double arg );
        public double[] doubleArrayMethod( double arg[] );
        public double[][] double2dArrayMethod( double arg[][] );

        public String StringMethod( String arg );
        public String[] StringArrayMethod( String arg[] );
        public String[][] String2dArrayMethod( String arg[][] );

        public TestListener TestListenerMethod( TestListener arg );
        public TestListener[] TestListenerArrayMethod( TestListener arg[] );
        public TestListener[][] TestListener2dArrayMethod( TestListener arg[][] );

        public ListenerMap testMap( ListenerMap arg );
        public ListenerMapList testMapList( ListenerMapList arg );

    }

    public static class TestResponderAdapter implements TestListener {

        public TestListener loopback;

        public void setLoopback( TestListener loopback ) {
            this.loopback = loopback;
        }

        public boolean booleanMethod( boolean arg ) {
            return loopback != null ? loopback.booleanMethod( arg ) : arg;
        }

        public boolean[] booleanArrayMethod( boolean arg[] ) {
            return loopback != null ? loopback.booleanArrayMethod( arg ) : arg;
        }

        public boolean[][] boolean2dArrayMethod( boolean arg[][] ) {
            return loopback != null ? loopback.boolean2dArrayMethod( arg ) : arg;
        }

        public byte byteMethod( byte arg ) {
            return loopback != null ? loopback.byteMethod( arg ) : arg;
        }

        public byte[] byteArrayMethod( byte arg[] ) {
            return loopback != null ? loopback.byteArrayMethod( arg ) : arg;
        }

        public byte[][] byte2dArrayMethod( byte arg[][] ) {
            return loopback != null ? loopback.byte2dArrayMethod( arg ) : arg;
        }

        public char charMethod( char arg ) {
            return loopback != null ? loopback.charMethod( arg ) : arg;
        }

        public char[] charArrayMethod( char arg[] ) {
            return loopback != null ? loopback.charArrayMethod( arg ) : arg;
        }

        public char[][] char2dArrayMethod( char arg[][] ) {
            return loopback != null ? loopback.char2dArrayMethod( arg ) : arg;
        }

        public short shortMethod( short arg ) {
            return loopback != null ? loopback.shortMethod( arg ) : arg;
        }

        public short[] shortArrayMethod( short arg[] ) {
            return loopback != null ? loopback.shortArrayMethod( arg ) : arg;
        }

        public short[][] short2dArrayMethod( short arg[][] ) {
            return loopback != null ? loopback.short2dArrayMethod( arg ) : arg;
        }

        public int intMethod( int arg ) {
            return loopback != null ? loopback.intMethod( arg ) : arg;
        }

        public int[] intArrayMethod( int arg[] ) {
            return loopback != null ? loopback.intArrayMethod( arg ) : arg;
        }

        public int[][] int2dArrayMethod( int arg[][] ) {
            return loopback != null ? loopback.int2dArrayMethod( arg ) : arg;
        }

        public long longMethod( long arg ) {
            return loopback != null ? loopback.longMethod( arg ) : arg;
        }

        public long[] longArrayMethod( long arg[] ) {
            return loopback != null ? loopback.longArrayMethod( arg ) : arg;
        }

        public long[][] long2dArrayMethod( long arg[][] ) {
            return loopback != null ? loopback.long2dArrayMethod( arg ) : arg;
        }

        public float floatMethod( float arg ) {
            return loopback != null ? loopback.floatMethod( arg ) : arg;
        }

        public float[] floatArrayMethod( float arg[] ) {
            return loopback != null ? loopback.floatArrayMethod( arg ) : arg;
        }

        public float[][] float2dArrayMethod( float arg[][] ) {
            return loopback != null ? loopback.float2dArrayMethod( arg ) : arg;
        }

        public double doubleMethod( double arg ) {
            return loopback != null ? loopback.doubleMethod( arg ) : arg;
        }

        public double[] doubleArrayMethod( double arg[] ) {
            return loopback != null ? loopback.doubleArrayMethod( arg ) : arg;
        }

        public double[][] double2dArrayMethod( double arg[][] ) {
            return loopback != null ? loopback.double2dArrayMethod( arg ) : arg;
        }

        public String StringMethod( String arg ) {
            return loopback != null ? loopback.StringMethod( arg ) : arg;
        }

        public String[] StringArrayMethod( String arg[] ) {
            return loopback != null ? loopback.StringArrayMethod( arg ) : arg;
        }

        public String[][] String2dArrayMethod( String arg[][] ) {
            return loopback != null ? loopback.String2dArrayMethod( arg ) : arg;
        }

        public TestListener TestListenerMethod( TestListener arg ) {
            return loopback != null ? loopback.TestListenerMethod( arg ) : arg;
        }

        public TestListener[] TestListenerArrayMethod( TestListener arg[] ) {
            return loopback != null ? loopback.TestListenerArrayMethod( arg ) : arg;
        }

        public TestListener[][] TestListener2dArrayMethod( TestListener arg[][] ) {
            return loopback != null ? loopback.TestListener2dArrayMethod( arg ) : arg;
        }

        public ListenerMap testMap( ListenerMap arg ) {
            return loopback != null ? loopback.testMap( arg ) : arg;
        }

        public ListenerMapList testMapList( ListenerMapList arg ) {
            return loopback != null ? loopback.testMapList( arg ) : arg;
        }

    }

    public static class SwiftTestListener extends TestResponderAdapter {

        static int tcount = 0;

        public void respond( TestListener responder ) {
            tcount += 1;
            System.out.println("Java -> Swift "+tcount+"...");


            if ( true ) {
                boolean reference = true;
                boolean referenceArray[] = new boolean [] {reference};
                boolean reference2dArray[][] = new boolean [][] {referenceArray};

                boolean response = responder.booleanMethod( reference );
                boolean responseArray[] = responder.booleanArrayMethod( referenceArray );
                boolean response2dArray[][] = responder.boolean2dArrayMethod( reference2dArray );

                if ( response != reference ) {
                    System.out.println("Bool: "+response+" != "+reference);
                }
                if ( responseArray[0] != referenceArray[0] ) {
                    System.out.println("Bool: "+responseArray[0]+" != "+referenceArray[0]);
                }
                if ( response2dArray[0][0] != reference2dArray[0][0] ) {
                    System.out.println("Bool: "+response2dArray[0][0]+" != "+reference2dArray[0][0]);
                }
            }

            if ( true ) {
                byte reference = 123;
                byte referenceArray[] = new byte [] {reference};
                byte reference2dArray[][] = new byte [][] {referenceArray};

                byte response = responder.byteMethod( reference );
                byte responseArray[] = responder.byteArrayMethod( referenceArray );
                byte response2dArray[][] = responder.byte2dArrayMethod( reference2dArray );

                if ( response != reference ) {
                    System.out.println("Int8: "+response+" != "+reference);
                }
                if ( responseArray[0] != referenceArray[0] ) {
                    System.out.println("Int8: "+responseArray[0]+" != "+referenceArray[0]);
                }
                if ( response2dArray[0][0] != reference2dArray[0][0] ) {
                    System.out.println("Int8: "+response2dArray[0][0]+" != "+reference2dArray[0][0]);
                }
            }

            if ( true ) {
                char reference = 123;
                char referenceArray[] = new char [] {reference};
                char reference2dArray[][] = new char [][] {referenceArray};

                char response = responder.charMethod( reference );
                char responseArray[] = responder.charArrayMethod( referenceArray );
                char response2dArray[][] = responder.char2dArrayMethod( reference2dArray );

                if ( response != reference ) {
                    System.out.println("UInt16: "+response+" != "+reference);
                }
                if ( responseArray[0] != referenceArray[0] ) {
                    System.out.println("UInt16: "+responseArray[0]+" != "+referenceArray[0]);
                }
                if ( response2dArray[0][0] != reference2dArray[0][0] ) {
                    System.out.println("UInt16: "+response2dArray[0][0]+" != "+reference2dArray[0][0]);
                }
            }

            if ( true ) {
                short reference = 123;
                short referenceArray[] = new short [] {reference};
                short reference2dArray[][] = new short [][] {referenceArray};

                short response = responder.shortMethod( reference );
                short responseArray[] = responder.shortArrayMethod( referenceArray );
                short response2dArray[][] = responder.short2dArrayMethod( reference2dArray );

                if ( response != reference ) {
                    System.out.println("Int16: "+response+" != "+reference);
                }
                if ( responseArray[0] != referenceArray[0] ) {
                    System.out.println("Int16: "+responseArray[0]+" != "+referenceArray[0]);
                }
                if ( response2dArray[0][0] != reference2dArray[0][0] ) {
                    System.out.println("Int16: "+response2dArray[0][0]+" != "+reference2dArray[0][0]);
                }
            }

            if ( true ) {
                int reference = 123;
                int referenceArray[] = new int [] {reference};
                int reference2dArray[][] = new int [][] {referenceArray};

                int response = responder.intMethod( reference );
                int responseArray[] = responder.intArrayMethod( referenceArray );
                int response2dArray[][] = responder.int2dArrayMethod( reference2dArray );

                if ( response != reference ) {
                    System.out.println("Int: "+response+" != "+reference);
                }
                if ( responseArray[0] != referenceArray[0] ) {
                    System.out.println("Int: "+responseArray[0]+" != "+referenceArray[0]);
                }
                if ( response2dArray[0][0] != reference2dArray[0][0] ) {
                    System.out.println("Int: "+response2dArray[0][0]+" != "+reference2dArray[0][0]);
                }
            }

            if ( true ) {
                long reference = 123;
                long referenceArray[] = new long [] {reference};
                long reference2dArray[][] = new long [][] {referenceArray};

                long response = responder.longMethod( reference );
                long responseArray[] = responder.longArrayMethod( referenceArray );
                long response2dArray[][] = responder.long2dArrayMethod( reference2dArray );

                if ( response != reference ) {
                    System.out.println("Int64: "+response+" != "+reference);
                }
                if ( responseArray[0] != referenceArray[0] ) {
                    System.out.println("Int64: "+responseArray[0]+" != "+referenceArray[0]);
                }
                if ( response2dArray[0][0] != reference2dArray[0][0] ) {
                    System.out.println("Int64: "+response2dArray[0][0]+" != "+reference2dArray[0][0]);
                }
            }

            if ( true ) {
                float reference = 123;
                float referenceArray[] = new float [] {reference};
                float reference2dArray[][] = new float [][] {referenceArray};

                float response = responder.floatMethod( reference );
                float responseArray[] = responder.floatArrayMethod( referenceArray );
                float response2dArray[][] = responder.float2dArrayMethod( reference2dArray );

                if ( response != reference ) {
                    System.out.println("Float: "+response+" != "+reference);
                }
                if ( responseArray[0] != referenceArray[0] ) {
                    System.out.println("Float: "+responseArray[0]+" != "+referenceArray[0]);
                }
                if ( response2dArray[0][0] != reference2dArray[0][0] ) {
                    System.out.println("Float: "+response2dArray[0][0]+" != "+reference2dArray[0][0]);
                }
            }

            if ( true ) {
                double reference = 123;
                double referenceArray[] = new double [] {reference};
                double reference2dArray[][] = new double [][] {referenceArray};

                double response = responder.doubleMethod( reference );
                double responseArray[] = responder.doubleArrayMethod( referenceArray );
                double response2dArray[][] = responder.double2dArrayMethod( reference2dArray );

                if ( response != reference ) {
                    System.out.println("Double: "+response+" != "+reference);
                }
                if ( responseArray[0] != referenceArray[0] ) {
                    System.out.println("Double: "+responseArray[0]+" != "+referenceArray[0]);
                }
                if ( response2dArray[0][0] != reference2dArray[0][0] ) {
                    System.out.println("Double: "+response2dArray[0][0]+" != "+reference2dArray[0][0]);
                }
            }

            if ( true ) {
                String reference = "123";
                String referenceArray[] = new String [] {reference};
                String reference2dArray[][] = new String [][] {referenceArray};

                String response = responder.StringMethod( reference );
                String responseArray[] = responder.StringArrayMethod( referenceArray );
                String response2dArray[][] = responder.String2dArrayMethod( reference2dArray );
            }

            if ( true ) {
                TestListener reference = new SwiftTestListener();
                TestListener referenceArray[] = new TestListener [] {reference};
                TestListener reference2dArray[][] = new TestListener [][] {referenceArray};

                TestListener response = responder.TestListenerMethod( reference );
                TestListener responseArray[] = responder.TestListenerArrayMethod( referenceArray );
                TestListener response2dArray[][] = responder.TestListener2dArrayMethod( reference2dArray );
            }
       }

    }

}
