X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-protocolbuffer-encoding%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fprotobuff%2Fmessages%2Fpersistent%2FPersistentMessages.java;h=6c1e2722f65cfb69ba10a73683456d67ea012a78;hb=516a4b2ea78179c9bd6ebb584862e8fc686ebf08;hp=efe159626fe91edcbab32ec5db2b947d87941bcd;hpb=de3e413b633b7555ae8f3fe2ec163dbb7dda5da8;p=controller.git diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/persistent/PersistentMessages.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/persistent/PersistentMessages.java index efe159626f..6c1e2722f6 100644 --- a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/persistent/PersistentMessages.java +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/persistent/PersistentMessages.java @@ -26,20 +26,19 @@ public final class PersistentMessages { com.google.protobuf.ByteString getTypeBytes(); - // required string path = 2; + // required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2; /** - * required string path = 2; + * required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2; */ boolean hasPath(); /** - * required string path = 2; + * required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2; */ - java.lang.String getPath(); + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getPath(); /** - * required string path = 2; + * required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2; */ - com.google.protobuf.ByteString - getPathBytes(); + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getPathOrBuilder(); // optional .org.opendaylight.controller.mdsal.Node data = 3; /** @@ -112,8 +111,16 @@ public final class PersistentMessages { break; } case 18: { + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = path_.toBuilder(); + } + path_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(path_); + path_ = subBuilder.buildPartial(); + } bitField0_ |= 0x00000002; - path_ = input.readBytes(); break; } case 26: { @@ -212,47 +219,26 @@ public final class PersistentMessages { } } - // required string path = 2; + // required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2; public static final int PATH_FIELD_NUMBER = 2; - private java.lang.Object path_; + private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier path_; /** - * required string path = 2; + * required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2; */ public boolean hasPath() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * required string path = 2; + * required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2; */ - public java.lang.String getPath() { - java.lang.Object ref = path_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - path_ = s; - } - return s; - } + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getPath() { + return path_; } /** - * required string path = 2; + * required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2; */ - public com.google.protobuf.ByteString - getPathBytes() { - java.lang.Object ref = path_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - path_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getPathOrBuilder() { + return path_; } // optional .org.opendaylight.controller.mdsal.Node data = 3; @@ -279,7 +265,7 @@ public final class PersistentMessages { private void initFields() { type_ = ""; - path_ = ""; + path_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance(); data_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance(); } private byte memoizedIsInitialized = -1; @@ -295,6 +281,10 @@ public final class PersistentMessages { memoizedIsInitialized = 0; return false; } + if (!getPath().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } if (hasData()) { if (!getData().isInitialized()) { memoizedIsInitialized = 0; @@ -312,7 +302,7 @@ public final class PersistentMessages { output.writeBytes(1, getTypeBytes()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getPathBytes()); + output.writeMessage(2, path_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeMessage(3, data_); @@ -332,7 +322,7 @@ public final class PersistentMessages { } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getPathBytes()); + .computeMessageSize(2, path_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream @@ -446,6 +436,7 @@ public final class PersistentMessages { } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getPathFieldBuilder(); getDataFieldBuilder(); } } @@ -457,7 +448,11 @@ public final class PersistentMessages { super.clear(); type_ = ""; bitField0_ = (bitField0_ & ~0x00000001); - path_ = ""; + if (pathBuilder_ == null) { + path_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance(); + } else { + pathBuilder_.clear(); + } bitField0_ = (bitField0_ & ~0x00000002); if (dataBuilder_ == null) { data_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance(); @@ -500,7 +495,11 @@ public final class PersistentMessages { if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } - result.path_ = path_; + if (pathBuilder_ == null) { + result.path_ = path_; + } else { + result.path_ = pathBuilder_.build(); + } if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } @@ -531,9 +530,7 @@ public final class PersistentMessages { onChanged(); } if (other.hasPath()) { - bitField0_ |= 0x00000002; - path_ = other.path_; - onChanged(); + mergePath(other.getPath()); } if (other.hasData()) { mergeData(other.getData()); @@ -551,6 +548,10 @@ public final class PersistentMessages { return false; } + if (!getPath().isInitialized()) { + + return false; + } if (hasData()) { if (!getData().isInitialized()) { @@ -653,78 +654,121 @@ public final class PersistentMessages { return this; } - // required string path = 2; - private java.lang.Object path_ = ""; + // required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2; + private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier path_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> pathBuilder_; /** - * required string path = 2; + * required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2; */ public boolean hasPath() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * required string path = 2; + * required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2; */ - public java.lang.String getPath() { - java.lang.Object ref = path_; - if (!(ref instanceof java.lang.String)) { - java.lang.String s = ((com.google.protobuf.ByteString) ref) - .toStringUtf8(); - path_ = s; - return s; + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getPath() { + if (pathBuilder_ == null) { + return path_; } else { - return (java.lang.String) ref; + return pathBuilder_.getMessage(); } } /** - * required string path = 2; + * required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2; */ - public com.google.protobuf.ByteString - getPathBytes() { - java.lang.Object ref = path_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - path_ = b; - return b; + public Builder setPath(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) { + if (pathBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + path_ = value; + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + pathBuilder_.setMessage(value); } + bitField0_ |= 0x00000002; + return this; } /** - * required string path = 2; + * required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2; */ public Builder setPath( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - path_ = value; - onChanged(); + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder builderForValue) { + if (pathBuilder_ == null) { + path_ = builderForValue.build(); + onChanged(); + } else { + pathBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; return this; } /** - * required string path = 2; + * required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2; + */ + public Builder mergePath(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) { + if (pathBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + path_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance()) { + path_ = + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.newBuilder(path_).mergeFrom(value).buildPartial(); + } else { + path_ = value; + } + onChanged(); + } else { + pathBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2; */ public Builder clearPath() { + if (pathBuilder_ == null) { + path_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance(); + onChanged(); + } else { + pathBuilder_.clear(); + } bitField0_ = (bitField0_ & ~0x00000002); - path_ = getDefaultInstance().getPath(); - onChanged(); return this; } /** - * required string path = 2; + * required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2; */ - public Builder setPathBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - path_ = value; + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder getPathBuilder() { + bitField0_ |= 0x00000002; onChanged(); - return this; + return getPathFieldBuilder().getBuilder(); + } + /** + * required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getPathOrBuilder() { + if (pathBuilder_ != null) { + return pathBuilder_.getMessageOrBuilder(); + } else { + return path_; + } + } + /** + * required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> + getPathFieldBuilder() { + if (pathBuilder_ == null) { + pathBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>( + path_, + getParentForChildren(), + isClean()); + path_ = null; + } + return pathBuilder_; } // optional .org.opendaylight.controller.mdsal.Node data = 3; @@ -1561,14 +1605,15 @@ public final class PersistentMessages { static { java.lang.String[] descriptorData = { "\n\020Persistent.proto\022!org.opendaylight.con" + - "troller.mdsal\032\014Common.proto\"a\n\014Modificat" + - "ion\022\014\n\004type\030\001 \002(\t\022\014\n\004path\030\002 \002(\t\0225\n\004data\030" + - "\003 \001(\0132\'.org.opendaylight.controller.mdsa" + - "l.Node\"^\n\025CompositeModification\022E\n\014modif" + - "ication\030\001 \003(\0132/.org.opendaylight.control" + - "ler.mdsal.ModificationBO\n9org.opendaylig" + - "ht.controller.protobuff.messages.persist" + - "entB\022PersistentMessages" + "troller.mdsal\032\014Common.proto\"\230\001\n\014Modifica" + + "tion\022\014\n\004type\030\001 \002(\t\022C\n\004path\030\002 \002(\01325.org.o" + + "pendaylight.controller.mdsal.InstanceIde" + + "ntifier\0225\n\004data\030\003 \001(\0132\'.org.opendaylight" + + ".controller.mdsal.Node\"^\n\025CompositeModif" + + "ication\022E\n\014modification\030\001 \003(\0132/.org.open" + + "daylight.controller.mdsal.ModificationBO" + + "\n9org.opendaylight.controller.protobuff." + + "messages.persistentB\022PersistentMessages" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {