/* * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! package com.examples.abelanav2.grpc; @SuppressWarnings("hiding") public final class Photo extends com.google.protobuf.nano.MessageNano { private static volatile Photo[] _emptyArray; public static Photo[] emptyArray() { // Lazily initializes the empty array if (_emptyArray == null) { synchronized ( com.google.protobuf.nano.InternalNano.LAZY_INIT_LOCK) { if (_emptyArray == null) { _emptyArray = new Photo[0]; } } } return _emptyArray; } // optional int64 photo_id = 1; public long photoId; // optional string user_id = 2; public java.lang.String userId; // optional int64 date = 3; public long date; // optional string description = 4; public java.lang.String description; // optional int64 rating = 5; public long rating; // optional string url = 6; public java.lang.String url; public Photo() { clear(); } public Photo clear() { photoId = 0L; userId = ""; date = 0L; description = ""; rating = 0L; url = ""; cachedSize = -1; return this; } @Override public void writeTo(com.google.protobuf.nano.CodedOutputByteBufferNano output) throws java.io.IOException { if (this.photoId != 0L) { output.writeInt64(1, this.photoId); } if (!this.userId.equals("")) { output.writeString(2, this.userId); } if (this.date != 0L) { output.writeInt64(3, this.date); } if (!this.description.equals("")) { output.writeString(4, this.description); } if (this.rating != 0L) { output.writeInt64(5, this.rating); } if (!this.url.equals("")) { output.writeString(6, this.url); } super.writeTo(output); } @Override protected int computeSerializedSize() { int size = super.computeSerializedSize(); if (this.photoId != 0L) { size += com.google.protobuf.nano.CodedOutputByteBufferNano .computeInt64Size(1, this.photoId); } if (!this.userId.equals("")) { size += com.google.protobuf.nano.CodedOutputByteBufferNano .computeStringSize(2, this.userId); } if (this.date != 0L) { size += com.google.protobuf.nano.CodedOutputByteBufferNano .computeInt64Size(3, this.date); } if (!this.description.equals("")) { size += com.google.protobuf.nano.CodedOutputByteBufferNano .computeStringSize(4, this.description); } if (this.rating != 0L) { size += com.google.protobuf.nano.CodedOutputByteBufferNano .computeInt64Size(5, this.rating); } if (!this.url.equals("")) { size += com.google.protobuf.nano.CodedOutputByteBufferNano .computeStringSize(6, this.url); } return size; } @Override public Photo mergeFrom( com.google.protobuf.nano.CodedInputByteBufferNano input) throws java.io.IOException { while (true) { int tag = input.readTag(); switch (tag) { case 0: return this; default: { if (!com.google.protobuf.nano.WireFormatNano.parseUnknownField(input, tag)) { return this; } break; } case 8: { this.photoId = input.readInt64(); break; } case 18: { this.userId = input.readString(); break; } case 24: { this.date = input.readInt64(); break; } case 34: { this.description = input.readString(); break; } case 40: { this.rating = input.readInt64(); break; } case 50: { this.url = input.readString(); break; } } } } public static Photo parseFrom(byte[] data) throws com.google.protobuf.nano.InvalidProtocolBufferNanoException { return com.google.protobuf.nano.MessageNano.mergeFrom(new Photo(), data); } public static Photo parseFrom( com.google.protobuf.nano.CodedInputByteBufferNano input) throws java.io.IOException { return new Photo().mergeFrom(input); } }