本文整理汇总了Java中com.smartdevicelink.proxy.rpc.enums.RequestType类的典型用法代码示例。如果您正苦于以下问题:Java RequestType类的具体用法?Java RequestType怎么用?Java RequestType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RequestType类属于com.smartdevicelink.proxy.rpc.enums包,在下文中一共展示了RequestType类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onOnSystemRequest
import com.smartdevicelink.proxy.rpc.enums.RequestType; //导入依赖的package包/类
@Override
public void onOnSystemRequest(OnSystemRequest notification) {
Log.i(TAG, "OnSystemRequest notification from SDL: " + notification);
// Download the lockscreen icon Core desires
if(notification.getRequestType().equals(RequestType.LOCK_SCREEN_ICON_URL) && lockScreenUrlFromCore == null){
lockScreenUrlFromCore = notification.getUrl();
if(lockScreenUrlFromCore != null && lockScreenManager.getLockScreenIcon() == null){
lockScreenManager.downloadLockScreenIcon(lockScreenUrlFromCore, new LockScreenDownloadedListener());
}
}
}
示例2: buildSystemRequest
import com.smartdevicelink.proxy.rpc.enums.RequestType; //导入依赖的package包/类
public static SystemRequest buildSystemRequest(
String data, Integer correlationID) {
if(data == null) return null;
SystemRequest msg = new SystemRequest();
msg.setRequestType(RequestType.PROPRIETARY);
msg.setCorrelationID(correlationID);
msg.setBulkData(data.getBytes());
return msg;
}
示例3: testInvalidEnum
import com.smartdevicelink.proxy.rpc.enums.RequestType; //导入依赖的package包/类
/**
* Verifies that an invalid assignment is null.
*/
public void testInvalidEnum () {
String example = "hTTp";
try {
RequestType temp = RequestType.valueForString(example);
assertNull("Result of valueForString should be null.", temp);
}
catch (IllegalArgumentException exception) {
fail("Invalid enum throws IllegalArgumentException.");
}
}
示例4: testNullEnum
import com.smartdevicelink.proxy.rpc.enums.RequestType; //导入依赖的package包/类
/**
* Verifies that a null assignment is invalid.
*/
public void testNullEnum () {
String example = null;
try {
RequestType temp = RequestType.valueForString(example);
assertNull("Result of valueForString should be null.", temp);
}
catch (NullPointerException exception) {
fail("Null string throws NullPointerException.");
}
}
示例5: testListEnum
import com.smartdevicelink.proxy.rpc.enums.RequestType; //导入依赖的package包/类
/**
* Verifies the possible enum values of RequestType.
*/
public void testListEnum() {
List<RequestType> enumValueList = Arrays.asList(RequestType.values());
List<RequestType> enumTestList = new ArrayList<RequestType>();
enumTestList.add(RequestType.HTTP);
enumTestList.add(RequestType.FILE_RESUME);
enumTestList.add(RequestType.AUTH_REQUEST);
enumTestList.add(RequestType.AUTH_CHALLENGE);
enumTestList.add(RequestType.AUTH_ACK);
enumTestList.add(RequestType.PROPRIETARY);
enumTestList.add(RequestType.QUERY_APPS);
enumTestList.add(RequestType.LAUNCH_APP);
enumTestList.add(RequestType.LOCK_SCREEN_ICON_URL);
enumTestList.add(RequestType.TRAFFIC_MESSAGE_CHANNEL);
enumTestList.add(RequestType.DRIVER_PROFILE);
enumTestList.add(RequestType.VOICE_SEARCH);
enumTestList.add(RequestType.NAVIGATION);
enumTestList.add(RequestType.PHONE);
enumTestList.add(RequestType.CLIMATE);
enumTestList.add(RequestType.SETTINGS);
enumTestList.add(RequestType.VEHICLE_DIAGNOSTICS);
enumTestList.add(RequestType.EMERGENCY);
enumTestList.add(RequestType.MEDIA);
enumTestList.add(RequestType.FOTA);
assertTrue("Enum value list does not match enum class list",
enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
}
示例6: getRequestType
import com.smartdevicelink.proxy.rpc.enums.RequestType; //导入依赖的package包/类
public RequestType getRequestType() {
return (RequestType) getObject(RequestType.class, KEY_REQUEST_TYPE);
}
示例7: setRequestType
import com.smartdevicelink.proxy.rpc.enums.RequestType; //导入依赖的package包/类
public void setRequestType(RequestType requestType) {
setParameters(KEY_REQUEST_TYPE, requestType);
}
示例8: testValidEnums
import com.smartdevicelink.proxy.rpc.enums.RequestType; //导入依赖的package包/类
/**
* Verifies that the enum values are not null upon valid assignment.
*/
public void testValidEnums () {
String example = "HTTP";
RequestType enumHttp = RequestType.valueForString(example);
example = "FILE_RESUME";
RequestType enumFileResume = RequestType.valueForString(example);
example = "AUTH_REQUEST";
RequestType enumAuthRequest = RequestType.valueForString(example);
example = "AUTH_CHALLENGE";
RequestType enumAuthChallenge = RequestType.valueForString(example);
example = "AUTH_ACK";
RequestType enumAuthAck = RequestType.valueForString(example);
example = "PROPRIETARY";
RequestType enumProprietary = RequestType.valueForString(example);
example = "QUERY_APPS";
RequestType enumQueryApps = RequestType.valueForString(example);
example = "LAUNCH_APP";
RequestType enumLaunchApp = RequestType.valueForString(example);
example = "LOCK_SCREEN_ICON_URL";
RequestType enumLockScreen = RequestType.valueForString(example);
example = "TRAFFIC_MESSAGE_CHANNEL";
RequestType enumTrafficMessage = RequestType.valueForString(example);
example = "DRIVER_PROFILE";
RequestType enumDriverProfile = RequestType.valueForString(example);
example = "VOICE_SEARCH";
RequestType enumVoiceSearch = RequestType.valueForString(example);
example = "NAVIGATION";
RequestType enumNavigation = RequestType.valueForString(example);
example = "PHONE";
RequestType enumPhone = RequestType.valueForString(example);
example = "CLIMATE";
RequestType enumClimate = RequestType.valueForString(example);
example = "SETTINGS";
RequestType enumSettings = RequestType.valueForString(example);
example = "VEHICLE_DIAGNOSTICS";
RequestType enumDiagnostics = RequestType.valueForString(example);
example = "EMERGENCY";
RequestType enumEmergency = RequestType.valueForString(example);
example = "MEDIA";
RequestType enumMedia = RequestType.valueForString(example);
example = "FOTA";
RequestType enumFota = RequestType.valueForString(example);
assertNotNull("HTTP returned null", enumHttp);
assertNotNull("FILE_RESUME returned null", enumFileResume);
assertNotNull("AUTH_REQUEST returned null", enumAuthRequest);
assertNotNull("AUTH_CHALLENGE returned null", enumAuthChallenge);
assertNotNull("AUTH_ACK returned null", enumAuthAck);
assertNotNull("PROPRIETARY returned null", enumProprietary);
assertNotNull(Test.NOT_NULL, enumQueryApps);
assertNotNull(Test.NOT_NULL, enumLaunchApp);
assertNotNull(Test.NOT_NULL, enumLockScreen);
assertNotNull(Test.NOT_NULL, enumTrafficMessage);
assertNotNull(Test.NOT_NULL, enumDriverProfile);
assertNotNull(Test.NOT_NULL, enumVoiceSearch);
assertNotNull(Test.NOT_NULL, enumNavigation);
assertNotNull(Test.NOT_NULL, enumPhone);
assertNotNull(Test.NOT_NULL, enumClimate);
assertNotNull(Test.NOT_NULL, enumSettings);
assertNotNull(Test.NOT_NULL, enumDiagnostics);
assertNotNull(Test.NOT_NULL, enumEmergency);
assertNotNull(Test.NOT_NULL, enumMedia);
assertNotNull(Test.NOT_NULL, enumFota);
}