本文整理汇总了Java中com.smartdevicelink.proxy.rpc.enums.DisplayType类的典型用法代码示例。如果您正苦于以下问题:Java DisplayType类的具体用法?Java DisplayType怎么用?Java DisplayType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DisplayType类属于com.smartdevicelink.proxy.rpc.enums包,在下文中一共展示了DisplayType类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testListEnum
import com.smartdevicelink.proxy.rpc.enums.DisplayType; //导入依赖的package包/类
/**
* Verifies the possible enum values of DisplayType.
*/
public void testListEnum() {
List<DisplayType> enumValueList = Arrays.asList(DisplayType.values());
List<DisplayType> enumTestList = new ArrayList<DisplayType>();
enumTestList.add(DisplayType.CID);
enumTestList.add(DisplayType.TYPE2);
enumTestList.add(DisplayType.TYPE5);
enumTestList.add(DisplayType.NGN);
enumTestList.add(DisplayType.GEN2_8_DMA);
enumTestList.add(DisplayType.GEN2_6_DMA);
enumTestList.add(DisplayType.MFD3);
enumTestList.add(DisplayType.MFD4);
enumTestList.add(DisplayType.MFD5);
enumTestList.add(DisplayType.GEN3_8_INCH);
enumTestList.add(DisplayType.SDL_GENERIC);
assertTrue("Enum value list does not match enum class list",
enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
}
示例2: 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);
}
示例3: 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.");
}
}
示例4: 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.");
}
}
示例5: getDisplayType
import com.smartdevicelink.proxy.rpc.enums.DisplayType; //导入依赖的package包/类
/**
* Get the type of display
* @return the type of display
*/
public DisplayType getDisplayType() {
return (DisplayType) getObject(DisplayType.class, KEY_DISPLAY_TYPE);
}
示例6: setDisplayType
import com.smartdevicelink.proxy.rpc.enums.DisplayType; //导入依赖的package包/类
/**
* Set the type of display
* @param displayType the display type
*/
public void setDisplayType( DisplayType displayType ) {
setValue(KEY_DISPLAY_TYPE, displayType);
}