package org.opendaylight.netconf.topology.singleton.messages;
import com.google.common.collect.Iterables;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
public class SchemaPathMessage implements Serializable {
private static final long serialVersionUID = 1L;
- private SchemaPath schemaPath;
+ @SuppressFBWarnings("SE_BAD_FIELD")
+ private final SchemaPath schemaPath;
public SchemaPathMessage(final SchemaPath schemaPath) {
this.schemaPath = schemaPath;
return new Proxy(this);
}
+ @Override
+ public String toString() {
+ return "SchemaPathMessage [schemaPath=" + schemaPath + "]";
+ }
+
private static class Proxy implements Externalizable {
private static final long serialVersionUID = 2L;
private SchemaPathMessage schemaPathMessage;
- Proxy() {
+ @SuppressWarnings("checkstyle:RedundantModifier")
+ public Proxy() {
//due to Externalizable
}
@Override
public void writeExternal(final ObjectOutput out) throws IOException {
- out.writeInt(Iterables.size(schemaPathMessage.getSchemaPath().getPathTowardsRoot()));
-
- for (final QName qualifiedName : schemaPathMessage.getSchemaPath().getPathTowardsRoot()) {
+ final Iterable<QName> path = schemaPathMessage.getSchemaPath().getPathFromRoot();
+ out.writeInt(Iterables.size(path));
+ for (final QName qualifiedName : path) {
+ // FIXME: switch to QName.writeTo() or a sal-clustering-commons stream
out.writeObject(qualifiedName);
}
final int sizePath = in.readInt();
final QName[] paths = new QName[sizePath];
for (int i = 0; i < sizePath; i++) {
+ // FIXME: switch to QName.readFrom() or a sal-clustering-commons stream
paths[i] = (QName) in.readObject();
}
final boolean absolute = in.readBoolean();