/* * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.LeafNode; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeAttrBuilder; import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; public final class ImmutableLeafNodeSchemaAwareBuilder extends ImmutableLeafNodeBuilder { private ImmutableLeafNodeSchemaAwareBuilder(LeafSchemaNode schema) { super.withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(schema.getQName())); } public static NormalizedNodeAttrBuilder> create(LeafSchemaNode schema) { return new ImmutableLeafNodeSchemaAwareBuilder<>(schema); } @Override public NormalizedNodeAttrBuilder> withValue(T value) { // TODO check value type return super.withValue(value); } @Override public NormalizedNodeAttrBuilder> withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier nodeIdentifier) { throw new UnsupportedOperationException("Node identifier created from schema"); } }