本文整理汇总了Java中org.eclipse.leshan.core.model.ResourceModel.Type.OBJLNK属性的典型用法代码示例。如果您正苦于以下问题:Java Type.OBJLNK属性的具体用法?Java Type.OBJLNK怎么用?Java Type.OBJLNK使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.leshan.core.model.ResourceModel.Type
的用法示例。
在下文中一共展示了Type.OBJLNK属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createObjectModels
protected List<ObjectModel> createObjectModels() {
// load default object from the spec
List<ObjectModel> objectModels = ObjectLoader.loadDefault();
// define custom model for testing purpose
ResourceModel stringfield = new ResourceModel(STRING_RESOURCE_ID, "stringres", Operations.RW, false, false,
Type.STRING, null, null, null);
ResourceModel booleanfield = new ResourceModel(BOOLEAN_RESOURCE_ID, "booleanres", Operations.RW, false, false,
Type.BOOLEAN, null, null, null);
ResourceModel integerfield = new ResourceModel(INTEGER_RESOURCE_ID, "integerres", Operations.RW, false, false,
Type.INTEGER, null, null, null);
ResourceModel floatfield = new ResourceModel(FLOAT_RESOURCE_ID, "floatres", Operations.RW, false, false,
Type.FLOAT, null, null, null);
ResourceModel timefield = new ResourceModel(TIME_RESOURCE_ID, "timeres", Operations.RW, false, false, Type.TIME,
null, null, null);
ResourceModel opaquefield = new ResourceModel(OPAQUE_RESOURCE_ID, "opaque", Operations.RW, false, false,
Type.OPAQUE, null, null, null);
ResourceModel objlnkfield = new ResourceModel(OBJLNK_MULTI_INSTANCE_RESOURCE_ID, "objlnk", Operations.RW, true,
false, Type.OBJLNK, null, null, null);
ResourceModel objlnkSinglefield = new ResourceModel(OBJLNK_SINGLE_INSTANCE_RESOURCE_ID, "objlnk", Operations.RW,
false, false, Type.OBJLNK, null, null, null);
objectModels.add(new ObjectModel(TEST_OBJECT_ID, "testobject", null, ObjectModel.DEFAULT_VERSION, false, false,
stringfield, booleanfield, integerfield, floatfield, timefield, opaquefield, objlnkfield,
objlnkSinglefield));
return objectModels;
}
示例2: getType
public ResourceModel.Type getType() {
if (booleanValue != null) {
return Type.BOOLEAN;
}
if (floatValue != null) {
return Type.FLOAT;
}
if (objectLinkValue != null) {
return Type.OBJLNK;
}
if (stringValue != null) {
return Type.STRING;
}
return null;
}
示例3: parseResource
private ResourceModel parseResource(Node item) {
Integer id = Integer.valueOf(item.getAttributes().getNamedItem("ID").getTextContent());
String name = null;
Operations operations = Operations.NONE;
boolean multiple = false;
boolean mandatory = false;
Type type = Type.STRING;
String rangeEnumeration = null;
String units = null;
String description = null;
for (int i = 0; i < item.getChildNodes().getLength(); i++) {
Node field = item.getChildNodes().item(i);
switch (field.getNodeName()) {
case "Name":
name = field.getTextContent();
break;
case "Operations":
String strOp = field.getTextContent();
if (strOp != null && !strOp.isEmpty()) {
operations = Operations.valueOf(strOp);
}
break;
case "MultipleInstances":
multiple = "Multiple".equals(field.getTextContent());
break;
case "Mandatory":
mandatory = "Mandatory".equals(field.getTextContent());
break;
case "Type":
switch (field.getTextContent()) {
case "String":
type = Type.STRING;
break;
case "Integer":
type = Type.INTEGER;
break;
case "Float":
type = Type.FLOAT;
break;
case "Boolean":
type = Type.BOOLEAN;
break;
case "Opaque":
type = Type.OPAQUE;
break;
case "Time":
type = Type.TIME;
break;
case "Objlnk":
type = Type.OBJLNK;
break;
}
break;
case "RangeEnumeration":
rangeEnumeration = field.getTextContent();
break;
case "Units":
units = field.getTextContent();
break;
case "Description":
description = field.getTextContent();
break;
}
}
return new ResourceModel(id, name, operations, multiple, mandatory, type, rangeEnumeration, units, description);
}
示例4: newObjectLinkResource
public static LwM2mMultipleResource newObjectLinkResource(int id, Map<Integer, ObjectLink> values) {
Validate.noNullElements(values.values());
return new LwM2mMultipleResource(id, values, Type.OBJLNK);
}
示例5: newObjectLinkResource
public static LwM2mSingleResource newObjectLinkResource(int id, ObjectLink objlink) {
return new LwM2mSingleResource(id, objlink, Type.OBJLNK);
}