From 5abd23d3baf1f3c5be2b92c267df926c4bc46877 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Thu, 24 Nov 2011 10:54:01 +0900 Subject: [PATCH] Upgrade depepdencies to the latest versions * Regenerate LocalTimeProtocol.java with the latest protoc * Add an instruction on how to generate LocalTimeProtocol.java * Not upgrading maven-bundle-plugin, which has a regression in 2.3.5: * https://issues.apache.org/jira/browse/FELIX-3058 Conflicts: src/main/java/org/jboss/netty/example/localtime/LocalTimeProtocol.java --- pom.xml | 26 +- .../example/localtime/LocalTimeProtocol.java | 2071 +++++++++++------ .../example/localtime/LocalTimeProtocol.proto | 7 + 3 files changed, 1404 insertions(+), 700 deletions(-) diff --git a/pom.xml b/pom.xml index 0754080c99..435e023f97 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ com.google.protobuf protobuf-java - 2.3.0 + 2.4.1 compile true @@ -114,7 +114,7 @@ org.slf4j slf4j-api - 1.6.1 + 1.6.4 compile true @@ -168,13 +168,13 @@ org.easymock easymock - 2.5.2 + 3.1 test org.easymock easymockclassextension - 2.5.2 + 3.1 test @@ -186,7 +186,7 @@ org.slf4j slf4j-simple - 1.6.1 + 1.6.4 test @@ -211,7 +211,7 @@ maven-enforcer-plugin - 1.0 + 1.0.1 maven-compiler-plugin @@ -227,7 +227,7 @@ maven-resources-plugin - 2.4.3 + 2.5 UTF-8 @@ -258,7 +258,7 @@ maven-surefire-plugin - 2.7.2 + 2.10 once @@ -315,7 +315,7 @@ maven-antrun-plugin - 1.6 + 1.7 write-version @@ -420,7 +420,7 @@ maven-javadoc-plugin - 2.7 + 2.8 generate-javadoc @@ -479,7 +479,7 @@ maven-jxr-plugin - 2.2 + 2.3 generate-xref @@ -601,7 +601,7 @@ maven-assembly-plugin - 2.2 + 2.2.1 generate-distribution @@ -622,7 +622,7 @@ maven-release-plugin - 2.1 + 2.2.1 diff --git a/src/main/java/org/jboss/netty/example/localtime/LocalTimeProtocol.java b/src/main/java/org/jboss/netty/example/localtime/LocalTimeProtocol.java index 8628f34d64..2d894fe7e2 100644 --- a/src/main/java/org/jboss/netty/example/localtime/LocalTimeProtocol.java +++ b/src/main/java/org/jboss/netty/example/localtime/LocalTimeProtocol.java @@ -1,5 +1,5 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: LocalTimeProtocol.proto +// source: src/main/java/org/jboss/netty/example/localtime/LocalTimeProtocol.proto package org.jboss.netty.example.localtime; @@ -23,11 +23,22 @@ public final class LocalTimeProtocol { MIDEAST(9, 9), PACIFIC(10, 10), ; - - - @Override + + public static final int AFRICA_VALUE = 0; + public static final int AMERICA_VALUE = 1; + public static final int ANTARCTICA_VALUE = 2; + public static final int ARCTIC_VALUE = 3; + public static final int ASIA_VALUE = 4; + public static final int ATLANTIC_VALUE = 5; + public static final int AUSTRALIA_VALUE = 6; + public static final int EUROPE_VALUE = 7; + public static final int INDIAN_VALUE = 8; + public static final int MIDEAST_VALUE = 9; + public static final int PACIFIC_VALUE = 10; + + public final int getNumber() { return value; } - + public static Continent valueOf(int value) { switch (value) { case 0: return AFRICA; @@ -44,38 +55,36 @@ public final class LocalTimeProtocol { default: return null; } } - + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } - private static final com.google.protobuf.Internal.EnumLiteMap + private static com.google.protobuf.Internal.EnumLiteMap internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { - @Override public Continent findValueByNumber(int number) { - return Continent.valueOf(number) - ; } + return Continent.valueOf(number); + } }; - - @Override + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); } - @Override public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { return getDescriptor(); } - public static com.google.protobuf.Descriptors.EnumDescriptor + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return org.jboss.netty.example.localtime.LocalTimeProtocol.getDescriptor().getEnumTypes().get(0); } - + private static final Continent[] VALUES = { - AFRICA, AMERICA, ANTARCTICA, ARCTIC, ASIA, ATLANTIC, AUSTRALIA, EUROPE, INDIAN, MIDEAST, PACIFIC, + AFRICA, AMERICA, ANTARCTICA, ARCTIC, ASIA, ATLANTIC, AUSTRALIA, EUROPE, INDIAN, MIDEAST, PACIFIC, }; + public static Continent valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -84,20 +93,18 @@ public final class LocalTimeProtocol { } return VALUES[desc.getIndex()]; } + private final int index; private final int value; - Continent(int index, int value) { + + private Continent(int index, int value) { this.index = index; this.value = value; } - - static { - org.jboss.netty.example.localtime.LocalTimeProtocol.getDescriptor(); - } - + // @@protoc_insertion_point(enum_scope:org.jboss.netty.example.localtime.Continent) } - + public enum DayOfWeek implements com.google.protobuf.ProtocolMessageEnum { SUNDAY(0, 1), @@ -108,11 +115,18 @@ public final class LocalTimeProtocol { FRIDAY(5, 6), SATURDAY(6, 7), ; - - - @Override + + public static final int SUNDAY_VALUE = 1; + public static final int MONDAY_VALUE = 2; + public static final int TUESDAY_VALUE = 3; + public static final int WEDNESDAY_VALUE = 4; + public static final int THURSDAY_VALUE = 5; + public static final int FRIDAY_VALUE = 6; + public static final int SATURDAY_VALUE = 7; + + public final int getNumber() { return value; } - + public static DayOfWeek valueOf(int value) { switch (value) { case 1: return SUNDAY; @@ -125,38 +139,36 @@ public final class LocalTimeProtocol { default: return null; } } - + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } - private static final com.google.protobuf.Internal.EnumLiteMap + private static com.google.protobuf.Internal.EnumLiteMap internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { - @Override public DayOfWeek findValueByNumber(int number) { - return DayOfWeek.valueOf(number) - ; } + return DayOfWeek.valueOf(number); + } }; - - @Override + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); } - @Override public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { return getDescriptor(); } - public static com.google.protobuf.Descriptors.EnumDescriptor + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return org.jboss.netty.example.localtime.LocalTimeProtocol.getDescriptor().getEnumTypes().get(1); } - + private static final DayOfWeek[] VALUES = { - SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, + SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, }; + public static DayOfWeek valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -165,107 +177,159 @@ public final class LocalTimeProtocol { } return VALUES[desc.getIndex()]; } + private final int index; private final int value; - DayOfWeek(int index, int value) { + + private DayOfWeek(int index, int value) { this.index = index; this.value = value; } - - static { - org.jboss.netty.example.localtime.LocalTimeProtocol.getDescriptor(); - } - + // @@protoc_insertion_point(enum_scope:org.jboss.netty.example.localtime.DayOfWeek) } - + + public interface LocationOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required .org.jboss.netty.example.localtime.Continent continent = 1; + boolean hasContinent(); + org.jboss.netty.example.localtime.LocalTimeProtocol.Continent getContinent(); + + // required string city = 2; + boolean hasCity(); + String getCity(); + } public static final class Location extends - com.google.protobuf.GeneratedMessage { + com.google.protobuf.GeneratedMessage + implements LocationOrBuilder { // Use Location.newBuilder() to construct. - private Location() { - initFields(); + private Location(Builder builder) { + super(builder); } private Location(boolean noInit) {} - + private static final Location defaultInstance; public static Location getDefaultInstance() { return defaultInstance; } - - @Override + public Location getDefaultInstanceForType() { return defaultInstance; } - - public static com.google.protobuf.Descriptors.Descriptor + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_Location_descriptor; } - - @Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_Location_fieldAccessorTable; } - + + private int bitField0_; // required .org.jboss.netty.example.localtime.Continent continent = 1; public static final int CONTINENT_FIELD_NUMBER = 1; - private boolean hasContinent; private org.jboss.netty.example.localtime.LocalTimeProtocol.Continent continent_; - public boolean hasContinent() { return hasContinent; } - public org.jboss.netty.example.localtime.LocalTimeProtocol.Continent getContinent() { return continent_; } - + public boolean hasContinent() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public org.jboss.netty.example.localtime.LocalTimeProtocol.Continent getContinent() { + return continent_; + } + // required string city = 2; public static final int CITY_FIELD_NUMBER = 2; - private boolean hasCity; - private java.lang.String city_ = ""; - public boolean hasCity() { return hasCity; } - public java.lang.String getCity() { return city_; } - + private java.lang.Object city_; + public boolean hasCity() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public String getCity() { + java.lang.Object ref = city_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (com.google.protobuf.Internal.isValidUtf8(bs)) { + city_ = s; + } + return s; + } + } + private com.google.protobuf.ByteString getCityBytes() { + java.lang.Object ref = city_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((String) ref); + city_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private void initFields() { continent_ = org.jboss.netty.example.localtime.LocalTimeProtocol.Continent.AFRICA; + city_ = ""; } - - @Override - public boolean isInitialized() { - return hasContinent && hasCity; + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasContinent()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasCity()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; } - - @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (hasContinent()) { - output.writeEnum(1, getContinent().getNumber()); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeEnum(1, continent_.getNumber()); } - if (hasCity()) { - output.writeString(2, getCity()); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getCityBytes()); } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; - @Override public int getSerializedSize() { int size = memoizedSerializedSize; - if (size != -1) { - return size; - } - + if (size != -1) return size; + size = 0; - if (hasContinent()) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, getContinent().getNumber()); + .computeEnumSize(1, continent_.getNumber()); } - if (hasCity()) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeStringSize(2, getCity()); + .computeBytesSize(2, getCityBytes()); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; } - + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + public static org.jboss.netty.example.localtime.LocalTimeProtocol.Location parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -332,93 +396,107 @@ public final class LocalTimeProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } - @Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.jboss.netty.example.localtime.LocalTimeProtocol.Location prototype) { return newBuilder().mergeFrom(prototype); } - @Override public Builder toBuilder() { return newBuilder(this); } - + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder { - private org.jboss.netty.example.localtime.LocalTimeProtocol.Location result; - + com.google.protobuf.GeneratedMessage.Builder + implements org.jboss.netty.example.localtime.LocalTimeProtocol.LocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_Location_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_Location_fieldAccessorTable; + } + // Construct using org.jboss.netty.example.localtime.LocalTimeProtocol.Location.newBuilder() - private Builder() {} - - private static Builder create() { - Builder builder = new Builder(); - builder.result = new org.jboss.netty.example.localtime.LocalTimeProtocol.Location(); - return builder; + private Builder() { + maybeForceBuilderInitialization(); } - - @Override - protected org.jboss.netty.example.localtime.LocalTimeProtocol.Location internalGetResult() { - return result; + + private Builder(BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); } - - @Override - public Builder clear() { - if (result == null) { - throw new IllegalStateException( - "Cannot call clear() after build()."); + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { } - result = new org.jboss.netty.example.localtime.LocalTimeProtocol.Location(); + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + continent_ = org.jboss.netty.example.localtime.LocalTimeProtocol.Continent.AFRICA; + bitField0_ = (bitField0_ & ~0x00000001); + city_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); return this; } - - @Override + public Builder clone() { - return create().mergeFrom(result); + return create().mergeFrom(buildPartial()); } - - @Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.jboss.netty.example.localtime.LocalTimeProtocol.Location.getDescriptor(); } - - @Override + public org.jboss.netty.example.localtime.LocalTimeProtocol.Location getDefaultInstanceForType() { return org.jboss.netty.example.localtime.LocalTimeProtocol.Location.getDefaultInstance(); } - - @Override - public boolean isInitialized() { - return result.isInitialized(); - } - @Override + public org.jboss.netty.example.localtime.LocalTimeProtocol.Location build() { - if (result != null && !isInitialized()) { + org.jboss.netty.example.localtime.LocalTimeProtocol.Location result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException(result); } - return buildPartial(); + return result; } - + private org.jboss.netty.example.localtime.LocalTimeProtocol.Location buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { + org.jboss.netty.example.localtime.LocalTimeProtocol.Location result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException( result).asInvalidProtocolBufferException(); } - return buildPartial(); + return result; } - - @Override + public org.jboss.netty.example.localtime.LocalTimeProtocol.Location buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); + org.jboss.netty.example.localtime.LocalTimeProtocol.Location result = new org.jboss.netty.example.localtime.LocalTimeProtocol.Location(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; } - org.jboss.netty.example.localtime.LocalTimeProtocol.Location returnMe = result; - result = null; - return returnMe; + result.continent_ = continent_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.city_ = city_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; } - - @Override + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.jboss.netty.example.localtime.LocalTimeProtocol.Location) { return mergeFrom((org.jboss.netty.example.localtime.LocalTimeProtocol.Location)other); @@ -427,39 +505,50 @@ public final class LocalTimeProtocol { return this; } } - + public Builder mergeFrom(org.jboss.netty.example.localtime.LocalTimeProtocol.Location other) { - if (other == org.jboss.netty.example.localtime.LocalTimeProtocol.Location.getDefaultInstance()) { - return this; - } + if (other == org.jboss.netty.example.localtime.LocalTimeProtocol.Location.getDefaultInstance()) return this; if (other.hasContinent()) { setContinent(other.getContinent()); } if (other.hasCity()) { setCity(other.getCity()); } - mergeUnknownFields(other.getUnknownFields()); + this.mergeUnknownFields(other.getUnknownFields()); return this; } - - @Override + + public final boolean isInitialized() { + if (!hasContinent()) { + + return false; + } + if (!hasCity()) { + + return false; + } + return true; + } + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder( - getUnknownFields()); + this.getUnknownFields()); while (true) { int tag = input.readTag(); switch (tag) { case 0: - setUnknownFields(unknownFields.build()); + this.setUnknownFields(unknownFields.build()); + onChanged(); return this; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - setUnknownFields(unknownFields.build()); + this.setUnknownFields(unknownFields.build()); + onChanged(); return this; } break; @@ -470,154 +559,204 @@ public final class LocalTimeProtocol { if (value == null) { unknownFields.mergeVarintField(1, rawValue); } else { - setContinent(value); + bitField0_ |= 0x00000001; + continent_ = value; } break; } case 18: { - setCity(input.readString()); + bitField0_ |= 0x00000002; + city_ = input.readBytes(); break; } } } } - - + + private int bitField0_; + // required .org.jboss.netty.example.localtime.Continent continent = 1; + private org.jboss.netty.example.localtime.LocalTimeProtocol.Continent continent_ = org.jboss.netty.example.localtime.LocalTimeProtocol.Continent.AFRICA; public boolean hasContinent() { - return result.hasContinent(); + return ((bitField0_ & 0x00000001) == 0x00000001); } public org.jboss.netty.example.localtime.LocalTimeProtocol.Continent getContinent() { - return result.getContinent(); + return continent_; } public Builder setContinent(org.jboss.netty.example.localtime.LocalTimeProtocol.Continent value) { if (value == null) { throw new NullPointerException(); } - result.hasContinent = true; - result.continent_ = value; + bitField0_ |= 0x00000001; + continent_ = value; + onChanged(); return this; } public Builder clearContinent() { - result.hasContinent = false; - result.continent_ = org.jboss.netty.example.localtime.LocalTimeProtocol.Continent.AFRICA; + bitField0_ = (bitField0_ & ~0x00000001); + continent_ = org.jboss.netty.example.localtime.LocalTimeProtocol.Continent.AFRICA; + onChanged(); return this; } - + // required string city = 2; + private java.lang.Object city_ = ""; public boolean hasCity() { - return result.hasCity(); + return ((bitField0_ & 0x00000002) == 0x00000002); } - public java.lang.String getCity() { - return result.getCity(); + public String getCity() { + java.lang.Object ref = city_; + if (!(ref instanceof String)) { + String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); + city_ = s; + return s; + } else { + return (String) ref; + } } - public Builder setCity(java.lang.String value) { + public Builder setCity(String value) { if (value == null) { throw new NullPointerException(); } - result.hasCity = true; - result.city_ = value; + bitField0_ |= 0x00000002; + city_ = value; + onChanged(); return this; } public Builder clearCity() { - result.hasCity = false; - result.city_ = getDefaultInstance().getCity(); + bitField0_ = (bitField0_ & ~0x00000002); + city_ = getDefaultInstance().getCity(); + onChanged(); return this; } - + void setCity(com.google.protobuf.ByteString value) { + bitField0_ |= 0x00000002; + city_ = value; + onChanged(); + } + // @@protoc_insertion_point(builder_scope:org.jboss.netty.example.localtime.Location) } - + static { defaultInstance = new Location(true); - org.jboss.netty.example.localtime.LocalTimeProtocol.internalForceInit(); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:org.jboss.netty.example.localtime.Location) } - + + public interface LocationsOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // repeated .org.jboss.netty.example.localtime.Location location = 1; + java.util.List + getLocationList(); + org.jboss.netty.example.localtime.LocalTimeProtocol.Location getLocation(int index); + int getLocationCount(); + java.util.List + getLocationOrBuilderList(); + org.jboss.netty.example.localtime.LocalTimeProtocol.LocationOrBuilder getLocationOrBuilder( + int index); + } public static final class Locations extends - com.google.protobuf.GeneratedMessage { + com.google.protobuf.GeneratedMessage + implements LocationsOrBuilder { // Use Locations.newBuilder() to construct. - private Locations() { - initFields(); + private Locations(Builder builder) { + super(builder); } private Locations(boolean noInit) {} - + private static final Locations defaultInstance; public static Locations getDefaultInstance() { return defaultInstance; } - - @Override + public Locations getDefaultInstanceForType() { return defaultInstance; } - - public static com.google.protobuf.Descriptors.Descriptor + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_Locations_descriptor; } - - @Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_Locations_fieldAccessorTable; } - + // repeated .org.jboss.netty.example.localtime.Location location = 1; public static final int LOCATION_FIELD_NUMBER = 1; - private java.util.List location_ = - java.util.Collections.emptyList(); + private java.util.List location_; public java.util.List getLocationList() { return location_; } - public int getLocationCount() { return location_.size(); } + public java.util.List + getLocationOrBuilderList() { + return location_; + } + public int getLocationCount() { + return location_.size(); + } public org.jboss.netty.example.localtime.LocalTimeProtocol.Location getLocation(int index) { return location_.get(index); } - - private void initFields() { + public org.jboss.netty.example.localtime.LocalTimeProtocol.LocationOrBuilder getLocationOrBuilder( + int index) { + return location_.get(index); } - @Override - public boolean isInitialized() { - for (org.jboss.netty.example.localtime.LocalTimeProtocol.Location element : getLocationList()) { - if (!element.isInitialized()) { - return false; + + private void initFields() { + location_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + for (int i = 0; i < getLocationCount(); i++) { + if (!getLocation(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; } } + memoizedIsInitialized = 1; return true; } - - @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - for (org.jboss.netty.example.localtime.LocalTimeProtocol.Location element : getLocationList()) { - output.writeMessage(1, element); + for (int i = 0; i < location_.size(); i++) { + output.writeMessage(1, location_.get(i)); } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; - @Override public int getSerializedSize() { int size = memoizedSerializedSize; - if (size != -1) { - return size; - } - + if (size != -1) return size; + size = 0; - for (org.jboss.netty.example.localtime.LocalTimeProtocol.Location element : getLocationList()) { + for (int i = 0; i < location_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, element); + .computeMessageSize(1, location_.get(i)); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; } - + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + public static org.jboss.netty.example.localtime.LocalTimeProtocol.Locations parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -684,97 +823,109 @@ public final class LocalTimeProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } - @Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.jboss.netty.example.localtime.LocalTimeProtocol.Locations prototype) { return newBuilder().mergeFrom(prototype); } - @Override public Builder toBuilder() { return newBuilder(this); } - + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder { - private org.jboss.netty.example.localtime.LocalTimeProtocol.Locations result; - + com.google.protobuf.GeneratedMessage.Builder + implements org.jboss.netty.example.localtime.LocalTimeProtocol.LocationsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_Locations_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_Locations_fieldAccessorTable; + } + // Construct using org.jboss.netty.example.localtime.LocalTimeProtocol.Locations.newBuilder() - private Builder() {} - - private static Builder create() { - Builder builder = new Builder(); - builder.result = new org.jboss.netty.example.localtime.LocalTimeProtocol.Locations(); - return builder; + private Builder() { + maybeForceBuilderInitialization(); } - - @Override - protected org.jboss.netty.example.localtime.LocalTimeProtocol.Locations internalGetResult() { - return result; + + private Builder(BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); } - - @Override - public Builder clear() { - if (result == null) { - throw new IllegalStateException( - "Cannot call clear() after build()."); + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getLocationFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + if (locationBuilder_ == null) { + location_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + locationBuilder_.clear(); } - result = new org.jboss.netty.example.localtime.LocalTimeProtocol.Locations(); return this; } - - @Override + public Builder clone() { - return create().mergeFrom(result); + return create().mergeFrom(buildPartial()); } - - @Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.jboss.netty.example.localtime.LocalTimeProtocol.Locations.getDescriptor(); } - - @Override + public org.jboss.netty.example.localtime.LocalTimeProtocol.Locations getDefaultInstanceForType() { return org.jboss.netty.example.localtime.LocalTimeProtocol.Locations.getDefaultInstance(); } - - @Override - public boolean isInitialized() { - return result.isInitialized(); - } - @Override + public org.jboss.netty.example.localtime.LocalTimeProtocol.Locations build() { - if (result != null && !isInitialized()) { + org.jboss.netty.example.localtime.LocalTimeProtocol.Locations result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException(result); } - return buildPartial(); + return result; } - + private org.jboss.netty.example.localtime.LocalTimeProtocol.Locations buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { + org.jboss.netty.example.localtime.LocalTimeProtocol.Locations result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException( result).asInvalidProtocolBufferException(); } - return buildPartial(); + return result; } - - @Override + public org.jboss.netty.example.localtime.LocalTimeProtocol.Locations buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); + org.jboss.netty.example.localtime.LocalTimeProtocol.Locations result = new org.jboss.netty.example.localtime.LocalTimeProtocol.Locations(this); + int from_bitField0_ = bitField0_; + if (locationBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + location_ = java.util.Collections.unmodifiableList(location_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.location_ = location_; + } else { + result.location_ = locationBuilder_.build(); } - if (result.location_ != java.util.Collections.EMPTY_LIST) { - result.location_ = - java.util.Collections.unmodifiableList(result.location_); - } - org.jboss.netty.example.localtime.LocalTimeProtocol.Locations returnMe = result; - result = null; - return returnMe; + onBuilt(); + return result; } - - @Override + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.jboss.netty.example.localtime.LocalTimeProtocol.Locations) { return mergeFrom((org.jboss.netty.example.localtime.LocalTimeProtocol.Locations)other); @@ -783,39 +934,68 @@ public final class LocalTimeProtocol { return this; } } - + public Builder mergeFrom(org.jboss.netty.example.localtime.LocalTimeProtocol.Locations other) { - if (other == org.jboss.netty.example.localtime.LocalTimeProtocol.Locations.getDefaultInstance()) { - return this; - } - if (!other.location_.isEmpty()) { - if (result.location_.isEmpty()) { - result.location_ = new java.util.ArrayList(); + if (other == org.jboss.netty.example.localtime.LocalTimeProtocol.Locations.getDefaultInstance()) return this; + if (locationBuilder_ == null) { + if (!other.location_.isEmpty()) { + if (location_.isEmpty()) { + location_ = other.location_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLocationIsMutable(); + location_.addAll(other.location_); + } + onChanged(); + } + } else { + if (!other.location_.isEmpty()) { + if (locationBuilder_.isEmpty()) { + locationBuilder_.dispose(); + locationBuilder_ = null; + location_ = other.location_; + bitField0_ = (bitField0_ & ~0x00000001); + locationBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getLocationFieldBuilder() : null; + } else { + locationBuilder_.addAllMessages(other.location_); + } } - result.location_.addAll(other.location_); } - mergeUnknownFields(other.getUnknownFields()); + this.mergeUnknownFields(other.getUnknownFields()); return this; } - - @Override + + public final boolean isInitialized() { + for (int i = 0; i < getLocationCount(); i++) { + if (!getLocation(i).isInitialized()) { + + return false; + } + } + return true; + } + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder( - getUnknownFields()); + this.getUnknownFields()); while (true) { int tag = input.readTag(); switch (tag) { case 0: - setUnknownFields(unknownFields.build()); + this.setUnknownFields(unknownFields.build()); + onChanged(); return this; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - setUnknownFields(unknownFields.build()); + this.setUnknownFields(unknownFields.build()); + onChanged(); return this; } break; @@ -829,245 +1009,455 @@ public final class LocalTimeProtocol { } } } - - + + private int bitField0_; + // repeated .org.jboss.netty.example.localtime.Location location = 1; + private java.util.List location_ = + java.util.Collections.emptyList(); + private void ensureLocationIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + location_ = new java.util.ArrayList(location_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.jboss.netty.example.localtime.LocalTimeProtocol.Location, org.jboss.netty.example.localtime.LocalTimeProtocol.Location.Builder, org.jboss.netty.example.localtime.LocalTimeProtocol.LocationOrBuilder> locationBuilder_; + public java.util.List getLocationList() { - return java.util.Collections.unmodifiableList(result.location_); + if (locationBuilder_ == null) { + return java.util.Collections.unmodifiableList(location_); + } else { + return locationBuilder_.getMessageList(); + } } public int getLocationCount() { - return result.getLocationCount(); + if (locationBuilder_ == null) { + return location_.size(); + } else { + return locationBuilder_.getCount(); + } } public org.jboss.netty.example.localtime.LocalTimeProtocol.Location getLocation(int index) { - return result.getLocation(index); - } - public Builder setLocation(int index, org.jboss.netty.example.localtime.LocalTimeProtocol.Location value) { - if (value == null) { - throw new NullPointerException(); + if (locationBuilder_ == null) { + return location_.get(index); + } else { + return locationBuilder_.getMessage(index); + } + } + public Builder setLocation( + int index, org.jboss.netty.example.localtime.LocalTimeProtocol.Location value) { + if (locationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationIsMutable(); + location_.set(index, value); + onChanged(); + } else { + locationBuilder_.setMessage(index, value); } - result.location_.set(index, value); return this; } - public Builder setLocation(int index, org.jboss.netty.example.localtime.LocalTimeProtocol.Location.Builder builderForValue) { - result.location_.set(index, builderForValue.build()); + public Builder setLocation( + int index, org.jboss.netty.example.localtime.LocalTimeProtocol.Location.Builder builderForValue) { + if (locationBuilder_ == null) { + ensureLocationIsMutable(); + location_.set(index, builderForValue.build()); + onChanged(); + } else { + locationBuilder_.setMessage(index, builderForValue.build()); + } return this; } public Builder addLocation(org.jboss.netty.example.localtime.LocalTimeProtocol.Location value) { - if (value == null) { - throw new NullPointerException(); + if (locationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationIsMutable(); + location_.add(value); + onChanged(); + } else { + locationBuilder_.addMessage(value); } - if (result.location_.isEmpty()) { - result.location_ = new java.util.ArrayList(); - } - result.location_.add(value); return this; } - public Builder addLocation(org.jboss.netty.example.localtime.LocalTimeProtocol.Location.Builder builderForValue) { - if (result.location_.isEmpty()) { - result.location_ = new java.util.ArrayList(); + public Builder addLocation( + int index, org.jboss.netty.example.localtime.LocalTimeProtocol.Location value) { + if (locationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationIsMutable(); + location_.add(index, value); + onChanged(); + } else { + locationBuilder_.addMessage(index, value); + } + return this; + } + public Builder addLocation( + org.jboss.netty.example.localtime.LocalTimeProtocol.Location.Builder builderForValue) { + if (locationBuilder_ == null) { + ensureLocationIsMutable(); + location_.add(builderForValue.build()); + onChanged(); + } else { + locationBuilder_.addMessage(builderForValue.build()); + } + return this; + } + public Builder addLocation( + int index, org.jboss.netty.example.localtime.LocalTimeProtocol.Location.Builder builderForValue) { + if (locationBuilder_ == null) { + ensureLocationIsMutable(); + location_.add(index, builderForValue.build()); + onChanged(); + } else { + locationBuilder_.addMessage(index, builderForValue.build()); } - result.location_.add(builderForValue.build()); return this; } public Builder addAllLocation( java.lang.Iterable values) { - if (result.location_.isEmpty()) { - result.location_ = new java.util.ArrayList(); + if (locationBuilder_ == null) { + ensureLocationIsMutable(); + super.addAll(values, location_); + onChanged(); + } else { + locationBuilder_.addAllMessages(values); } - super.addAll(values, result.location_); return this; } public Builder clearLocation() { - result.location_ = java.util.Collections.emptyList(); + if (locationBuilder_ == null) { + location_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + locationBuilder_.clear(); + } return this; } - + public Builder removeLocation(int index) { + if (locationBuilder_ == null) { + ensureLocationIsMutable(); + location_.remove(index); + onChanged(); + } else { + locationBuilder_.remove(index); + } + return this; + } + public org.jboss.netty.example.localtime.LocalTimeProtocol.Location.Builder getLocationBuilder( + int index) { + return getLocationFieldBuilder().getBuilder(index); + } + public org.jboss.netty.example.localtime.LocalTimeProtocol.LocationOrBuilder getLocationOrBuilder( + int index) { + if (locationBuilder_ == null) { + return location_.get(index); } else { + return locationBuilder_.getMessageOrBuilder(index); + } + } + public java.util.List + getLocationOrBuilderList() { + if (locationBuilder_ != null) { + return locationBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(location_); + } + } + public org.jboss.netty.example.localtime.LocalTimeProtocol.Location.Builder addLocationBuilder() { + return getLocationFieldBuilder().addBuilder( + org.jboss.netty.example.localtime.LocalTimeProtocol.Location.getDefaultInstance()); + } + public org.jboss.netty.example.localtime.LocalTimeProtocol.Location.Builder addLocationBuilder( + int index) { + return getLocationFieldBuilder().addBuilder( + index, org.jboss.netty.example.localtime.LocalTimeProtocol.Location.getDefaultInstance()); + } + public java.util.List + getLocationBuilderList() { + return getLocationFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.jboss.netty.example.localtime.LocalTimeProtocol.Location, org.jboss.netty.example.localtime.LocalTimeProtocol.Location.Builder, org.jboss.netty.example.localtime.LocalTimeProtocol.LocationOrBuilder> + getLocationFieldBuilder() { + if (locationBuilder_ == null) { + locationBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.jboss.netty.example.localtime.LocalTimeProtocol.Location, org.jboss.netty.example.localtime.LocalTimeProtocol.Location.Builder, org.jboss.netty.example.localtime.LocalTimeProtocol.LocationOrBuilder>( + location_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + location_ = null; + } + return locationBuilder_; + } + // @@protoc_insertion_point(builder_scope:org.jboss.netty.example.localtime.Locations) } - + static { defaultInstance = new Locations(true); - org.jboss.netty.example.localtime.LocalTimeProtocol.internalForceInit(); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:org.jboss.netty.example.localtime.Locations) } - + + public interface LocalTimeOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required uint32 year = 1; + boolean hasYear(); + int getYear(); + + // required uint32 month = 2; + boolean hasMonth(); + int getMonth(); + + // required uint32 dayOfMonth = 4; + boolean hasDayOfMonth(); + int getDayOfMonth(); + + // required .org.jboss.netty.example.localtime.DayOfWeek dayOfWeek = 5; + boolean hasDayOfWeek(); + org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek getDayOfWeek(); + + // required uint32 hour = 6; + boolean hasHour(); + int getHour(); + + // required uint32 minute = 7; + boolean hasMinute(); + int getMinute(); + + // required uint32 second = 8; + boolean hasSecond(); + int getSecond(); + } public static final class LocalTime extends - com.google.protobuf.GeneratedMessage { + com.google.protobuf.GeneratedMessage + implements LocalTimeOrBuilder { // Use LocalTime.newBuilder() to construct. - private LocalTime() { - initFields(); + private LocalTime(Builder builder) { + super(builder); } private LocalTime(boolean noInit) {} - + private static final LocalTime defaultInstance; public static LocalTime getDefaultInstance() { return defaultInstance; } - - @Override + public LocalTime getDefaultInstanceForType() { return defaultInstance; } - - public static com.google.protobuf.Descriptors.Descriptor + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_LocalTime_descriptor; } - - @Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_LocalTime_fieldAccessorTable; } - + + private int bitField0_; // required uint32 year = 1; public static final int YEAR_FIELD_NUMBER = 1; - private boolean hasYear; - private int year_ = 0; - public boolean hasYear() { return hasYear; } - public int getYear() { return year_; } - + private int year_; + public boolean hasYear() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public int getYear() { + return year_; + } + // required uint32 month = 2; public static final int MONTH_FIELD_NUMBER = 2; - private boolean hasMonth; - private int month_ = 0; - public boolean hasMonth() { return hasMonth; } - public int getMonth() { return month_; } - + private int month_; + public boolean hasMonth() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public int getMonth() { + return month_; + } + // required uint32 dayOfMonth = 4; public static final int DAYOFMONTH_FIELD_NUMBER = 4; - private boolean hasDayOfMonth; - private int dayOfMonth_ = 0; - public boolean hasDayOfMonth() { return hasDayOfMonth; } - public int getDayOfMonth() { return dayOfMonth_; } - + private int dayOfMonth_; + public boolean hasDayOfMonth() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + public int getDayOfMonth() { + return dayOfMonth_; + } + // required .org.jboss.netty.example.localtime.DayOfWeek dayOfWeek = 5; public static final int DAYOFWEEK_FIELD_NUMBER = 5; - private boolean hasDayOfWeek; private org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek dayOfWeek_; - public boolean hasDayOfWeek() { return hasDayOfWeek; } - public org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek getDayOfWeek() { return dayOfWeek_; } - + public boolean hasDayOfWeek() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + public org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek getDayOfWeek() { + return dayOfWeek_; + } + // required uint32 hour = 6; public static final int HOUR_FIELD_NUMBER = 6; - private boolean hasHour; - private int hour_ = 0; - public boolean hasHour() { return hasHour; } - public int getHour() { return hour_; } - + private int hour_; + public boolean hasHour() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + public int getHour() { + return hour_; + } + // required uint32 minute = 7; public static final int MINUTE_FIELD_NUMBER = 7; - private boolean hasMinute; - private int minute_ = 0; - public boolean hasMinute() { return hasMinute; } - public int getMinute() { return minute_; } - + private int minute_; + public boolean hasMinute() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + public int getMinute() { + return minute_; + } + // required uint32 second = 8; public static final int SECOND_FIELD_NUMBER = 8; - private boolean hasSecond; - private int second_ = 0; - public boolean hasSecond() { return hasSecond; } - public int getSecond() { return second_; } - + private int second_; + public boolean hasSecond() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + public int getSecond() { + return second_; + } + private void initFields() { + year_ = 0; + month_ = 0; + dayOfMonth_ = 0; dayOfWeek_ = org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek.SUNDAY; + hour_ = 0; + minute_ = 0; + second_ = 0; } - @Override - public boolean isInitialized() { - if (!hasYear) { + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasYear()) { + memoizedIsInitialized = 0; return false; - } - if (!hasMonth) { + } + if (!hasMonth()) { + memoizedIsInitialized = 0; return false; - } - if (!hasDayOfMonth) { + } + if (!hasDayOfMonth()) { + memoizedIsInitialized = 0; return false; - } - if (!hasDayOfWeek) { + } + if (!hasDayOfWeek()) { + memoizedIsInitialized = 0; return false; - } - if (!hasHour) { + } + if (!hasHour()) { + memoizedIsInitialized = 0; return false; - } - if (!hasMinute) { + } + if (!hasMinute()) { + memoizedIsInitialized = 0; return false; + } + if (!hasSecond()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; } - return hasSecond; - } - - @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (hasYear()) { - output.writeUInt32(1, getYear()); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeUInt32(1, year_); } - if (hasMonth()) { - output.writeUInt32(2, getMonth()); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeUInt32(2, month_); } - if (hasDayOfMonth()) { - output.writeUInt32(4, getDayOfMonth()); + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeUInt32(4, dayOfMonth_); } - if (hasDayOfWeek()) { - output.writeEnum(5, getDayOfWeek().getNumber()); + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeEnum(5, dayOfWeek_.getNumber()); } - if (hasHour()) { - output.writeUInt32(6, getHour()); + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeUInt32(6, hour_); } - if (hasMinute()) { - output.writeUInt32(7, getMinute()); + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeUInt32(7, minute_); } - if (hasSecond()) { - output.writeUInt32(8, getSecond()); + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeUInt32(8, second_); } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; - @Override public int getSerializedSize() { int size = memoizedSerializedSize; - if (size != -1) { - return size; - } - + if (size != -1) return size; + size = 0; - if (hasYear()) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, getYear()); + .computeUInt32Size(1, year_); } - if (hasMonth()) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(2, getMonth()); + .computeUInt32Size(2, month_); } - if (hasDayOfMonth()) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(4, getDayOfMonth()); + .computeUInt32Size(4, dayOfMonth_); } - if (hasDayOfWeek()) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(5, getDayOfWeek().getNumber()); + .computeEnumSize(5, dayOfWeek_.getNumber()); } - if (hasHour()) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(6, getHour()); + .computeUInt32Size(6, hour_); } - if (hasMinute()) { + if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(7, getMinute()); + .computeUInt32Size(7, minute_); } - if (hasSecond()) { + if (((bitField0_ & 0x00000040) == 0x00000040)) { size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(8, getSecond()); + .computeUInt32Size(8, second_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; } - + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + public static org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -1134,93 +1524,137 @@ public final class LocalTimeProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } - @Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime prototype) { return newBuilder().mergeFrom(prototype); } - @Override public Builder toBuilder() { return newBuilder(this); } - + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder { - private org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime result; - + com.google.protobuf.GeneratedMessage.Builder + implements org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_LocalTime_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_LocalTime_fieldAccessorTable; + } + // Construct using org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.newBuilder() - private Builder() {} - - private static Builder create() { - Builder builder = new Builder(); - builder.result = new org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime(); - return builder; + private Builder() { + maybeForceBuilderInitialization(); } - - @Override - protected org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime internalGetResult() { - return result; + + private Builder(BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); } - - @Override - public Builder clear() { - if (result == null) { - throw new IllegalStateException( - "Cannot call clear() after build()."); + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { } - result = new org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime(); + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + year_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + month_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + dayOfMonth_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + dayOfWeek_ = org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek.SUNDAY; + bitField0_ = (bitField0_ & ~0x00000008); + hour_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + minute_ = 0; + bitField0_ = (bitField0_ & ~0x00000020); + second_ = 0; + bitField0_ = (bitField0_ & ~0x00000040); return this; } - - @Override + public Builder clone() { - return create().mergeFrom(result); + return create().mergeFrom(buildPartial()); } - - @Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.getDescriptor(); } - - @Override + public org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime getDefaultInstanceForType() { return org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.getDefaultInstance(); } - - @Override - public boolean isInitialized() { - return result.isInitialized(); - } - @Override + public org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime build() { - if (result != null && !isInitialized()) { + org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException(result); } - return buildPartial(); + return result; } - + private org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { + org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException( result).asInvalidProtocolBufferException(); } - return buildPartial(); + return result; } - - @Override + public org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); + org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime result = new org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; } - org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime returnMe = result; - result = null; - return returnMe; + result.year_ = year_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.month_ = month_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.dayOfMonth_ = dayOfMonth_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.dayOfWeek_ = dayOfWeek_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.hour_ = hour_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.minute_ = minute_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.second_ = second_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; } - - @Override + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime) { return mergeFrom((org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime)other); @@ -1229,11 +1663,9 @@ public final class LocalTimeProtocol { return this; } } - + public Builder mergeFrom(org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime other) { - if (other == org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.getDefaultInstance()) { - return this; - } + if (other == org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.getDefaultInstance()) return this; if (other.hasYear()) { setYear(other.getYear()); } @@ -1255,42 +1687,78 @@ public final class LocalTimeProtocol { if (other.hasSecond()) { setSecond(other.getSecond()); } - mergeUnknownFields(other.getUnknownFields()); + this.mergeUnknownFields(other.getUnknownFields()); return this; } - - @Override + + public final boolean isInitialized() { + if (!hasYear()) { + + return false; + } + if (!hasMonth()) { + + return false; + } + if (!hasDayOfMonth()) { + + return false; + } + if (!hasDayOfWeek()) { + + return false; + } + if (!hasHour()) { + + return false; + } + if (!hasMinute()) { + + return false; + } + if (!hasSecond()) { + + return false; + } + return true; + } + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder( - getUnknownFields()); + this.getUnknownFields()); while (true) { int tag = input.readTag(); switch (tag) { case 0: - setUnknownFields(unknownFields.build()); + this.setUnknownFields(unknownFields.build()); + onChanged(); return this; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - setUnknownFields(unknownFields.build()); + this.setUnknownFields(unknownFields.build()); + onChanged(); return this; } break; } case 8: { - setYear(input.readUInt32()); + bitField0_ |= 0x00000001; + year_ = input.readUInt32(); break; } case 16: { - setMonth(input.readUInt32()); + bitField0_ |= 0x00000002; + month_ = input.readUInt32(); break; } case 32: { - setDayOfMonth(input.readUInt32()); + bitField0_ |= 0x00000004; + dayOfMonth_ = input.readUInt32(); break; } case 40: { @@ -1299,249 +1767,304 @@ public final class LocalTimeProtocol { if (value == null) { unknownFields.mergeVarintField(5, rawValue); } else { - setDayOfWeek(value); + bitField0_ |= 0x00000008; + dayOfWeek_ = value; } break; } case 48: { - setHour(input.readUInt32()); + bitField0_ |= 0x00000010; + hour_ = input.readUInt32(); break; } case 56: { - setMinute(input.readUInt32()); + bitField0_ |= 0x00000020; + minute_ = input.readUInt32(); break; } case 64: { - setSecond(input.readUInt32()); + bitField0_ |= 0x00000040; + second_ = input.readUInt32(); break; } } } } - - + + private int bitField0_; + // required uint32 year = 1; + private int year_ ; public boolean hasYear() { - return result.hasYear(); + return ((bitField0_ & 0x00000001) == 0x00000001); } public int getYear() { - return result.getYear(); + return year_; } public Builder setYear(int value) { - result.hasYear = true; - result.year_ = value; + bitField0_ |= 0x00000001; + year_ = value; + onChanged(); return this; } public Builder clearYear() { - result.hasYear = false; - result.year_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + year_ = 0; + onChanged(); return this; } - + // required uint32 month = 2; + private int month_ ; public boolean hasMonth() { - return result.hasMonth(); + return ((bitField0_ & 0x00000002) == 0x00000002); } public int getMonth() { - return result.getMonth(); + return month_; } public Builder setMonth(int value) { - result.hasMonth = true; - result.month_ = value; + bitField0_ |= 0x00000002; + month_ = value; + onChanged(); return this; } public Builder clearMonth() { - result.hasMonth = false; - result.month_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + month_ = 0; + onChanged(); return this; } - + // required uint32 dayOfMonth = 4; + private int dayOfMonth_ ; public boolean hasDayOfMonth() { - return result.hasDayOfMonth(); + return ((bitField0_ & 0x00000004) == 0x00000004); } public int getDayOfMonth() { - return result.getDayOfMonth(); + return dayOfMonth_; } public Builder setDayOfMonth(int value) { - result.hasDayOfMonth = true; - result.dayOfMonth_ = value; + bitField0_ |= 0x00000004; + dayOfMonth_ = value; + onChanged(); return this; } public Builder clearDayOfMonth() { - result.hasDayOfMonth = false; - result.dayOfMonth_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + dayOfMonth_ = 0; + onChanged(); return this; } - + // required .org.jboss.netty.example.localtime.DayOfWeek dayOfWeek = 5; + private org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek dayOfWeek_ = org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek.SUNDAY; public boolean hasDayOfWeek() { - return result.hasDayOfWeek(); + return ((bitField0_ & 0x00000008) == 0x00000008); } public org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek getDayOfWeek() { - return result.getDayOfWeek(); + return dayOfWeek_; } public Builder setDayOfWeek(org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek value) { if (value == null) { throw new NullPointerException(); } - result.hasDayOfWeek = true; - result.dayOfWeek_ = value; + bitField0_ |= 0x00000008; + dayOfWeek_ = value; + onChanged(); return this; } public Builder clearDayOfWeek() { - result.hasDayOfWeek = false; - result.dayOfWeek_ = org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek.SUNDAY; + bitField0_ = (bitField0_ & ~0x00000008); + dayOfWeek_ = org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek.SUNDAY; + onChanged(); return this; } - + // required uint32 hour = 6; + private int hour_ ; public boolean hasHour() { - return result.hasHour(); + return ((bitField0_ & 0x00000010) == 0x00000010); } public int getHour() { - return result.getHour(); + return hour_; } public Builder setHour(int value) { - result.hasHour = true; - result.hour_ = value; + bitField0_ |= 0x00000010; + hour_ = value; + onChanged(); return this; } public Builder clearHour() { - result.hasHour = false; - result.hour_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + hour_ = 0; + onChanged(); return this; } - + // required uint32 minute = 7; + private int minute_ ; public boolean hasMinute() { - return result.hasMinute(); + return ((bitField0_ & 0x00000020) == 0x00000020); } public int getMinute() { - return result.getMinute(); + return minute_; } public Builder setMinute(int value) { - result.hasMinute = true; - result.minute_ = value; + bitField0_ |= 0x00000020; + minute_ = value; + onChanged(); return this; } public Builder clearMinute() { - result.hasMinute = false; - result.minute_ = 0; + bitField0_ = (bitField0_ & ~0x00000020); + minute_ = 0; + onChanged(); return this; } - + // required uint32 second = 8; + private int second_ ; public boolean hasSecond() { - return result.hasSecond(); + return ((bitField0_ & 0x00000040) == 0x00000040); } public int getSecond() { - return result.getSecond(); + return second_; } public Builder setSecond(int value) { - result.hasSecond = true; - result.second_ = value; + bitField0_ |= 0x00000040; + second_ = value; + onChanged(); return this; } public Builder clearSecond() { - result.hasSecond = false; - result.second_ = 0; + bitField0_ = (bitField0_ & ~0x00000040); + second_ = 0; + onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:org.jboss.netty.example.localtime.LocalTime) } - + static { defaultInstance = new LocalTime(true); - org.jboss.netty.example.localtime.LocalTimeProtocol.internalForceInit(); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:org.jboss.netty.example.localtime.LocalTime) } - + + public interface LocalTimesOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // repeated .org.jboss.netty.example.localtime.LocalTime localTime = 1; + java.util.List + getLocalTimeList(); + org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime getLocalTime(int index); + int getLocalTimeCount(); + java.util.List + getLocalTimeOrBuilderList(); + org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimeOrBuilder getLocalTimeOrBuilder( + int index); + } public static final class LocalTimes extends - com.google.protobuf.GeneratedMessage { + com.google.protobuf.GeneratedMessage + implements LocalTimesOrBuilder { // Use LocalTimes.newBuilder() to construct. - private LocalTimes() { - initFields(); + private LocalTimes(Builder builder) { + super(builder); } private LocalTimes(boolean noInit) {} - + private static final LocalTimes defaultInstance; public static LocalTimes getDefaultInstance() { return defaultInstance; } - - @Override + public LocalTimes getDefaultInstanceForType() { return defaultInstance; } - - public static com.google.protobuf.Descriptors.Descriptor + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_LocalTimes_descriptor; } - - @Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_LocalTimes_fieldAccessorTable; } - + // repeated .org.jboss.netty.example.localtime.LocalTime localTime = 1; public static final int LOCALTIME_FIELD_NUMBER = 1; - private java.util.List localTime_ = - java.util.Collections.emptyList(); + private java.util.List localTime_; public java.util.List getLocalTimeList() { return localTime_; } - public int getLocalTimeCount() { return localTime_.size(); } + public java.util.List + getLocalTimeOrBuilderList() { + return localTime_; + } + public int getLocalTimeCount() { + return localTime_.size(); + } public org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime getLocalTime(int index) { return localTime_.get(index); } - - private void initFields() { + public org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimeOrBuilder getLocalTimeOrBuilder( + int index) { + return localTime_.get(index); } - @Override - public boolean isInitialized() { - for (org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime element : getLocalTimeList()) { - if (!element.isInitialized()) { - return false; + + private void initFields() { + localTime_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + for (int i = 0; i < getLocalTimeCount(); i++) { + if (!getLocalTime(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; } } + memoizedIsInitialized = 1; return true; } - - @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - for (org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime element : getLocalTimeList()) { - output.writeMessage(1, element); + for (int i = 0; i < localTime_.size(); i++) { + output.writeMessage(1, localTime_.get(i)); } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; - @Override public int getSerializedSize() { int size = memoizedSerializedSize; - if (size != -1) { - return size; - } - + if (size != -1) return size; + size = 0; - for (org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime element : getLocalTimeList()) { + for (int i = 0; i < localTime_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, element); + .computeMessageSize(1, localTime_.get(i)); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; } - + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + public static org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -1608,97 +2131,109 @@ public final class LocalTimeProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } - @Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes prototype) { return newBuilder().mergeFrom(prototype); } - @Override public Builder toBuilder() { return newBuilder(this); } - + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder { - private org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes result; - + com.google.protobuf.GeneratedMessage.Builder + implements org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_LocalTimes_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.jboss.netty.example.localtime.LocalTimeProtocol.internal_static_org_jboss_netty_example_localtime_LocalTimes_fieldAccessorTable; + } + // Construct using org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes.newBuilder() - private Builder() {} - - private static Builder create() { - Builder builder = new Builder(); - builder.result = new org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes(); - return builder; + private Builder() { + maybeForceBuilderInitialization(); } - - @Override - protected org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes internalGetResult() { - return result; + + private Builder(BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); } - - @Override - public Builder clear() { - if (result == null) { - throw new IllegalStateException( - "Cannot call clear() after build()."); + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getLocalTimeFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + if (localTimeBuilder_ == null) { + localTime_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + localTimeBuilder_.clear(); } - result = new org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes(); return this; } - - @Override + public Builder clone() { - return create().mergeFrom(result); + return create().mergeFrom(buildPartial()); } - - @Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes.getDescriptor(); } - - @Override + public org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes getDefaultInstanceForType() { return org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes.getDefaultInstance(); } - - @Override - public boolean isInitialized() { - return result.isInitialized(); - } - @Override + public org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes build() { - if (result != null && !isInitialized()) { + org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException(result); } - return buildPartial(); + return result; } - + private org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { + org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes result = buildPartial(); + if (!result.isInitialized()) { throw newUninitializedMessageException( result).asInvalidProtocolBufferException(); } - return buildPartial(); + return result; } - - @Override + public org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); + org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes result = new org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes(this); + int from_bitField0_ = bitField0_; + if (localTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + localTime_ = java.util.Collections.unmodifiableList(localTime_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.localTime_ = localTime_; + } else { + result.localTime_ = localTimeBuilder_.build(); } - if (result.localTime_ != java.util.Collections.EMPTY_LIST) { - result.localTime_ = - java.util.Collections.unmodifiableList(result.localTime_); - } - org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes returnMe = result; - result = null; - return returnMe; + onBuilt(); + return result; } - - @Override + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes) { return mergeFrom((org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes)other); @@ -1707,39 +2242,68 @@ public final class LocalTimeProtocol { return this; } } - + public Builder mergeFrom(org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes other) { - if (other == org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes.getDefaultInstance()) { - return this; - } - if (!other.localTime_.isEmpty()) { - if (result.localTime_.isEmpty()) { - result.localTime_ = new java.util.ArrayList(); + if (other == org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes.getDefaultInstance()) return this; + if (localTimeBuilder_ == null) { + if (!other.localTime_.isEmpty()) { + if (localTime_.isEmpty()) { + localTime_ = other.localTime_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLocalTimeIsMutable(); + localTime_.addAll(other.localTime_); + } + onChanged(); + } + } else { + if (!other.localTime_.isEmpty()) { + if (localTimeBuilder_.isEmpty()) { + localTimeBuilder_.dispose(); + localTimeBuilder_ = null; + localTime_ = other.localTime_; + bitField0_ = (bitField0_ & ~0x00000001); + localTimeBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getLocalTimeFieldBuilder() : null; + } else { + localTimeBuilder_.addAllMessages(other.localTime_); + } } - result.localTime_.addAll(other.localTime_); } - mergeUnknownFields(other.getUnknownFields()); + this.mergeUnknownFields(other.getUnknownFields()); return this; } - - @Override + + public final boolean isInitialized() { + for (int i = 0; i < getLocalTimeCount(); i++) { + if (!getLocalTime(i).isInitialized()) { + + return false; + } + } + return true; + } + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder( - getUnknownFields()); + this.getUnknownFields()); while (true) { int tag = input.readTag(); switch (tag) { case 0: - setUnknownFields(unknownFields.build()); + this.setUnknownFields(unknownFields.build()); + onChanged(); return this; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - setUnknownFields(unknownFields.build()); + this.setUnknownFields(unknownFields.build()); + onChanged(); return this; } break; @@ -1753,71 +2317,206 @@ public final class LocalTimeProtocol { } } } - - + + private int bitField0_; + // repeated .org.jboss.netty.example.localtime.LocalTime localTime = 1; + private java.util.List localTime_ = + java.util.Collections.emptyList(); + private void ensureLocalTimeIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + localTime_ = new java.util.ArrayList(localTime_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime, org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.Builder, org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimeOrBuilder> localTimeBuilder_; + public java.util.List getLocalTimeList() { - return java.util.Collections.unmodifiableList(result.localTime_); + if (localTimeBuilder_ == null) { + return java.util.Collections.unmodifiableList(localTime_); + } else { + return localTimeBuilder_.getMessageList(); + } } public int getLocalTimeCount() { - return result.getLocalTimeCount(); + if (localTimeBuilder_ == null) { + return localTime_.size(); + } else { + return localTimeBuilder_.getCount(); + } } public org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime getLocalTime(int index) { - return result.getLocalTime(index); - } - public Builder setLocalTime(int index, org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime value) { - if (value == null) { - throw new NullPointerException(); + if (localTimeBuilder_ == null) { + return localTime_.get(index); + } else { + return localTimeBuilder_.getMessage(index); + } + } + public Builder setLocalTime( + int index, org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime value) { + if (localTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocalTimeIsMutable(); + localTime_.set(index, value); + onChanged(); + } else { + localTimeBuilder_.setMessage(index, value); } - result.localTime_.set(index, value); return this; } - public Builder setLocalTime(int index, org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.Builder builderForValue) { - result.localTime_.set(index, builderForValue.build()); + public Builder setLocalTime( + int index, org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.Builder builderForValue) { + if (localTimeBuilder_ == null) { + ensureLocalTimeIsMutable(); + localTime_.set(index, builderForValue.build()); + onChanged(); + } else { + localTimeBuilder_.setMessage(index, builderForValue.build()); + } return this; } public Builder addLocalTime(org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime value) { - if (value == null) { - throw new NullPointerException(); + if (localTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocalTimeIsMutable(); + localTime_.add(value); + onChanged(); + } else { + localTimeBuilder_.addMessage(value); } - if (result.localTime_.isEmpty()) { - result.localTime_ = new java.util.ArrayList(); - } - result.localTime_.add(value); return this; } - public Builder addLocalTime(org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.Builder builderForValue) { - if (result.localTime_.isEmpty()) { - result.localTime_ = new java.util.ArrayList(); + public Builder addLocalTime( + int index, org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime value) { + if (localTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocalTimeIsMutable(); + localTime_.add(index, value); + onChanged(); + } else { + localTimeBuilder_.addMessage(index, value); + } + return this; + } + public Builder addLocalTime( + org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.Builder builderForValue) { + if (localTimeBuilder_ == null) { + ensureLocalTimeIsMutable(); + localTime_.add(builderForValue.build()); + onChanged(); + } else { + localTimeBuilder_.addMessage(builderForValue.build()); + } + return this; + } + public Builder addLocalTime( + int index, org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.Builder builderForValue) { + if (localTimeBuilder_ == null) { + ensureLocalTimeIsMutable(); + localTime_.add(index, builderForValue.build()); + onChanged(); + } else { + localTimeBuilder_.addMessage(index, builderForValue.build()); } - result.localTime_.add(builderForValue.build()); return this; } public Builder addAllLocalTime( java.lang.Iterable values) { - if (result.localTime_.isEmpty()) { - result.localTime_ = new java.util.ArrayList(); + if (localTimeBuilder_ == null) { + ensureLocalTimeIsMutable(); + super.addAll(values, localTime_); + onChanged(); + } else { + localTimeBuilder_.addAllMessages(values); } - super.addAll(values, result.localTime_); return this; } public Builder clearLocalTime() { - result.localTime_ = java.util.Collections.emptyList(); + if (localTimeBuilder_ == null) { + localTime_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + localTimeBuilder_.clear(); + } return this; } - + public Builder removeLocalTime(int index) { + if (localTimeBuilder_ == null) { + ensureLocalTimeIsMutable(); + localTime_.remove(index); + onChanged(); + } else { + localTimeBuilder_.remove(index); + } + return this; + } + public org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.Builder getLocalTimeBuilder( + int index) { + return getLocalTimeFieldBuilder().getBuilder(index); + } + public org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimeOrBuilder getLocalTimeOrBuilder( + int index) { + if (localTimeBuilder_ == null) { + return localTime_.get(index); } else { + return localTimeBuilder_.getMessageOrBuilder(index); + } + } + public java.util.List + getLocalTimeOrBuilderList() { + if (localTimeBuilder_ != null) { + return localTimeBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(localTime_); + } + } + public org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.Builder addLocalTimeBuilder() { + return getLocalTimeFieldBuilder().addBuilder( + org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.getDefaultInstance()); + } + public org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.Builder addLocalTimeBuilder( + int index) { + return getLocalTimeFieldBuilder().addBuilder( + index, org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.getDefaultInstance()); + } + public java.util.List + getLocalTimeBuilderList() { + return getLocalTimeFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime, org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.Builder, org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimeOrBuilder> + getLocalTimeFieldBuilder() { + if (localTimeBuilder_ == null) { + localTimeBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime, org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.Builder, org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimeOrBuilder>( + localTime_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + localTime_ = null; + } + return localTimeBuilder_; + } + // @@protoc_insertion_point(builder_scope:org.jboss.netty.example.localtime.LocalTimes) } - + static { defaultInstance = new LocalTimes(true); - org.jboss.netty.example.localtime.LocalTimeProtocol.internalForceInit(); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:org.jboss.netty.example.localtime.LocalTimes) } - + private static com.google.protobuf.Descriptors.Descriptor internal_static_org_jboss_netty_example_localtime_Location_descriptor; private static @@ -1838,7 +2537,7 @@ public final class LocalTimeProtocol { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_org_jboss_netty_example_localtime_LocalTimes_fieldAccessorTable; - + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -1847,29 +2546,29 @@ public final class LocalTimeProtocol { descriptor; static { java.lang.String[] descriptorData = { - "\n\027LocalTimeProtocol.proto\022!org.jboss.net" + - "ty.example.localtime\"Y\n\010Location\022?\n\tcont" + - "inent\030\001 \002(\0162,.org.jboss.netty.example.lo" + - "caltime.Continent\022\014\n\004city\030\002 \002(\t\"J\n\tLocat" + - "ions\022=\n\010location\030\001 \003(\0132+.org.jboss.netty" + - ".example.localtime.Location\"\253\001\n\tLocalTim" + - "e\022\014\n\004year\030\001 \002(\r\022\r\n\005month\030\002 \002(\r\022\022\n\ndayOfM" + - "onth\030\004 \002(\r\022?\n\tdayOfWeek\030\005 \002(\0162,.org.jbos" + - "s.netty.example.localtime.DayOfWeek\022\014\n\004h" + - "our\030\006 \002(\r\022\016\n\006minute\030\007 \002(\r\022\016\n\006second\030\010 \002(", - "\r\"M\n\nLocalTimes\022?\n\tlocalTime\030\001 \003(\0132,.org" + - ".jboss.netty.example.localtime.LocalTime" + - "*\231\001\n\tContinent\022\n\n\006AFRICA\020\000\022\013\n\007AMERICA\020\001\022" + - "\016\n\nANTARCTICA\020\002\022\n\n\006ARCTIC\020\003\022\010\n\004ASIA\020\004\022\014\n" + - "\010ATLANTIC\020\005\022\r\n\tAUSTRALIA\020\006\022\n\n\006EUROPE\020\007\022\n" + - "\n\006INDIAN\020\010\022\013\n\007MIDEAST\020\t\022\013\n\007PACIFIC\020\n*g\n\t" + - "DayOfWeek\022\n\n\006SUNDAY\020\001\022\n\n\006MONDAY\020\002\022\013\n\007TUE" + - "SDAY\020\003\022\r\n\tWEDNESDAY\020\004\022\014\n\010THURSDAY\020\005\022\n\n\006F" + - "RIDAY\020\006\022\014\n\010SATURDAY\020\007B\002H\001" + "\nGsrc/main/java/org/jboss/netty/example/" + + "localtime/LocalTimeProtocol.proto\022!org.j" + + "boss.netty.example.localtime\"Y\n\010Location" + + "\022?\n\tcontinent\030\001 \002(\0162,.org.jboss.netty.ex" + + "ample.localtime.Continent\022\014\n\004city\030\002 \002(\t\"" + + "J\n\tLocations\022=\n\010location\030\001 \003(\0132+.org.jbo" + + "ss.netty.example.localtime.Location\"\253\001\n\t" + + "LocalTime\022\014\n\004year\030\001 \002(\r\022\r\n\005month\030\002 \002(\r\022\022" + + "\n\ndayOfMonth\030\004 \002(\r\022?\n\tdayOfWeek\030\005 \002(\0162,." + + "org.jboss.netty.example.localtime.DayOfW", + "eek\022\014\n\004hour\030\006 \002(\r\022\016\n\006minute\030\007 \002(\r\022\016\n\006sec" + + "ond\030\010 \002(\r\"M\n\nLocalTimes\022?\n\tlocalTime\030\001 \003" + + "(\0132,.org.jboss.netty.example.localtime.L" + + "ocalTime*\231\001\n\tContinent\022\n\n\006AFRICA\020\000\022\013\n\007AM" + + "ERICA\020\001\022\016\n\nANTARCTICA\020\002\022\n\n\006ARCTIC\020\003\022\010\n\004A" + + "SIA\020\004\022\014\n\010ATLANTIC\020\005\022\r\n\tAUSTRALIA\020\006\022\n\n\006EU" + + "ROPE\020\007\022\n\n\006INDIAN\020\010\022\013\n\007MIDEAST\020\t\022\013\n\007PACIF" + + "IC\020\n*g\n\tDayOfWeek\022\n\n\006SUNDAY\020\001\022\n\n\006MONDAY\020" + + "\002\022\013\n\007TUESDAY\020\003\022\r\n\tWEDNESDAY\020\004\022\014\n\010THURSDA" + + "Y\020\005\022\n\n\006FRIDAY\020\006\022\014\n\010SATURDAY\020\007B\002H\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - @Override public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.Descriptors.FileDescriptor root) { descriptor = root; @@ -1913,8 +2612,6 @@ public final class LocalTimeProtocol { new com.google.protobuf.Descriptors.FileDescriptor[] { }, assigner); } - - public static void internalForceInit() {} - + // @@protoc_insertion_point(outer_class_scope) } diff --git a/src/main/java/org/jboss/netty/example/localtime/LocalTimeProtocol.proto b/src/main/java/org/jboss/netty/example/localtime/LocalTimeProtocol.proto index 197275adee..6dcec2faee 100644 --- a/src/main/java/org/jboss/netty/example/localtime/LocalTimeProtocol.proto +++ b/src/main/java/org/jboss/netty/example/localtime/LocalTimeProtocol.proto @@ -15,6 +15,13 @@ */ package org.jboss.netty.example.localtime; +// How to generate +// =============== +// $ protoc src/main/java/org/jboss/netty/example/localtime/LocalTimeProtocol.proto \ +// --java_out=src/main/java +// +// Add @SuppressWarnings("all") to the generated code not to pollute IDE task list. + option optimize_for = SPEED; enum Continent {