* @param prefix Prefix for lookup
* @return closest non-null entry towards root or null if no entry towards root exists.
*/
- public @Nullable DOMDataTreePrefixTableEntry<V> lookup(@Nonnull final DOMDataTreeIdentifier prefix) {
+ @Nullable
+ public DOMDataTreePrefixTableEntry<V> lookup(@Nonnull final DOMDataTreeIdentifier prefix) {
final DOMDataTreePrefixTableEntry<V> t = roots.get(prefix.getDatastoreType());
if (t == null) {
return null;
public void store(@Nonnull final DOMDataTreeIdentifier prefix, @Nonnull final V value) {
DOMDataTreePrefixTableEntry<V> domDataTreePrefixTableEntry = roots.get(prefix.getDatastoreType());
if (domDataTreePrefixTableEntry == null) {
- domDataTreePrefixTableEntry = new DOMDataTreePrefixTableEntry<V>();
+ domDataTreePrefixTableEntry = new DOMDataTreePrefixTableEntry<>();
roots.put(prefix.getDatastoreType(), domDataTreePrefixTableEntry);
}
private final Collection<RpcError> errors;
private final NormalizedNode<?, ?> result;
- private static Collection<RpcError> asCollection(final RpcError... errors) {
- if (errors.length == 0) {
- return Collections.emptyList();
- } else {
- return Arrays.asList(errors);
- }
- }
-
public DefaultDOMRpcResult(final NormalizedNode<?, ?> result, final RpcError... errors) {
this(result, asCollection(errors));
}
this(result, Collections.<RpcError>emptyList());
}
- public DefaultDOMRpcResult(final NormalizedNode<?, ?> result, final @Nonnull Collection<RpcError> errors) {
+ public DefaultDOMRpcResult(final NormalizedNode<?, ?> result, @Nonnull final Collection<RpcError> errors) {
this.result = result;
this.errors = Preconditions.checkNotNull(errors);
}
- public DefaultDOMRpcResult(final @Nonnull Collection<RpcError> errors) {
+ public DefaultDOMRpcResult(@Nonnull final Collection<RpcError> errors) {
this(null, errors);
}
+ private static Collection<RpcError> asCollection(final RpcError... errors) {
+ if (errors.length == 0) {
+ return Collections.emptyList();
+ } else {
+ return Arrays.asList(errors);
+ }
+ }
+
@Override
- public @Nonnull Collection<RpcError> getErrors() {
+ @Nonnull
+ public Collection<RpcError> getErrors() {
return errors;
}
public abstract class ForwardingDOMDataBroker extends ForwardingObject implements DOMDataBroker {
@Override
- protected abstract @Nonnull DOMDataBroker delegate();
+ @Nonnull
+ protected abstract DOMDataBroker delegate();
@Override
public DOMDataTreeReadTransaction newReadOnlyTransaction() {
public abstract class ForwardingDOMDataWriteTransaction extends ForwardingObject
implements DOMDataTreeWriteTransaction {
@Override
- protected abstract @Nonnull DOMDataTreeWriteTransaction delegate();
+ @Nonnull
+ protected abstract DOMDataTreeWriteTransaction delegate();
@Override
public Object getIdentifier() {
*/
public abstract class ForwardingDOMRpcImplementation extends ForwardingObject implements DOMRpcImplementation {
@Override
- protected abstract @Nonnull DOMRpcImplementation delegate();
+ @Nonnull
+ protected abstract DOMRpcImplementation delegate();
@Override
public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(
*/
public abstract class ForwardingDOMRpcProviderService extends ForwardingObject implements DOMRpcProviderService {
@Override
- protected abstract @Nonnull DOMRpcProviderService delegate();
+ @Nonnull
+ protected abstract DOMRpcProviderService delegate();
@Override
public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(
*/
public abstract class ForwardingDOMRpcResult extends ForwardingObject implements DOMRpcResult {
@Override
- protected abstract @Nonnull DOMRpcResult delegate();
+ @Nonnull
+ protected abstract DOMRpcResult delegate();
@Override
public Collection<RpcError> getErrors() {
*/
public abstract class ForwardingDOMRpcService extends ForwardingObject implements DOMRpcService {
@Override
- protected abstract @Nonnull DOMRpcService delegate();
+ @Nonnull
+ protected abstract DOMRpcService delegate();
@Override
public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(
*/
public abstract class ForwardingDOMTransactionChain extends ForwardingObject implements DOMTransactionChain {
@Override
- protected abstract @Nonnull DOMTransactionChain delegate();
+ @Nonnull
+ protected abstract DOMTransactionChain delegate();
@Override
public void close() {
* @param arg Child identifier
* @return Collection of children, guaranteed to be non-null.
*/
- public @Nonnull Collection<RegistrationTreeNode<T>> getInexactChildren(@Nonnull final PathArgument arg) {
+ @Nonnull
+ public Collection<RegistrationTreeNode<T>> getInexactChildren(@Nonnull final PathArgument arg) {
Preconditions.checkNotNull(arg);
if (arg instanceof NodeWithValue || arg instanceof NodeIdentifierWithPredicates) {
/*
RegistrationTreeNode<T> ensureChild(@Nonnull final PathArgument child) {
RegistrationTreeNode<T> potential = children.get(Preconditions.checkNotNull(child));
if (potential == null) {
- potential = new RegistrationTreeNode<T>(this, child);
+ potential = new RegistrationTreeNode<>(this, child);
children.put(child, potential);
}
return potential;
private final ClassToInstanceMap<DOMService> services;
private final SchemaContext schemaContext;
- public static final SimpleDOMMountPoint create(final YangInstanceIdentifier identifier,
- final ClassToInstanceMap<DOMService> services, final SchemaContext ctx) {
- return new SimpleDOMMountPoint(identifier, services, ctx);
- }
-
private SimpleDOMMountPoint(final YangInstanceIdentifier identifier,
final ClassToInstanceMap<DOMService> services, final SchemaContext ctx) {
this.identifier = identifier;
this.schemaContext = ctx;
}
+ public static final SimpleDOMMountPoint create(final YangInstanceIdentifier identifier,
+ final ClassToInstanceMap<DOMService> services, final SchemaContext ctx) {
+ return new SimpleDOMMountPoint(identifier, services, ctx);
+ }
+
@Override
public YangInstanceIdentifier getIdentifier() {
return identifier;
import java.util.AbstractMap.SimpleEntry;
import java.util.Map.Entry;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
-
import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction.TransactionReadyPrototype;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot;
}
private boolean recordTransaction(final State expected, final DOMStoreWriteTransaction transaction) {
- final State state = new Allocated(transaction);
- return STATE_UPDATER.compareAndSet(this, expected, state);
+ final State real = new Allocated(transaction);
+ return STATE_UPDATER.compareAndSet(this, expected, real);
}
@Override
*/
public static <T> SnapshotBackedReadTransaction<T> newReadTransaction(final T identifier,
final boolean debug, final DataTreeSnapshot snapshot) {
- return new SnapshotBackedReadTransaction<T>(identifier, debug, snapshot);
+ return new SnapshotBackedReadTransaction<>(identifier, debug, snapshot);
}
/**
*/
public static <T> SnapshotBackedReadWriteTransaction<T> newReadWriteTransaction(final T identifier,
final boolean debug, final DataTreeSnapshot snapshot, final TransactionReadyPrototype<T> readyImpl) {
- return new SnapshotBackedReadWriteTransaction<T>(identifier, debug, snapshot, readyImpl);
+ return new SnapshotBackedReadWriteTransaction<>(identifier, debug, snapshot, readyImpl);
}
/**
*/
public static <T> SnapshotBackedWriteTransaction<T> newWriteTransaction(final T identifier,
final boolean debug, final DataTreeSnapshot snapshot, final TransactionReadyPrototype<T> readyImpl) {
- return new SnapshotBackedWriteTransaction<T>(identifier, debug, snapshot, readyImpl);
+ return new SnapshotBackedWriteTransaction<>(identifier, debug, snapshot, readyImpl);
}
}