*/
package org.opendaylight.controller.cluster.datastore.messages;
-import com.google.common.base.Preconditions;
-import javax.annotation.Nonnull;
+import static java.util.Objects.requireNonNull;
+
import org.apache.commons.lang3.ObjectUtils;
-import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree;
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.yangtools.yang.data.api.schema.tree.ReadOnlyDataTree;
/**
* Local message sent in reply to FindPrimaryShard to indicate the primary shard is local to the caller.
public class LocalPrimaryShardFound {
private final String primaryPath;
- private final DataTree localShardDataTree;
+ private final ReadOnlyDataTree localShardDataTree;
- public LocalPrimaryShardFound(@Nonnull String primaryPath, @Nonnull DataTree localShardDataTree) {
- this.primaryPath = Preconditions.checkNotNull(primaryPath);
- this.localShardDataTree = Preconditions.checkNotNull(localShardDataTree);
+ public LocalPrimaryShardFound(@NonNull String primaryPath, @NonNull ReadOnlyDataTree localShardDataTree) {
+ this.primaryPath = requireNonNull(primaryPath);
+ this.localShardDataTree = requireNonNull(localShardDataTree);
}
- public @Nonnull String getPrimaryPath() {
+ public @NonNull String getPrimaryPath() {
return primaryPath;
}
- public @Nonnull DataTree getLocalShardDataTree() {
+ public @NonNull ReadOnlyDataTree getLocalShardDataTree() {
return localShardDataTree;
}
@Override
public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("LocalPrimaryShardFound [primaryPath=").append(primaryPath).append(", localShardDataTree=")
- .append(ObjectUtils.identityToString(localShardDataTree)).append("]");
- return builder.toString();
+ return "LocalPrimaryShardFound [primaryPath=" + primaryPath
+ + ", localShardDataTree=" + ObjectUtils.identityToString(localShardDataTree) + "]";
}
}