本文整理汇总了Java中com.digitalpetri.opcua.stack.core.types.builtin.QualifiedName.NULL_VALUE属性的典型用法代码示例。如果您正苦于以下问题:Java QualifiedName.NULL_VALUE属性的具体用法?Java QualifiedName.NULL_VALUE怎么用?Java QualifiedName.NULL_VALUE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.digitalpetri.opcua.stack.core.types.builtin.QualifiedName
的用法示例。
在下文中一共展示了QualifiedName.NULL_VALUE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decodeQualifiedName
@Override
public QualifiedName decodeQualifiedName(String field) {
if (nextStartElement(field)) {
UShort namespaceIndex = Unsigned.ushort(0);
String name = "";
if (nextStartElement("NamespaceIndex")) {
namespaceIndex = decodeUInt16(null);
requireNextEndElement("NamespaceIndex");
}
if (nextStartElement("Name")) {
name = decodeString(null);
requireNextEndElement("Name");
}
requireNextEndElement(field);
return new QualifiedName(namespaceIndex, name);
} else {
return QualifiedName.NULL_VALUE;
}
}
示例2: readEventAttributes
private CompletableFuture<EventAttributes> readEventAttributes(Namespace namespace, NodeId nodeId) {
Function<AttributeId, ReadValueId> f = id ->
new ReadValueId(nodeId, id.uid(), null, QualifiedName.NULL_VALUE);
CompletableFuture<List<DataValue>> future = new CompletableFuture<>();
ReadContext readContext = new ReadContext(
server, null, future, new DiagnosticsContext<>());
List<ReadValueId> readValueIds = newArrayList(
f.apply(AttributeId.AccessLevel),
f.apply(AttributeId.UserAccessLevel),
f.apply(AttributeId.EventNotifier));
namespace.read(readContext, 0.0, TimestampsToReturn.Neither, readValueIds);
return future.thenApply(values -> {
UByte accessLevel = Optional.ofNullable((UByte) values.get(0).getValue().getValue()).orElse(ubyte(1));
UByte userAccessLevel = Optional.ofNullable((UByte) values.get(1).getValue().getValue()).orElse(ubyte(1));
Optional<UByte> eventNotifier = Optional.ofNullable((UByte) values.get(2).getValue().getValue());
return new EventAttributes(
AccessLevel.fromMask(accessLevel),
AccessLevel.fromMask(userAccessLevel),
eventNotifier);
});
}
示例3: encodeQualifiedName
@Override
public void encodeQualifiedName(String field, QualifiedName value) throws UaSerializationException {
if (value == null) value = QualifiedName.NULL_VALUE;
encodeUInt16(null, value.getNamespaceIndex());
encodeString(null, value.getName());
}
示例4: readDataAttributes
private CompletableFuture<List<DataValue>> readDataAttributes(Namespace namespace, NodeId itemId) {
Function<AttributeId, ReadValueId> f = id ->
new ReadValueId(itemId, id.uid(), null, QualifiedName.NULL_VALUE);
CompletableFuture<List<DataValue>> future = new CompletableFuture<>();
ReadContext readContext = new ReadContext(
server, null, future, new DiagnosticsContext<>());
List<ReadValueId> attributes = newArrayList(
f.apply(AttributeId.AccessLevel),
f.apply(AttributeId.UserAccessLevel),
f.apply(AttributeId.MinimumSamplingInterval));
namespace.read(readContext, 0.0, TimestampsToReturn.Neither, attributes);
return future;
}