*/
package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+import static java.util.Objects.requireNonNull;
+
import java.util.Collections;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode;
private final LeafListSchemaNode schema;
private ImmutableLeafSetNodeSchemaAwareBuilder(final LeafListSchemaNode schema) {
- this.schema = Preconditions.checkNotNull(schema);
+ this.schema = requireNonNull(schema);
super.withNodeIdentifier(new NodeIdentifier(schema.getQName()));
}
public ImmutableLeafSetNodeSchemaAwareBuilder(final LeafListSchemaNode schema, final ImmutableLeafSetNode<T> node) {
super(node);
- this.schema = Preconditions.checkNotNull(schema);
+ this.schema = requireNonNull(schema);
// FIXME: Preconditions.checkArgument(schema.getQName().equals(node.getIdentifier()));
super.withNodeIdentifier(new NodeIdentifier(schema.getQName()));
}
@Override
public ListNodeBuilder<T, LeafSetEntryNode<T>> withChild(final LeafSetEntryNode<T> child) {
- Preconditions.checkArgument(schema.getQName().equals(child.getNodeType()),
+ 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(),