All Downloads are FREE. Search and download functionalities are using the official Maven repository.

joynr.vehicle.RadioAsync Maven / Gradle / Ivy

/*
 *
 * Copyright (C) 2011 - 2017 BMW Car IT GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// #####################################################
//#######################################################
//###                                                 ###
//##    WARNING: This file is generated. DO NOT EDIT   ##
//##             All changes will be lost!             ##
//###                                                 ###
//#######################################################
// #####################################################
package joynr.vehicle;

import io.joynr.proxy.Callback;
import io.joynr.proxy.ICallbackWithModeledError;
import io.joynr.proxy.CallbackWithModeledError;
import io.joynr.proxy.Future;
import io.joynr.dispatcher.rpc.annotation.JoynrRpcCallback;
import io.joynr.proxy.ICallback;
import io.joynr.Async;

import joynr.vehicle.Country;
import joynr.vehicle.GeoPosition;
import joynr.vehicle.RadioStation;

	import joynr.vehicle.RadioSync.GetLocationOfCurrentStationReturned;

@Async
public interface RadioAsync extends Radio {

	public Future getCurrentStation(@JoynrRpcCallback(deserializationType = RadioStation.class) Callback callback);

	public static class GetLocationOfCurrentStationFuture extends Future {
		public void resolve(Object... outParameters) {
			if (outParameters.length == 0) {
				onSuccess(null);
			} else {
				onSuccess(new GetLocationOfCurrentStationReturned(outParameters));
			}
		}

		public static Class[] getDatatypes() {
			return GetLocationOfCurrentStationReturned.getDatatypes();
		}
	}

	public abstract class GetLocationOfCurrentStationCallback implements ICallback {
		public abstract void onSuccess(Country country, GeoPosition location);

		public void resolve(Object... outParameters) {
			if (outParameters.length < 2) {
				onSuccess(null, null);
			} else {
					onSuccess(
						(Country) outParameters[0],
						(GeoPosition) outParameters[1]
				);
			}
		}
	}


	/*
	* shuffleStations
	*/
	public Future shuffleStations(
			@JoynrRpcCallback(deserializationType = Void.class) Callback callback
	);

	/*
	* addFavoriteStation
	*/
	public Future addFavoriteStation(
			@JoynrRpcCallback(deserializationType = Boolean.class) CallbackWithModeledError callback,
			RadioStation newFavoriteStation
	);

	/*
	* getLocationOfCurrentStation
	*/
	public GetLocationOfCurrentStationFuture getLocationOfCurrentStation(
			@JoynrRpcCallback GetLocationOfCurrentStationCallback callback
	);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy