本文整理汇总了Java中com.smartdevicelink.proxy.rpc.enums.DisplayType.valueForString方法的典型用法代码示例。如果您正苦于以下问题:Java DisplayType.valueForString方法的具体用法?Java DisplayType.valueForString怎么用?Java DisplayType.valueForString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.smartdevicelink.proxy.rpc.enums.DisplayType
的用法示例。
在下文中一共展示了DisplayType.valueForString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testValidEnums
import com.smartdevicelink.proxy.rpc.enums.DisplayType; //导入方法依赖的package包/类
/**
* Verifies that the enum values are not null upon valid assignment.
*/
public void testValidEnums () {
String example = "CID";
DisplayType enumCid = DisplayType.valueForString(example);
example = "TYPE2";
DisplayType enumType2 = DisplayType.valueForString(example);
example = "TYPE5";
DisplayType enumType5 = DisplayType.valueForString(example);
example = "NGN";
DisplayType enumNgn = DisplayType.valueForString(example);
example = "GEN2_8_DMA";
DisplayType enumGen2_8Dma = DisplayType.valueForString(example);
example = "GEN2_6_DMA";
DisplayType enumGen2_6Dma = DisplayType.valueForString(example);
example = "MFD3";
DisplayType enumMfd3 = DisplayType.valueForString(example);
example = "MFD4";
DisplayType enumMfd4 = DisplayType.valueForString(example);
example = "MFD5";
DisplayType enumMfd5 = DisplayType.valueForString(example);
example = "GEN3_8-INCH";
DisplayType enumGen3_8Inch = DisplayType.valueForString(example);
example = "SDL_GENERIC";
DisplayType enumGeneric = DisplayType.valueForString(example);
assertNotNull("CID returned null", enumCid);
assertNotNull("TYPE2 returned null", enumType2);
assertNotNull("TYPE5 returned null", enumType5);
assertNotNull("NGN returned null", enumNgn);
assertNotNull("GEN2_8_DMA returned null", enumGen2_8Dma);
assertNotNull("GEN2_6_DMA returned null", enumGen2_6Dma);
assertNotNull("MFD3 returned null", enumMfd3);
assertNotNull("MFD4 returned null", enumMfd4);
assertNotNull("MFD5 returned null", enumMfd5);
assertNotNull("GEN3_8-INCH returned null", enumGen3_8Inch);
assertNotNull("SDL_GENERIC returned null", enumGeneric);
}
示例2: testInvalidEnum
import com.smartdevicelink.proxy.rpc.enums.DisplayType; //导入方法依赖的package包/类
/**
* Verifies that an invalid assignment is null.
*/
public void testInvalidEnum () {
String example = "cId";
try {
DisplayType temp = DisplayType.valueForString(example);
assertNull("Result of valueForString should be null.", temp);
}
catch (IllegalArgumentException exception) {
fail("Invalid enum throws IllegalArgumentException.");
}
}
示例3: testNullEnum
import com.smartdevicelink.proxy.rpc.enums.DisplayType; //导入方法依赖的package包/类
/**
* Verifies that a null assignment is invalid.
*/
public void testNullEnum () {
String example = null;
try {
DisplayType temp = DisplayType.valueForString(example);
assertNull("Result of valueForString should be null.", temp);
}
catch (NullPointerException exception) {
fail("Null string throws NullPointerException.");
}
}