
org.opendaylight.yangtools.binding.impl.DataObjectReferenceBuilderWithKey Maven / Gradle / Ivy
/*
* Copyright (c) 2024 PANTHEON.tech, s.r.o. 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.binding.impl;
import org.opendaylight.yangtools.binding.DataObject;
import org.opendaylight.yangtools.binding.DataObjectReference;
import org.opendaylight.yangtools.binding.DataObjectReference.Builder.WithKey;
import org.opendaylight.yangtools.binding.DataObjectStep;
import org.opendaylight.yangtools.binding.EntryObject;
import org.opendaylight.yangtools.binding.Key;
import org.opendaylight.yangtools.binding.KeyStep;
public final class DataObjectReferenceBuilderWithKey, K extends Key>
extends AbstractDataObjectReferenceBuilder implements WithKey {
DataObjectReferenceBuilderWithKey(final DataObjectReferenceBuilder> prev) {
super(prev);
}
DataObjectReferenceBuilderWithKey(final DataObjectReference.WithKey base) {
super(base);
}
public DataObjectReferenceBuilderWithKey(final KeyStep item) {
super(item);
}
@Override
public DataObjectReference.WithKey build() {
final var steps = buildSteps();
return wildcard() ? new DataObjectReferenceWithKey<>(steps) : new DataObjectIdentifierWithKey<>(null, steps);
}
@Override
protected DataObjectReferenceBuilder append(final DataObjectStep step) {
return new DataObjectReferenceBuilder(this).append(step);
}
@Override
@SuppressWarnings("unchecked")
protected , Y extends Key> DataObjectReferenceBuilderWithKey append(
final KeyStep step) {
appendItem(step);
return (DataObjectReferenceBuilderWithKey) this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy