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

import java_swift
import Foundation

public class SwiftTestListener: SwiftHelloTest_TestListenerBase {

    var loopback: SwiftHelloTest_TestListener?

    override public func booleanMethod( arg: Bool ) -> Bool {
        return loopback?.booleanMethod( arg: arg ) ?? arg
    }

    override public func booleanArrayMethod( arg: [Bool]? ) -> [Bool]? {
        return loopback?.booleanArrayMethod( arg: arg ) ?? arg
    }

    override public func boolean2dArrayMethod( arg: [[Bool]]? ) -> [[Bool]]? {
        return loopback?.boolean2dArrayMethod( arg: arg ) ?? arg
    }

    override public func byteMethod( arg: Int8 ) -> Int8 {
        return loopback?.byteMethod( arg: arg ) ?? arg
    }

    override public func byteArrayMethod( arg: [Int8]? ) -> [Int8]? {
        return loopback?.byteArrayMethod( arg: arg ) ?? arg
    }

    override public func byte2dArrayMethod( arg: [[Int8]]? ) -> [[Int8]]? {
        return loopback?.byte2dArrayMethod( arg: arg ) ?? arg
    }

    override public func charMethod( arg: UInt16 ) -> UInt16 {
        return loopback?.charMethod( arg: arg ) ?? arg
    }

    override public func charArrayMethod( arg: [UInt16]? ) -> [UInt16]? {
        return loopback?.charArrayMethod( arg: arg ) ?? arg
    }

    override public func char2dArrayMethod( arg: [[UInt16]]? ) -> [[UInt16]]? {
        return loopback?.char2dArrayMethod( arg: arg ) ?? arg
    }

    override public func shortMethod( arg: Int16 ) -> Int16 {
        return loopback?.shortMethod( arg: arg ) ?? arg
    }

    override public func shortArrayMethod( arg: [Int16]? ) -> [Int16]? {
        return loopback?.shortArrayMethod( arg: arg ) ?? arg
    }

    override public func short2dArrayMethod( arg: [[Int16]]? ) -> [[Int16]]? {
        return loopback?.short2dArrayMethod( arg: arg ) ?? arg
    }

    override public func intMethod( arg: Int ) -> Int {
        return loopback?.intMethod( arg: arg ) ?? arg
    }

    override public func intArrayMethod( arg: [Int32]? ) -> [Int32]? {
        return loopback?.intArrayMethod( arg: arg ) ?? arg
    }

    override public func int2dArrayMethod( arg: [[Int32]]? ) -> [[Int32]]? {
        return loopback?.int2dArrayMethod( arg: arg ) ?? arg
    }

    override public func longMethod( arg: Int64 ) -> Int64 {
        return loopback?.longMethod( arg: arg ) ?? arg
    }

    override public func longArrayMethod( arg: [Int64]? ) -> [Int64]? {
        return loopback?.longArrayMethod( arg: arg ) ?? arg
    }

    override public func long2dArrayMethod( arg: [[Int64]]? ) -> [[Int64]]? {
        return loopback?.long2dArrayMethod( arg: arg ) ?? arg
    }

    override public func floatMethod( arg: Float ) -> Float {
        return loopback?.floatMethod( arg: arg ) ?? arg
    }

    override public func floatArrayMethod( arg: [Float]? ) -> [Float]? {
        return loopback?.floatArrayMethod( arg: arg ) ?? arg
    }

    override public func float2dArrayMethod( arg: [[Float]]? ) -> [[Float]]? {
        return loopback?.float2dArrayMethod( arg: arg ) ?? arg
    }

    override public func doubleMethod( arg: Double ) -> Double {
        return loopback?.doubleMethod( arg: arg ) ?? arg
    }

    override public func doubleArrayMethod( arg: [Double]? ) -> [Double]? {
        return loopback?.doubleArrayMethod( arg: arg ) ?? arg
    }

    override public func double2dArrayMethod( arg: [[Double]]? ) -> [[Double]]? {
        return loopback?.double2dArrayMethod( arg: arg ) ?? arg
    }

    override public func StringMethod( arg: String? ) -> String? {
        return loopback?.StringMethod( arg: arg ) ?? arg
    }

    override public func StringArrayMethod( arg: [String]? ) -> [String]? {
        return loopback?.StringArrayMethod( arg: arg ) ?? arg
    }

    override public func String2dArrayMethod( arg: [[String]]? ) -> [[String]]? {
        return loopback?.String2dArrayMethod( arg: arg ) ?? arg
    }

    override public func TestListenerMethod( arg: SwiftHelloTest_TestListener? ) -> SwiftHelloTest_TestListener? {
        return loopback?.TestListenerMethod( arg: arg ) ?? arg
    }

    override public func TestListenerArrayMethod( arg: [SwiftHelloTest_TestListener]? ) -> [SwiftHelloTest_TestListener]? {
        return loopback?.TestListenerArrayMethod( arg: arg ) ?? arg
    }

    override public func TestListener2dArrayMethod( arg: [[SwiftHelloTest_TestListener]]? ) -> [[SwiftHelloTest_TestListener]]? {
        return loopback?.TestListener2dArrayMethod( arg: arg ) ?? arg
    }

}

public class SwiftTestResponder {

    static var tcount = 0

    public func respond( to responder: SwiftHelloTest_TestListener ) {
        SwiftTestResponder.tcount += 1
        NSLog("Swift -> Java \(SwiftTestResponder.tcount)...")

        if true {
            let reference: Bool = true
            let referenceArray = [(reference)]
            let reference2dArray = [referenceArray]

            let response = responder.booleanMethod( arg: reference )
            let responseArray = responder.booleanArrayMethod( arg: referenceArray )!
            _ = responder.boolean2dArrayMethod( arg: reference2dArray )

            if response != reference {
                NSLog("Bool: \(String(describing: response)) != \(reference)")
            }
            if responseArray != referenceArray {
                NSLog("Bool: \(responseArray) != \(referenceArray)")
            }
        }


        if true {
            let reference: Int8 = 123
            let referenceArray = [(reference)]
            let reference2dArray = [referenceArray]

            let response = responder.byteMethod( arg: reference )
            let responseArray = responder.byteArrayMethod( arg: referenceArray )!
            _ = responder.byte2dArrayMethod( arg: reference2dArray )

            if response != reference {
                NSLog("Int8: \(String(describing: response)) != \(reference)")
            }
            if responseArray != referenceArray {
                NSLog("Int8: \(responseArray) != \(referenceArray)")
            }
        }


        if true {
            let reference: UInt16 = 123
            let referenceArray = [(reference)]
            let reference2dArray = [referenceArray]

            let response = responder.charMethod( arg: reference )
            let responseArray = responder.charArrayMethod( arg: referenceArray )!
            _ = responder.char2dArrayMethod( arg: reference2dArray )

            if response != reference {
                NSLog("UInt16: \(String(describing: response)) != \(reference)")
            }
            if responseArray != referenceArray {
                NSLog("UInt16: \(responseArray) != \(referenceArray)")
            }
        }


        if true {
            let reference: Int16 = 123
            let referenceArray = [(reference)]
            let reference2dArray = [referenceArray]

            let response = responder.shortMethod( arg: reference )
            let responseArray = responder.shortArrayMethod( arg: referenceArray )!
            _ = responder.short2dArrayMethod( arg: reference2dArray )

            if response != reference {
                NSLog("Int16: \(String(describing: response)) != \(reference)")
            }
            if responseArray != referenceArray {
                NSLog("Int16: \(responseArray) != \(referenceArray)")
            }
        }


        if true {
            let reference: Int = 123
            let referenceArray = [Int32(reference)]
            let reference2dArray = [referenceArray]

            let response = responder.intMethod( arg: reference )
            let responseArray = responder.intArrayMethod( arg: referenceArray )!
            _ = responder.int2dArrayMethod( arg: reference2dArray )

            if response != reference {
                NSLog("Int: \(String(describing: response)) != \(reference)")
            }
            if responseArray != referenceArray {
                NSLog("Int: \(responseArray) != \(referenceArray)")
            }
        }


        if true {
            let reference: Int64 = 123
            let referenceArray = [(reference)]
            let reference2dArray = [referenceArray]

            let response = responder.longMethod( arg: reference )
            let responseArray = responder.longArrayMethod( arg: referenceArray )!
            _ = responder.long2dArrayMethod( arg: reference2dArray )

            if response != reference {
                NSLog("Int64: \(String(describing: response)) != \(reference)")
            }
            if responseArray != referenceArray {
                NSLog("Int64: \(responseArray) != \(referenceArray)")
            }
        }


        if true {
            let reference: Float = 123
            let referenceArray = [(reference)]
            let reference2dArray = [referenceArray]

            let response = responder.floatMethod( arg: reference )
            let responseArray = responder.floatArrayMethod( arg: referenceArray )!
            _ = responder.float2dArrayMethod( arg: reference2dArray )

            if response != reference {
                NSLog("Float: \(String(describing: response)) != \(reference)")
            }
            if responseArray != referenceArray {
                NSLog("Float: \(responseArray) != \(referenceArray)")
            }
        }


        if true {
            let reference: Double = 123
            let referenceArray = [(reference)]
            let reference2dArray = [referenceArray]

            let response = responder.doubleMethod( arg: reference )
            let responseArray = responder.doubleArrayMethod( arg: referenceArray )!
            _ = responder.double2dArrayMethod( arg: reference2dArray )

            if response != reference {
                NSLog("Double: \(String(describing: response)) != \(reference)")
            }
            if responseArray != referenceArray {
                NSLog("Double: \(responseArray) != \(referenceArray)")
            }
        }


        if true {
            let reference: String = "123"
            let referenceArray = [(reference)]
            let reference2dArray = [referenceArray]

            let response = responder.StringMethod( arg: reference )
            let responseArray = responder.StringArrayMethod( arg: referenceArray )!
            _ = responder.String2dArrayMethod( arg: reference2dArray )

            if response != reference {
                NSLog("String: \(String(describing: response)) != \(reference)")
            }
            if responseArray != referenceArray {
                NSLog("String: \(responseArray) != \(referenceArray)")
            }
        }


        if true {
            let reference: SwiftHelloTest_TestListener = SwiftTestListener()
            let referenceArray = [(reference)]
            let reference2dArray = [referenceArray]

            let response = responder.TestListenerMethod( arg: reference )
            let responseArray = responder.TestListenerArrayMethod( arg: referenceArray )!
            _ = responder.TestListener2dArrayMethod( arg: reference2dArray )
        }

    }

}
