@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null || this.getClass() != obj.getClass()) { return false; } return getNodeType().equals(((AbstractPathArgument)obj).getNodeType()); }
private static Optional<DataNodeContainer> findNotification(final SchemaContext ctx, final QName notificationQName) { for (final NotificationDefinition notification : ctx.getNotifications()) { if (notification.getQName().equals(notificationQName)) { return Optional.of(notification); } } return Optional.empty(); }
@Override public DataNormalizationOperation<?> getChild(final QName child) { if (getIdentifier().getNodeType().equals(child)) { return innerNode; } return null; }
public static Optional<QName> getRoutingContext(final DataSchemaNode schemaNode) { for (UnknownSchemaNode extension : schemaNode.getUnknownSchemaNodes()) { if (CONTEXT_REFERENCE.equals(extension.getNodeType())) { return Optional.fromNullable(extension.getQName()); } } return Optional.absent(); }
public static Optional<QName> getRoutingContext(final DataSchemaNode schemaNode) { for (UnknownSchemaNode extension : schemaNode.getUnknownSchemaNodes()) { if (CONTEXT_REFERENCE.equals(extension.getNodeType())) { return Optional.ofNullable(extension.getQName()); } } return Optional.empty(); }
@Override public DataSchemaContextNode<?> getChild(final QName child) { if (getIdentifier().getNodeType().equals(child)) { return innerNode; } return null; } }
private static RpcDefinition getRpcByName(final Module module, final QName name) { for (final RpcDefinition rpc : module.getRpcs()) { if (rpc.getQName().equals(name)) { return rpc; } } return null; }
@Override public DataSchemaContextNode<?> getChild(final QName child) { if (getIdentifier().getNodeType().equals(child)) { return innerNode; } return null; }
@Override public DataNormalizationOperation<?> getChild(final QName child) { if (getIdentifier().getNodeType().equals(child)) { return innerNode; } return null; }
@Override public DataSchemaContextNode<?> getChild(final QName child) { if (getIdentifier().getNodeType().equals(child)) { return innerNode; } return null; }
@Override public DataNormalizationOperation<?> getChild(final QName child) { if (getIdentifier().getNodeType().equals(child)) { return innerOp; } return null; } }
@Override public final boolean equals(final @Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof YangFunctionCallExpr)) { return false; } final YangFunctionCallExpr other = (YangFunctionCallExpr) obj; return getName().equals(other.getName()) && getArguments().equals(other.getArguments()); }
@Override public final boolean equals(final @Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof YangFunctionCallExpr)) { return false; } final YangFunctionCallExpr other = (YangFunctionCallExpr) obj; return getName().equals(other.getName()) && getArguments().equals(other.getArguments()); }
private static boolean isDependencyContainer(final DataNodeContainer dataNodeContainer) { if(dataNodeContainer.getUses().size() != 1) { return false; } UsesNode onlyUses = dataNodeContainer.getUses().iterator().next(); if(onlyUses.getGroupingPath().getLastComponent().equals(ServiceRef.QNAME) == false) { return false; } return getChildNodeSizeWithoutUses(dataNodeContainer) == 0; }
@Override public final boolean equals(@Nullable final Object obj) { if (this == obj) { return true; } if (!(obj instanceof QNameStep)) { return false; } final QNameStep other = (QNameStep) obj; return getAxis().equals(other.getAxis()) && qname.equals(other.qname) && getPredicates().equals(other.getPredicates()); }
@Override public DataNormalizationOperation<?> getChild(final PathArgument child) { if (child.getNodeType().equals(getIdentifier().getNodeType())) { return innerNode; } return null; }
private Object getValue(QName key, String value){ if(listSchemaNode != null){ for(DataSchemaNode node : listSchemaNode.getChildNodes()){ if(node instanceof LeafSchemaNode && node.getQName().equals(key)){ return TypeDefinitionAwareCodec.from(LeafSchemaNode.class.cast(node).getType()).deserialize(value); } } } return value; } }
@Override public ListNodeBuilder<T, LeafSetEntryNode<T>> withChild(final LeafSetEntryNode<T> child) { checkArgument(schema.getQName().equals(child.getNodeType()), "Incompatible node type, should be: %s, is: %s", schema.getQName(), child.getNodeType()); // TODO check value type using TypeProvider ? DataValidationException.checkLegalChild(schema.getQName().equals(child.getNodeType()), child.getIdentifier(), schema, Collections.singleton(schema.getQName())); return super.withChild(child); }
@Override public CollectionNodeBuilder<MapEntryNode, OrderedMapNode> withChild(final MapEntryNode child) { DataValidationException.checkLegalChild(schema.getQName().equals(child.getNodeType()), child.getIdentifier(), schema, Collections.singleton(schema.getQName())); return super.withChild(child); }
public static String convertToJavaName(final SchemaNode schemaNode, final boolean capitalizeFirstLetter) { for (UnknownSchemaNode unknownNode : schemaNode.getUnknownSchemaNodes()) { if (ConfigConstants.JAVA_NAME_PREFIX_EXTENSION_QNAME .equals(unknownNode.getNodeType())) { String value = unknownNode.getNodeParameter(); return convertToJavaName(value, capitalizeFirstLetter); } } return convertToJavaName(schemaNode.getQName().getLocalName(), capitalizeFirstLetter); }