#protocolbuffer
Explore tagged Tumblr posts
govindhtech · 7 months ago
Text
CloudFront Now Supports gRPC Calls For Your Applications
Tumblr media
Your applications’ gRPC calls are now accepted by Amazon CloudFront.
You may now set up global content delivery network (CDN), Amazon CloudFront, in front of your gRPC API endpoints.
An Overview of gRPC
You may construct distributed apps and services more easily with gRPC since a client program can call a method on a server application on a separate machine as if it were a local object. The foundation of gRPC, like that of many RPC systems, is the concept of establishing a service, including the methods that may be called remotely along with their parameters and return types. This interface is implemented by the server, which also uses a gRPC server to manage client requests. The same methods as the server are provided by the client’s stub, which is sometimes referred to as just a client.
Any of the supported languages can be used to write gRPC clients and servers, which can operate and communicate with one another in a range of settings, including your desktop computer and servers within Google. For instance, a gRPC server in Java with clients in Go, Python, or Ruby can be readily created. Furthermore, the most recent Google APIs will include gRPC interfaces, making it simple to incorporate Google functionality into your apps.
Using Protocol Buffers
Although it can be used with other data formats like JSON, gRPC by default serializes structured data using Protocol Buffers, Google’s well-established open source method.
Establishing the structure for the data you wish to serialize in a proto file a regular text file with a.proto extension is the first step in dealing with protocol buffers. Protocol buffer data is organized as messages, each of which is a brief logical record of data made up of a number of fields, or name-value pairs.
After defining your data structures, you can use the protocol buffer compiler protoc to create data access classes from your proto specification in the language or languages of your choice. These offer methods to serialize and parse the entire structure to and from raw bytes, along with basic accessors for each field, such as name() and set_name(). For example, executing the compiler on the aforementioned example will produce a class named Person if you have selected C++ as your language. This class can then be used to serialize, retrieve, and populate Person protocol buffer messages in your application.
You specify RPC method parameters and return types as protocol buffer messages when defining gRPC services in standard proto files:
Protoc is used by gRPC with a specific gRPC plugin to generate code from your proto file. This includes the standard protocol buffer code for populating, serializing, and retrieving your message types, as well as generated gRPC client and server code.
Versions of protocol buffers
Although open source users have had access to protocol buffers for a while, the majority of the examples on this website use protocol buffers version 3 (proto3), which supports more languages, has a little simplified syntax, and several helpful new capabilities. In addition to a Go language generator from the golang/protobuf official package, Proto3 is presently available in Java, C++, Dart, Python, Objective-C, C#, a lite-runtime (Android Java), Ruby, and JavaScript from the protocol buffers GitHub repository. Additional languages are being developed.
Although proto2 (the current default protocol buffers version) can be used, it advises using proto3 with gRPC instead because it allows you to use all of the languages that gRPC supports and prevents incompatibilities between proto2 clients and proto3 servers.
What is gRPC?
A contemporary, open-source, high-performance Remote Procedure Call (RPC) framework that works in any setting is called gRPC. By supporting pluggable load balancing, tracing, health checking, and authentication, it may effectively connect services both within and between data centers. It can also be used to link devices, browsers, and mobile apps to backend services in the last mile of distributed computing.
A basic definition of a service
Describe your service using Protocol Buffers, a robust language and toolkit for binary serialization.
Launch swiftly and grow
Use the framework to grow to millions of RPCs per second and install the runtime and development environments with only one line.
Works on a variety of platforms and languages
For your service, automatically create idiomatic client and server stubs in several languages and platforms.
Both-way streaming and integrated authentication
Fully integrated pluggable authentication and bi-directional streaming with HTTP/2-based transport
For creating APIs, gRPC is a cutting-edge, effective, and language-neutral framework. Platform-independent service and message type design is made possible by its interface defining language (IDL), Protocol Buffers (protobuf). With gRPC, remote procedure calls (RPCs) over HTTP/2 are lightweight and highly performant, facilitating communication between services. Microservices designs benefit greatly from this since it facilitates effective and low-latency communication between services.
Features like flow control, bidirectional streaming, and automatic code generation for multiple programming languages are all provided by gRPC. When you need real-time data streaming, effective communication, and great performance, this is a good fit. gRPC may be an excellent option if your application must manage a lot of data or the client and server must communicate with low latency. However, compared to REST, it could be harder to master. Developers must specify their data structures and service methods in.proto files since gRPC uses the protobuf serialization standard.
When you put CloudFront in front of your gRPC API endpoints, we see two advantages.
Initially, it permits the decrease of latency between your API implementation and the client application. A global network of more than 600 edge locations is provided by CloudFront, with intelligent routing to the nearest edge. TLS termination and optional caching for your static content are offered by edge locations. Client application requests are sent to your gRPC origin by CloudFront via the fully managed, high-bandwidth, low-latency private AWS network.
Second, your apps gain from extra security services that are set up on edge locations, like traffic encryption, AWS Web Application Firewall’s HTTP header validation, and AWS Shield Standard defense against distributed denial of service (DDoS) assaults.
Cost and Accessibility
All of the more than 600 CloudFront edge locations offer gRPC origins at no extra cost. There are the standard requests and data transfer costs.
Read more on govindhtech.com
0 notes
hackernewsrobot · 1 year ago
Text
Demystifying the protobuf wire format
https://kreya.app/blog/protocolbuffers-wire-format/
0 notes
indra0237-blog · 7 years ago
Link
0 notes
reddypidugu · 5 years ago
Photo
Tumblr media
A Simple gRPC- Java API Implentation Example : https://youtu.be/TR-otP45eYU #grpc #Microservices #protocolbuffers #techtter (at SanFrancisco) https://www.instagram.com/p/CBQ7AFzHdZ6/?igshid=yvxriyh6xysl
0 notes
worrdev · 5 years ago
Text
It’s been awhile y’all
It's been a hot minute since I've documented some of my work, so I guess in keeping with making a main blog post, I'll make a devblog post today too.
cfn-mode / flycheck-cfn
https://gitlab.com/worr/cfn-mode/
I've been an emacs user for some time, and at my current job, I've been hurting for good support for cloudformation templates in my editor. I wrote this mode and flychecker to at least add some basic syntax highlighting and linter support. I'm currently in the process of getting them added to MELPA.
imdb-api
I made a bunch of changes fairly recently to imdb-api, most notably adding front-end support, migrating to Gitlab and migrating to ky after node-requests was deprecated. Normally I'd link patches, but there are too many since my last update. Here's the changelog: https://gitlab.com/worr/node-imdb-api/-/blob/master/CHANGELOG.md
fluent-bit
At work, we discovered an issue where our fluent-bits were sticky to the same instance of fluentd if we turned on keepalive and used a load-balancer.
To mitigate this, I ended up adding a new option to fluent-bit that will recycle keepalive connections after sending a number of messages, to cycle between backend instances periodically.
https://github.com/fluent/fluent-bit/commit/44190c2a1c4b939dc9ecb2908148d38c82a40831
https://github.com/fluent/fluent-bit-docs/commit/8d43b502123e366a1722a0051918ce7d78a8506b
fluentd-s3-plugin
Also at work, we found a case where the fluend plugin for s3 would spend forever trying to upload logs. By default, the naming scheme for the log chunks would be something like <time_slice>_<idx>. The time slice is the time when the log was uploaded, and the idx value is a monotonically increasing integer.
The problem, is that if you have mutliple threads uploading (or multiple fluentd's, or both), they have to check the presence of the filename to ensure that the formulated filename doesn't exist. Additionally, it doesn't track the last-used index, so when doing this check, fluentd will start at 1, check, increment, check again, increment again, etc. This obviously doesn't scale very well when you are outputing a ton of logs.
We fixed this my changing our file format to include a uuid and disabling the behavior to check for collisions.
However, since the defaults are dangerous, I've submitted this PR to try and make things less dangerous for new users (not accepted yet at the time of this writing).
https://github.com/fluent/fluent-plugin-s3/pull/355/files
This works by tracking the last used index in an atomic that's shared between threads. As outlined in the PR, it doesn't solve the whole problem, but it does make the defaults considerably safer.
logging-operator
Perhaps you've noticed a theme with my recent, work-driven contributions. :)
logging-operator is a kubernetes operator to automate adminitration of logging infrastructure in a kubernetes cluster. I've been contributing a bit to it lately, since we adopted it fairly early, and have needed to add a few features to make it work for us.
This first diff adds support not just for the configurable I added to fluent-bit that I mentioned earlier, but exposes all net parameters as configurables.
https://github.com/banzaicloud/logging-operator/commit/3c9e3938590209716918bc7cc197b43b09bb4361
There was a string conversion bug in how the operator would report on prometheus configuration.
https://github.com/banzaicloud/logging-operator/commit/86503b52150cf0dcf62d4b636eb247d0807101e7
We needed to configure where in s3 fluentd was uploading these logs
https://github.com/banzaicloud/logging-operator/commit/29fccfc2b8cee6c38c88fb34cf73a112eeb534de
We also needed way more support for configuring certain scheduling attributes in fluentd and fluentbit
https://github.com/banzaicloud/logging-operator/commit/45dffe5ebb38a3dbba4ecb217235f45c13f7856e
https://github.com/banzaicloud/logging-operator/commit/961fd788bb90f8f46d188a731aac0a916b30f933
https://github.com/banzaicloud/logging-operator/commit/0ec91f72831e1e63bd560224450454b33084553d
I also had to expose a number of these features in their helm charts
https://github.com/banzaicloud/logging-operator/commit/efc74711c5336063a6da72bf39239c57c81c7dff
https://github.com/banzaicloud/logging-operator/commit/f581da2e9daadae9b786362f69d379f8151ad918
https://github.com/banzaicloud/logging-operator/commit/4e74e36dfe7d63212b19401fe645a198734da1fd
wsh
Someone reached out to me privately to report several Solaris 11 compatibility bugs with wsh, my multi-host ssh tool.
Use -std=c11 flag with SunStudio: https://github.com/worr/wsh/commit/b11d2668ef6b85913d1901cfbfe6eb612be69bdc
Don't use __attribute__ with SunStudio, since none of the ones I used were supported: https://github.com/worr/wsh/commit/25ed3fc6fa36a1202e33c8fb36893d03cd5bce8c
Don't unconditionally compile in memset_s (Found because Solaris actually has a libc with this function): https://github.com/worr/wsh/commit/3876745a5cc4bce80d5e9fff0ab70b2dc429287f
This also led to a protobuf PR for better SunStudio support, which it looks like I need to follow up on.
https://github.com/protocolbuffers/protobuf/pull/7049/files
python-fido2
Last post, I mentioned I was working on getting my yubikey to work on OpenBSD. Part of that included adding support in ykman, which also required changes in python-fido2.
First, I added general OpenBSD support
https://github.com/Yubico/python-fido2/pull/82/files
This impl is arguably a bit brittle, since I essentially had to build the device probing for it in scratch from python, using the primitives from libusbhid to probe every uhid(4) device to see if it was a yubikey.
However, some time later, fido(4) was rolled into OpenBSD meaning that this code could be greatly simplified. I think someone reached out to me about this directly? I don't really remember, since it was awhile ago.
https://github.com/Yubico/python-fido2/pull/87/files
What a year
That's basically been the last year or so for me. Honestly, it's been a weird one, and I haven't been able to really do as much OSS as I've wanted to. A lot of it has been through work, which while nice, doesn't touch the types of projects that I want to be doing.
I am working on a gemini server on OpenBSD, which has been feeling quite rewarding, and I have other projects kicking around in my head that I'm going to be following up on.
0 notes
akubi0w1 · 5 years ago
Text
gRPCとは
gRPCってつまり何?
gRPCってつまり何?ってなったので、公式のドキュメントを訳しつつ学んでみた。ほぼ訳のログみたいなもの。
そもRPCとはなにか。
遠隔手続呼出(Remote Procedure call)の略。 あるソフトウェアがネットワークとか通信回線を使って、別のマシンのソフトウェアに処理を依���すること。
gRPCとは。
モダンなRPCのフレームワークで、以下な特徴があったりする。
サービスの定義がシンプル
ProtocolBuffersを使ってサービスを定義する
サクっと始められてスケールができる
言語とかプラットフォームをまたげる
双方向のストリーミングと認証の統一化
ProtocolBuffersっていうのは、言語とかプラットフォームに依存しないデータ構造のこと。 gRPCでは、IDL(Interface Definition Language)としても、基盤メッセージの構造としても、ProtocolBuffersを使用する。
overview
gRPCでは、クライアントアプリは異なるマシンに乗ったサーバアプリケーションのメソッドを直で呼ぶことができて、サービスとかアプリケーションを作ることを簡単にしてくれている。 多くのRPCシステムのように、gRPCはサービス定義っていう考え方に基づいていて、リモートで呼び出される、パラメータとか返り値を持ったメソッドが明確に指定してある。 サーバサイドではインタフェースを実装し、gRPCサーバは、クライアントの呼び出しをよしなに取り扱ってくれる。 クライアントサイドではスタブを持ち、スタブはサーバと同じメソッドを提供する。
クライアントはスタブを経由して、gRPCサーバにリクエストを送る。 サーバはそれをよしなに処理して、gRPCサーバからクライアントのスタブにレスポンスする。
gRPCのクライアントとサーバは、お互いが様々な環境で対話したり実行したりできるし、gRPCのサポートしている様々な言語で書くことができる。
Protocol Buffersで動く
gRPCはデフォルトでProtocolBuffersを使う。シリアライズしたデータ構造で、JSONなどの他フォーマットとして使うこともできるよ。
はじめに、ProtoFileっていう.proto拡張子のファイルで、シリアライズしたいデータの構造を定義する。 ProtocolBuffersのデータはmessageとして構造化される。 messageは、フィールドって呼ばれているname-valueの一連のペアを含むレコード(logical record)。
以下な感じで書かれる。
message Person { string name = 1; int32 id = 2; bool has_ponycopter = 3; }
データ構造を定義したら、protocol buffer compilerのprotocを使って、protoの定義から好きな言語でアクセスクラスのデータを作る(set_name()とか、name()とか)。こいつらは、それぞれのフィールドに対する、単純なアクセスのためのメソッドで、全ての構造体について、生のバイトにシリアライズしたり、バイトから構造体にパースしたりしてくれる。
次に、gRPCサービスをprotoFileに定義する。RPCメソッドを使ってサービスを定義していく。引数や戻り値には、ProtocolBufferのmessageを使う。 以下な感じで。
// The greeter service definition. service Greeter { // Sends a greeting rpc SayHello (HelloRequest) returns (HelloReply) {} } // The request message containing the user's name. message HelloRequest { string name = 1; } // The response message containing the greetings message HelloReply { string message = 1; }
gRPCはprotocで、protoFileからコードを生成する。そこから、gRPCのクライアントとサーバの、作成済みのコードを得ることができる。
まとめ
gRPCがやってくれることは
クライアントとサーバで共通に使えるインタフェースを定義すること
リクエストやレスポンスの構造を定義すること
実装は、それぞれの言語とかプラットフォームで自由にできる。
定義は.protoファイルで行う。
リクエスト、レスポンスのデータ構造は、messageで定義
提供するサービスはserviceとして定義
メソッドはrpcを使って定義する
参考
https://grpc.io/docs/guides/
0 notes
phungthaihy · 5 years ago
Photo
Tumblr media
Intro to gRPC in C# - How To Get Started, http://ehelpdesk.tk/wp-content/uploads/2020/02/logo-header.png [ad_1] There is a lot of buzz around gR... #.netcore3 #.netcore3.0 #androiddevelopment #angular #api #cgprc #cproto #c #css #dataanalysis #datascience #deeplearning #development #docker #grpcc.netcore #grpcc.netcore3.0 #grpccexample #grpcctutorial #grpcclient #grpcinc #grpcserver #grpc.core #grpc.net.client #grpcserver #iamtimcorey #introtogrpc #iosdevelopment #java #javascript #machinelearning #node.js #protobuf #protocolbuffer #python #react #timcorey #unity #webdevelopment
0 notes
jeremiahshackelford · 6 years ago
Photo
Tumblr media
Just because you can’t code, doesn’t mean you can’t learn. There are many types of #developers. Start by teaching yourself to read the #fineprint. And what #namingconventions you will discover! Plus, they need more help than they let on. #founders AND, you’ll learn who has made a contribution to this platform. #thePword #historylesson #contributors #openlibraries #opensource #openmind #software : #gowalla #Apache #appirater ‘@apple reachability’ #boost #cocoalumberjack @Cocoawithlove #curl @flipboard @flickr ‘@google breakpad’ #EricaSadun #jsmn #JSONKit #cocoanetics @michaelwaterfall #kaboomerang #protocolbuffers #Quasidea ‘#Scifi #Hifi’ #SocketRocket #emojilib : #GO #SWIFT-ly into the Night https://www.instagram.com/p/BwLzA0pJ_v6bzDp4GE1fyYHd9k4QYzYhhtFzSg0/?utm_source=ig_tumblr_share&igshid=129haykqqaw6x
0 notes
masaa-ma · 8 years ago
Text
golangでgRPCを使ったAPIServerを作ってみる
from https://developers.eure.jp/eureka-grpc-go
はじめに
この記事は、 eureka Advent Calendar 2017 5日目の記事です。
こんにちは、エウレカでCTO(*Cat Tech Officer)を営む傍、サーバーサイドエンジニアとして 日々生計を立てている@marnie-eureです。
2015年にgRPCが���表されてから、2年が経ちましたね。 国内外の大手企業でのgRPCの事例も増えてきました。
これからのご時勢、gRPCの一つも使えないのでは、愛する猫たちを養っていくことも難しいかもしれない。
そんな危機感にかられたので、今回はふわふわっとgRPCを使ってAPIを作ってみようと思います。
(注) CTO(Chief Tech Officer)は@kaneshinなので 猫以外の話 はそちらにお問い合わせください。
gRPC Basics
gRPC?
gRPCは、Googleによって開発されたRPCフレームワークです。 HTTP/2を使用した通信層(ProtocolBuffersでシリアライズ)とProtocolBuffers(標準)としたテンプレートコードの生成がセットで提供されています。
勿論、HTTP2のstreamもサポートしています。 gRPCのRPC方式��以下の通り。
Unary RPC (1リクエスト1レスポンス)
Server streaming RPC (1つのリクエストに複数レスポンス)
Client streaming RPC (複数のリクエストに一つのレスポンス)
Bidirectional streaming RPC(双方向)
対応言語/platformも幅広く
C++
go
Ruby
Android Java
PHP
Objective-C
等の複数言語をサポートしています。
実装してみる
eurekaでは主にgolangを採用してますので、golangで実装します
前準備
gRPCをインストールします。
go get -u google.golang.org/grpc
protoファイルからコード生成をするコンパイラ(protoc)をインストールします。
protocのダウンロードはos別にこちらから 私の環境がosx-x86_64なので今回は protoc-3.5.0-osx-x86_64.zip を利用します。
PATHの通ったディレクトリに解凍したディレクトリの/bin の中のバイナリを移してあげてください。
protocのGo用のプラグインをインストールします。
go get -u github.com/golang/protobuf/protoc-gen-go
.protoファイルにインターフェースを定義する
gRPCをベースにした開発では、まずはIDLを使ってprotoにAPIの定義を書きます。
ProtocolBuffer以外もサポートはしているようですが、 ツール周りやドキュメントが一番手厚いし、標準に寄り添って行きたい民なので、今回はprotocolBufferで.protoファイルを作ります。
syntax = "proto3"; service Cat { rpc GetMyCat (GetMyCatMessage) returns (MyCatResponse) {} } message GetMyCatMessage { string target_cat = 1; } message MyCatResponse { string name = 1; string kind = 2; }
proto3の型や各言語の型の対応はgoogleのドキュメント、基本のscalar型以外を使いたい場合はgoogle/protobufをimportする感じで。
.proto ファイルからserver、client,interface等のコードを生成��る
定義から各言語のベースとなるコードの自動生成をします。
protocコマンドを実行します。
protoc --go_out=plugins=grpc:../pb cat.proto
成功すると xxxx.pb.go が生成されます。
xxxx.pb.go ファイルには、protoで定義した以下が含まれています。
request
response
client,serverのinterface
registerMethod
プラットフォームまたいでも、同一の定義からこの辺のコードが生成できるのは楽ですね proto3のscalar型がgoのtime型やint型などに対応してたら嬉しかったのですが、今時点では対応してなかったのがやや辛み…
protocによるdocument生成
protocでdocumentの生成もできます。わーい。
protoc --doc_out=html,index.html:./ proto/*.proto
pb.goファイルを参照してサーバーとクライアントの実装
生成されたpb.goに含まれるinterfaceに沿って、実処理とserverとclientを実装します
service (実処理)
作られたxxx.pb.goのinterfaceを満たすように実装します。
xxx.pb.go type CatServer interface { GetMyCat(context.Context, *GetMyCatMessage) (*MyCatResponse, error) }
serviceって名称は、公式やprotoの呼称から取ってきただけなのでお好みで。
package service import ( "context" "errors" pb "marnie_playground/grpc-sample/pb" ) type MyCatService struct { } func (s *MyCatService) GetMyCat(ctx context.Context, message *pb.GetMyCatMessage) (*pb.MyCatResponse, error) { switch message.TargetCat { case "tama": //たまはメインクーン return &pb.MyCatResponse{ Name: "tama", Kind: "mainecoon", }, nil case "mike": //ミケはノルウェージャンフォレストキャット return &pb.MyCatResponse{ Name: "mike", Kind: "Norwegian Forest Cat", }, nil } return nil, errors.New("Not Found YourCat") }
server
gRPC関連で書く必要があるコードは
port listen
作った実処理の登録,serve
だけです。interceptor chain等は用途に応じて。
package main import ( "log" "net" pb "marnie_playground/grpc-sample/pb" "marnie_playground/grpc-sample/service" "google.golang.org/grpc" ) func main() { listenPort, err := net.Listen("tcp", ":19003") if err != nil { log.Fatalln(err) } server := grpc.NewServer() catService := &service.MyCatService{} // 実行したい実処理をseverに登録する pb.RegisterCatServer(server, catService) server.Serve(listenPort) }
client
package main import ( "context" "fmt" "log" pb "marnie_playground/grpc-sample/pb" "google.golang.org/grpc" ) func main() { //sampleなのでwithInsecure conn, err := grpc.Dial("127.0.0.1:19003", grpc.WithInsecure()) if err != nil { log.Fatal("client connection error:", err) } defer conn.Close() client := pb.NewCatClient(conn) message := &pb.GetMyCatMessage{"tama"} res, err := client.GetMyCat(context.TODO(), message) fmt.Printf("result:%#v \n", res) fmt.Printf("error::%#v \n", err) }
FactoryMethodとClientInterfaceが提供されているので、Connection作成してメソッドを呼び出すだけです。
ビルド & テスト
出来あがったclientとserverをそれぞれgo build,実行すれば出来上がり。
./client result:&cat.MyCatResponse{Name:"tama", Kind:"mainecoon"} error::<nil>
middleware(interceptor)
logging,auth,recovery的な物はinterceptorとかmiddleware的な物を作ってやれると 既存のプロジェクトからの移行もスムーズかなーと思っていたので、調べてみました。
interceptorは型定義されてますので、下記を満たすようなインターフェースで実装します。
google.golang.org/grpc/interceptor.go //UnaryRPCならこっち type UnaryServerInterceptor func(ctx context.Context, req interface{}, info *UnaryServerInfo, handler UnaryHandler) (resp interface{}, err error) //StreamRPCならこっち type StreamServerInterceptor func(srv interface{}, ss ServerStream, info *StreamServerInfo, handler StreamHandler) error
利用するRPC方式によってgrpc.UnaryServerInterceptor() ないし grpc.StreamInterceptor()で grpc.ServerOptionに変換すればOKです
大雑��なイメージは以下のような感じ。
<br />func MiddlewareFunc(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) // 処理かく } func main() { //中略 middleware := &YourMiddleware{} opt := []grpc.ServerOption{grpc.UnaryInterceptor(MiddlewareFunc)} server := grpc.NewServer(opt...) }
grpc-middleware に何個か実装されたmiddleware(cf. logrus,validator)がありますので、 独自のmiddlewareを実装する場合はこの辺参考にすれば良いのかなと思います
まとめ
主要な通信層の処理は提供されているので、HTTP/2関連の実装は必要ない。
protoからボイラーテンプレートコードやドキュメントも作られるのは楽。
middlewareも増えている。
コードの自動生成によって本来時間をかけるべき、機能実装に集中できる HTTP/2による高速化/stream用途や、protobuff標準でのコード生成という所が包括的に提供されるといった恩恵を受けられるのは大きなメリットだなぁと感じます。
フルスタックフレームワークと較べるのは、主旨が異なるので要件や選定において重視する所次第って感じですが、マイクロフレームワークを使うような構成を検討していたり、ストリーミング通信が要件に含まれているのであれば採用するメリットははあると考えています
細々、下記のような気になる所はありましたが
proto3がgoの型を全て網羅してるわけではなさそうなので、applicationLayerの既存コードの型合わない場合は変換層とか必要そう。
curlでポチッと、みたいなのが使えなくなったので、テストがちょっと大変。grpc-gatewayでも使うべきなのかしら。
まぁデメリットと言うほどではないかな〜って気も。 テスト手段やエコシステム、ミドルウェアは今後、充実していく気もするし、既に必要十分ではあると思うので。
あとがき
今回はチュートリアル的な所と周辺情報を通して基本的な流れと所感を書いてみましたが、 eurekaでは実際に一部のmicro serviceのgRPC導入/移行を進行しています。 (既存コードとの兼ね合いで記事までに間に合いませんでした。てへぺろ
go+gRPCでの開発やeurekaに興味が持てた方(猫愛があれば尚良)は、是非お気軽にお話に来てくだされば!
それでは、2017年も残り少ないですが、日々猫への感謝を忘れず、過ごしていきましょう!!
参考にした資料/Repsitory Thanks!
grpc goDoc grpc.io grpc-middleware grpc-echosystem google/protobuf protocol-buffers docs
https://developers.eure.jp/wp-content/uploads/2016/12/nyan-1.png
0 notes
tak4hir0 · 6 years ago
Link
Spring以前 業務で使うシステム���サーバー間で連携することが多い。2019年現在ではREST apiに対してjsonやprotocolbufferで呼び出す事が当たり前のように行われているが、まだjsonも発見されていない時代はもっと複雑な仕組みが取られていた1。異機種間でやりとりするためのCORBAや、機種に依存しないデータプロトコルのASN.1なども利用されていたが、仕様は複雑でそれぞれをハンドリングするライブラリは有償で売られ、ベンダーからサポートを受けながら使用するようなものだった。 RMI Javaの世界ではJava同士でやりとりするためのRMIが定義され、比較的に楽にRPCできるようになった2。とはいえhttpでrestをコールすることに比べたらアホみたいな複雑さである。 https://docs.oracle.com/javase/jp/1.3/guide/rmi/getstart.doc.html J2EE そのRMIの使い方に一定のルールを設け、EJBを始め様々な指針を提示したのがJ2EEである。実装者がそれぞれに試行錯誤して苦労するような無駄は減ったが、代償として仕様はさらに複雑化した。 Spring 獲得できる機能に対して、設定や規約が悪夢のように複雑なJ2EEのアンチテーゼとして登場したのがSpringである。DIと組み合わせることでソースを綺麗に保つことができた。Clientクラスからサーバー上にあるServer#method()を呼び出すソースは以下だ。 class Client { private Server server; public void setServer(Server value) { server = value; } public void action(){ server.method(); } } もちろん適切な設定ファイルが必要になる3。が、開発時はローカル(というか同一JVM内)にあるserver.method()を直接呼び出して検証し、設定ファイルを差し替えるだけででserverの中身がテスト用のモックになったり本番用のリモート呼び出し版になったりするのは便利だった。素のRMIなら開発時もローカルにRMIサーバーを上げてrmi://localhostで接続し、テスト環境では設定ファイルでrmi://serverhostに変更するだけとか、RMIのオーバーヘッドが嫌ならデバッグフラグを立てておき呼び出し時にif文でローカル実行かRPCかを呼び分けるようにする程度だったから、結構な進化である。RMIのオーバーヘッドはhttpに較べればかなり小さいが、開発時にもいちいち上げなければいけないのは面倒だ。メインサービスのhttpは忘れないが、別途rmiserverだけ起動、とかいう手順が必要だと忘れがちになったり、逆に常に同時に立ち上げるスクリプトを使っていると、httpが生きているのにrmiにつながらない時に開発メンバーが「どうすれば��いかわからない」状態になることがある。 SpringはDIコンテナではあるが、そのDIでリモート呼出を簡単にしてくれた事に大きな功績があった。このように実装を切り分ける方法にはDIの前にServiceLocatorがあった。先程のサンプルを書き換えるとこうなる。 class Client { private Server server = Locator.find(Service.class); public void action(){ server.method(); } } アプリの初期化時にFactoryに適切なServerクラスのインスタンスを登録しておく。もちろん設定ファイルを見てローカルかリモートか変更できるようになる。デメリットはServiceLocatorに対する依存が発生することだ。細かいことは割愛するがマーチン・ファウラーのブログの日本語訳のリンクを貼っておくので読んでほしい4。 Inversion of Control コンテナと Dependency Injection パターン 歴史は繰り返す メインフレームにダム端末を繋いでいた時代から、コンピュータの性能が向上したことでダウンサイジングがブームとなりUNIXワークステーションやPCで処理を行う流れとなり、管理の煩雑さやセキュリティの問題から巨大なサーバーにシンクライアントや仮想デスクトップで接続するという逆行が起きている。データ通信の世界ではシリアル通信から、同時接続で速度を向上させるためパラレルの通信技術が発展した。しかし技術革新でかなり高い周波数で通信できるようになると、今度は複数ある通信経路の同期をとるのが大変になりシリアル通信のSATAに揺り戻しが起きている。 プログラミング言語の世界も同じだ。C言語が世界を席巻していた頃、可読性の低いソースが氾濫していた。インターネットはまだ普及していないし、接続しても毒にも薬にもならない企業ページか、カウンターcgiの設置された個人ページばかり、最新の情報と言えば雑誌だ5。オンラインのコミュティがないのだからオフラインミーティングもない(Niftyなどのパソコン通信ではオフ会もあった、というかオフ会の言葉の発祥がそのへんだと思う)。よく練られたベストプラクティスが無い中、平凡なプログラマが書くコードというのはそれはもう十人十色で、変数名が意味不明に略されていたり、一つのものに対してもいろんな名前がついていたり、読み解くのに一苦労だ。 ここにC++によるオブジェクト指向の波がやって来る。Cでしか書いたことない人達は「コメントに"//"が使えるC言語」6とか、「困ったらextern Cで書けばいいから」とか言っちゃうし、継承をよくわかってないまま使って単に可読性を悪化させただけだったりした。boostはまだ来ない。オペレーターオーバーロードで演算子の持つ意味が特定のクラスでは異なっていたり、ダイアモンド継承による問題もあった。技術者レベルはCの時代に比べミジンコほどしか上がってないのに、言語の機能と複雑度は爆発的に増えた。 省略名で苦労するなら長い名前でいいじゃん c/c++で蔓延していたユニークな変数名・略名からの揺り戻しとして「変数名を省略するなブーム」が起きる。過去はみんな640x480のCRT(またはそれ以下の解像度のモノクロ液晶)で仕事をしていたので、変数名が長いとソースの右端が途切れて読みにくかったのである。マウスもなかったし。 Windows95,MacはSystem7-漢字Talk7.5くらいで、800x600や1024x7686英語名での間違いとかもあり、大事なのはプロジェクトで用語辞書を定義して一貫性をもたせることであって名前を省略しなければいいというものでもない。google spreadsheetのようにフリーでwikiよりも気軽に編集できる辞書スプレッドシートが使えるようになった時代背景も大きい。 インターフェース、セッター、ゲッター...「すいませんこれ手で書くの?」 そして、オブジェクトの状態を隠蔽し振る舞いだけ公開しろということでprivateメンバを作成し、publicなgetter/setterを作成するのである。2019年にこれを手打ちしている猿はいないと思うが、Eclipseは随分前から自動生成をサポートし、JavaではLombokによりアノテーションだけで任意のアクセッサをプリコンパイルしてくれ、モダンな言語はproperty機能を備え(Delphiからあったし、なんならC#はDelphiだが)、Scalaではそもそもメンバ変数もpublicにすることが推奨され出した。これは「変数にしとこうと思ったけど、やっぱ関数にする」みたいな時にインターフェースを変えないまま差し込めるからだ。そもそも振る舞いだけ公開するならアクセッサを用意しては駄目で「Tell, Don't Ask」の原則にしたがって相手のオブジェクトに対してやって欲しい命令をだす方が望ましいのである。 XML地獄 さて話をSpringに戻そう。ServiceLocatorでは利用側のプログラムが任意のタイミングで取り出すので、実装を差し替えたいクラスだけ設定しておけばよかった。しかしDIコンテナではDIコンテナがインスタンスを生成し、その生成時にインスタンスは別のDIで差し替え可能なインスタンスを持つため、DIで差し替え可能なメンバーを持つクラスすべてをDIコンテナに登録しなくてはならなかった。そのため登録する項目数はかなり多く、spring起動時に依存関係を解決するため起動は遅かった。でもJ2EEのクソ設計に比べれば随分スマートだったので広く受け入れられた。当時は設定ファイルと言えばxmlで7、Springを始めとしたJava界隈はXML地獄の様相を呈していく。 設定より規約 ここは本題と外れるので余談となるが、このような状況で登場したRuby On Rails(以下RoR)は、設定を多数管理するよりも「規約をつくってそれにのっとっていればうまく動くよ」というスタンスで人口に膾炙し、後にRoRのフォロワーを多数輩出した。XML地獄から脱出する大きなムーブメントとなった功績は大きい。ただ「設定より規約」では規約をすべて頭に入れておかないと「これ、どこにも定義されてないんだけどどうやって動いてるの???」となり保守性が悪くなる。少ない規約で運用できるなら非常に有用だと思う。Spring DIに影響されRoRを後追いした日本ローカルなSeasar2では、どちらも劣化コピーだった上にアレがアレだったんで消えた。 アノテーションの是非 SpringはXMLからの脱却に、アノテーションを選択した。確かに設定ファイルは減った。意味不明な設定ファイルの項目があったとき、XMLなら項目名でgrepをかけてどういう処理をしているのか探し出すことができた。アノテーションの場合IDEからコントロールクリックで飛べるが、そこにはアノテーションとしての定義しかなく、実際はDIコンテナからインスタンスを生成する時に、対象となるクラスについているアノテーションを見て挙動を変えるわけで、ベテランじゃないと処理が負えなくなった。 そしてServiceLocatorの事を思い出してほしい。あれにデメリットがあるとされたのは、Locatorに対する依存があるからだ。設定ファイルからアノテーションのに移したということは、アノテーションをimportしアノテーションに依存する。ServiceLocatorに対する最大の優位点まで捨ててしまった。後にCDIとしてDI系のアノテーションが標準化されるが、springがやり始めた時は完全にspring依存で替えの効かないシステムになったのである。 アノテーションの例としてこれを見てほしい。 きしだのはてなより引用: https://nowokay.hatenablog.com/entry/20131108/1383882109 import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; import javax.inject.Named; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.QueryParam; @Named @ApplicationScoped @Path("/calc") public class CalcService { @Inject CalcLogic logic; @Path("add") @GET public Result add( @QueryParam("left") int p1, @QueryParam("right") int p2) { int ans = logic.add(p1, p2); return new Result(p1, p2, ans); } } (筆者による改行変更あり) ブログオーナーのきしださんは「便利」とおっしゃられているが、これはJavaにおけるWeb開発、DIの知識があるから「すげー少ない労力でかける」のであって、初見の人からしたら「このアノテーションは一体全部でいくつあって、そのうちどれとどれをマスターしておく必要があるのか、@GETに対しては@POSTや@PUTがあるだろうというのは想��できるが、じゃあ添付ファイルはどうやって取得するの?@Pathはアプリ起動時に自動的にこのクラスが読み込まれてservlet containerのルーティングに登録されるの?とか不安要素いっぱいすぎる。 ここで同じことをするsparkframework8+ServiceLocatorのサンプルを見てほしい。ServiceLocatorはサンプルとしてimport,他に依存するのはSparkframeworkだけである。 import static spark.Spark.*; import com.example.ServiceLocator; public class HelloWorld { public static void main(String[] args) { get("/hello", (req, res) { CalcLogic logic = ServiceLocator.get(CalcLogic.class); int p1 = intParam("left"); int p2 = intParam("right"); int ans = logic.add(p1, p2); return new Result(p1, p2, ans); } } private static int intParam(Request req, String key){ return Integer.valueOf(req.params(key)); } } アノテーションはひとつもなく同じことをしている。static import Spark.*してgetメソッドが使ってしまうあたりは依存関係が明確でないが、IDEでコントロールクリックすれば飛んで処理が追える。膨大なJ2EEやSpringのドキュメントにあらかじめ目を通しておかなくても、実際に書いてあるシンプルなコードから追えるのである。ちなみに上のソースは1行メソッドのためにわざわざintParam()を定義しているので、直に書けば3行短くなる。それより引数でもらってきたp1とp2を返す意味がわからん(だって呼び出し側が渡してきたパラメータなんだから呼び出し側は持ってるでしょ)ので、intParamは残しつつ無駄を省くとこう import static spark.Spark.*; import com.example.ServiceLocator; public class HelloWorld { public static void main(String[] args) { get("/hello", (req, res) { CalcLogic logic = ServiceLocator.get(CalcLogic.class); return new Result(logic.add(intParam("left"), intParam("right"))); } } private static int intParam(Request req, String key){ return Integer.valueOf(req.params(key)); } } おそらくSparkFrameworkの代わりにNinjaFrameworkを使っても似たようなものだろう。学習コストが違いすぎる。Springは当時眩しかったが、今では腐臭を放ち始めている。 Springの終焉 いつ終わっていたのか?Springの作者はRederick "Rod" Johnsonであるが、彼がScala言語を開発しているtypesafeにジョインした2012年、既に作者から見切りをつけられていたのではないだろうか。おそらく創始者としての責任感は感じていただろうから、実際にジョインした2012よりも前の段階から、すでにSpringは最先端の技術ではなく、より良い方法を追求しようとしていたのだと想像する。まあここはあくまで個人の想像だし、本人はまかりまちがっても「いやあ実はSpringなんてとっくに見切っててさあ」なんて思ってても公言できる立場ではないので、確認する術はない。 Micronauts お、マイクロサービス特化のあたらしいフレームワーク?いい線いくのかと思ったけど思想が完全に「Springつらいから軽量Springを作る」になっていてアノテーション使いまくりでやばい。過去にLinusは「Subversionプロジェクトは無意味、CVSからほとんど進化してないのに多大なリソースをつぎ込んでいる」と批判してgitのベースを作ったが、ちょ��どそんな漢字だと思う。MicronautsはSpringのつらさをちょっと軽減してくれるだけで、根本的な問題がなにも解決していない 今後 当然「じゃあ何を使うのか」という話になるわけだが、筆者は今の所Kotlin+SparkFramework+Expose(ORM)を使っているものの、ここがゴールだという気は全然しない。まずKotlinってJavaの知識が必要だし、gradleってmavenの知識が必要だし、すごく過渡期の中途半端なプロダクトという感じ。ExposeはマクロのないKotlinではボイラープレートが多すぎてまだまだつらい。kaptでどうにかなるのか?AndroidのおかげでKotlinは今後もシェアを伸ばすだろうけど、じゃあ全部Kotlinでいいかって言われるとうーん、となる。パターンマッチがないのも辛い、kotlin2.0で入って欲しい。あとJVMがでかくて、せっかくalpineでdocker imageつくってもJVMいれた時点でお腹痛くなってくる。busyboxの意味とは。 今はGoを試そうとしている。今度ジェネリクスも入るらしいからそれを待ちたい。まともなMaybe/Eitherが使えるようになったら良いかもしれないけど、Goの型システムでいけるのだろうか?無理そうな気がする。 言語機能的にはRustくらい欲しいが、Rustが10年後どれくらい使われているかを考えると、業務で使うのは怖い気がする(業種によるけど)。
0 notes
suisui-tech · 7 years ago
Link
0 notes
somesillyperson-blog · 8 years ago
Text
so i understood that even for nice purposes, using protocolbuffer data structures as API arguments (for a client library) is not nice. but when you make it static in API structures, API becomes static but its ok in a microservices enabler environment. yepp its really hard to initialize protocol buffer structures in api calls so need to make it somehow static. 
0 notes
dicasdeti-blog · 11 years ago
Text
Implementação de um serviço com representação externa Protocol Buffer
Filmoteca é um sistema que utiliza a comunicação externa através do protocolo buffer. O objetivo do sistema é armazenar uma biblioteca de filmes de um usuário que deseja catalogá-los.
O sistema possui chamadas remotas para as funções de:
Adicionar Filme: Cadastra novos filmes no sistema;
Listar Filmes: Lista os filmes cadastrados no sistema;
Remover Filme: Remove um filme da lista de filmes cadastrados.
Altera Status: Altera o status de um filme para assistido ou não assistido
Arquivo .proto:
package filmes;
option java_package = "filmoteca"; option java_outer_classname = "Filmoteca";
message Mensagem {
required int32 messageType = 1; required int32 requestId = 2; required string objectReference = 3; required string methodId = 4; required bytes arguments = 5;
}
message Filme { required int32 id = 1; required string nome = 2; required string genero = 3; required int32 ano = 4; required string diretor = 5; required string status = 6; }
message Resposta { required string mensagem = 1; }
message ListaFilme { message InstanciaFilme { required int32 idi = 1; required string nomei = 2; required string generoi = 3; required int32 anoi = 4; required string diretori = 5; required string statusi = 6; } repeated InstanciaFilme filme = 1; }
message CadastraFilme { message InstanciaFilme2 { required int32 idc = 1; required string nomec = 2; required string generoc = 3; required int32 anoc = 4; required string diretorc = 5; required string statusc = 6; } repeated IntanciaFilme2 filmec = 1; }
--------------------------------------------------------------------------------------
Classe FilmeCliente:
package filmoteca;
import java.util.Scanner;
import filmoteca.Filmoteca.CadastraFilme; import filmoteca.Filmoteca.Filme; import filmoteca.Filmoteca.ListaFilme;
public class FilmeCliente {
public static void main(String[] args) { try { FilmeProxy proxy = new FilmeProxy(); Scanner s = new Scanner(System.in); int opcao; do { System.out.println("1 - Adicionar filme"); System.out.println("2 - Listarr filme"); System.out.println("3 - Alterar Status"); System.out.println("4 - Remover filme"); System.out.println("5 - Sair"); opcao = s.nextInt();
int id; String nome; String genero; int ano; String diretor; String status; String result;
// Resultado resposta;
switch (opcao) { case 1: // adiciona filme System.out.println("Id: "); id = s.nextInt(); System.out.println("Nome: "); nome = s.next(); System.out.println("Genero: "); genero = s.next(); System.out.println("Ano: "); ano = s.nextInt(); System.out.println("Diretor: "); diretor = s.next(); System.out.println("Status: "); status = s.next();
CadastraFilme.InstanciaFilme2.Builder filme = CadastraFilme.InstanciaFilme2 .newBuilder();
filme.setIdc(id); filme.setNomec(nome); filme.setGeneroc(genero); filme.setAnoc(ano); filme.setDiretorc(diretor); filme.setStatusc(status);
result = proxy.addFilme(filme.build()); System.out.println(result); break; case 2: // lista filmes String resposta2 = proxy.list(); System.out.println(resposta2);
break; case 3: // altera status do filme System.out.println("Id do filme a ser alterado: "); id = s.nextInt(); System.out.println("Status do filme a ser alterado: "); status = s.next();
ListaFilme.InstanciaFilme.Builder filme_alt = ListaFilme.InstanciaFilme .newBuilder(); filme_alt.setIdi(id); filme_alt.setStatusi(status); filme_alt.setNomei(""); filme_alt.setGeneroi(""); filme_alt.setAnoi(0); filme_alt.setDiretori("");
result = proxy.alteraFilme(filme_alt.build()); System.out.println("" + result);
break;
case 4: // remove filme System.out.println("Id do filme a ser removido: "); id = s.nextInt();
Filme.Builder filme_rm = Filme.newBuilder(); filme_rm.setId(id); filme_rm.setNome(""); filme_rm.setGenero(""); filme_rm.setAno(0); filme_rm.setDiretor(""); filme_rm.setStatus("");
result = proxy.rmvFilme(filme_rm.build()); System.out.println("" + result);
break;
case 5: // finaliza o processo proxy.finaliza(); return; default: break; } } while (opcao != 5); } catch (Exception e2) { e2.printStackTrace(); System.out.println("Nao foi possivel se conectar ao proxy."); } }
}
---------------------------------------------------------------------------------------------
Classe FilmeProxy:
package filmoteca;
import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Random; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException;
import filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2; import filmoteca.Filmoteca.Filme; import filmoteca.Filmoteca.ListaFilme; import filmoteca.Filmoteca.ListaFilme.InstanciaFilme; import filmoteca.Filmoteca.Mensagem; import filmoteca.Filmoteca.Resposta;
public class FilmeProxy {
UDPClient udpClient = new UDPClient();
public String list() throws InvalidProtocolBufferException, IOException { ListaFilme var = null; String objeto = "filmoteca.FilmeEsqueleto"; String metodo = "list";
try { var = ListaFilme.parseFrom(doOperation(objeto, metodo, "".getBytes())); return var.toString(); } catch (Exception e) { e.printStackTrace(); } return var.toString(); // (1) Empacota argumentos de entrada (ex: nomeAgenda) // (2) Chama doOperation // (3) Desempacota argumento de resposta (retorno de doOperation) // (4) Retorna reposta desempacotada // ex: // addressBook = AddressBook.parseFrom(doOperation("AddressBook", // "list", listPessoa.build().toByteArray())); }
public String addFilme(InstanciaFilme2 instanciaFilme2) {
Resposta resposta = null; String objeto = "filmoteca.FilmeEsqueleto"; String metodo = "addFilme";
try { resposta = Resposta.parseFrom(doOperation(objeto, metodo, instanciaFilme2.toByteArray())); } catch (InvalidProtocolBufferException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
return resposta.getMensagem(); // (1) Empacota argumentos de entrada // (2) Chama doOperation // (3) Desempacota argumento de resposta (retorno de doOperation) // (4) Retorna reposta desempacotada }
public String alteraFilme(InstanciaFilme instanciaFilme) { Resposta resultado = null; String objeto = "filmoteca.FilmeEsqueleto"; String metodo = "alteraFilme"; System.out.println(instanciaFilme);
try { resultado = Resposta.parseFrom(doOperation(objeto, metodo, instanciaFilme.toByteArray())); } catch (InvalidProtocolBufferException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
return resultado.getMensagem();
} public String rmvFilme(Filme filme) { Resposta resultado = null; String objeto = "filmoteca.FilmeEsqueleto"; String metodo= "rmvFilme"; try { resultado = Resposta.parseFrom(doOperation(objeto, metodo, filme.toByteArray())); } catch (InvalidProtocolBufferException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return resultado.getMensagem(); // TODO Auto-generated method stub }
public byte[] doOperation(String objectRef, String methodId, byte[] args) throws IOException {
try { byte[] data = empacotaMensagem(objectRef, methodId, args);
String endereco = "localhost"; int porta = 3470; // envio udpClient.clientSendRequest(endereco, porta, data); udpClient.setTimeout(5000);
} catch (Exception e) { e.printStackTrace(); } // recebimento
Mensagem resposta = null;
try { resposta = desempacotaMensagem(udpClient.clientGetResponse()); } catch (IOException e) { e.printStackTrace(); }
// return resposta.getArguments().toByteArray(); return resposta.getArguments().toByteArray();
}
public void finaliza() { udpClient.closeConnection(); }
private byte[] empacotaMensagem(String objectRef, String methodId, byte[] args) throws IOException {
Mensagem.Builder mb = Mensagem.newBuilder(); Random random = new Random(); byte[] resposta = null;
mb.setMessageType(0); mb.setRequestId(random.nextInt(100)); mb.setObjectReference(objectRef); mb.setMethodId(methodId); mb.setArguments(ByteString.copyFrom(args));
ByteArrayOutputStream saida = new ByteArrayOutputStream(1024); mb.build().writeDelimitedTo(saida);
resposta = saida.toByteArray();
return resposta; // empacota a Mensagem de requisicao
}
private Mensagem desempacotaMensagem(byte[] resposta) throws IOException {
ByteArrayInputStream entrada = new ByteArrayInputStream(resposta); Mensagem m = Mensagem.parseDelimitedFrom(entrada);
return m;
} }
--------------------------------------------------------------------------------------------
Classe UDPClient:
package filmoteca;
import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.SocketException; import java.net.UnknownHostException;
public class UDPClient { private DatagramSocket socket = null; private byte[] byteArray; public UDPClient() { try { this.socket = new DatagramSocket(); } catch (SocketException e) { e.printStackTrace(); } } public byte[] getResposta(){ return byteArray; } public void clientSendRequest(String endereco, int porta, byte[] dados) throws UnknownHostException {
byte[] mensagem = dados; InetAddress host = InetAddress.getByName(endereco); int portaServidor = porta; DatagramPacket requisicao = new DatagramPacket(mensagem, mensagem.length, host, portaServidor);
try { socket.send(requisicao); } catch (Exception e) { e.printStackTrace(); } } public byte[] clientGetResponse() { byte[] mensagem = new byte[1024]; DatagramPacket resposta = new DatagramPacket(mensagem, mensagem.length);
try { socket.receive(resposta); } catch (Exception e) { e.printStackTrace(); }
return resposta.getData(); } public void closeConnection() { try { socket.close(); } catch (Exception e) { e.printStackTrace(); } } public void setTimeout (int time) throws SocketException{ socket.setSoTimeout(time); }
}
-----------------------------------------------------------------------------------------
Classe UDPServer:
package filmoteca;
import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.SocketException;
import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.ByteString; import filmoteca.Filmoteca.Mensagem;
public class UDPServer extends Thread{ DatagramSocket socket = null; DatagramPacket resposta; DatagramPacket requisicao; public UDPServer(DatagramSocket socket) throws SocketException { this.socket = socket; System.out.println("Servidor iniciado na porta " + this.socket.getLocalPort()); } public byte[] empacotaResposta(byte[] resposta, int requestId) { Mensagem.Builder mensagem = Mensagem.newBuilder(); byte[] buffer = null;
try { mensagem.setMessageType(0); mensagem.setRequestId(requestId); mensagem.setObjectReference(" "); mensagem.setMethodId(" "); mensagem.setArguments(ByteString.copyFrom(resposta));
ByteArrayOutputStream saida = new ByteArrayOutputStream(1024); mensagem.build().writeDelimitedTo(saida);
buffer = saida.toByteArray(); return buffer; } catch (Exception e) { e.printStackTrace(); } return buffer; } public Mensagem desempacotaRequisicao(byte[] requisicao) throws IOException { Mensagem mensagem = null;
ByteArrayInputStream entrada = new ByteArrayInputStream(requisicao);
try{ mensagem = Mensagem.parseDelimitedFrom(entrada); }catch(InvalidProtocolBufferException e) { e.printStackTrace(); } return mensagem; } public byte[] serverGetRequest() { byte[] buffer = new byte[1024]; this.requisicao = new DatagramPacket(buffer, buffer.length);
try { socket.receive(requisicao); } catch (Exception e) { e.printStackTrace(); }
return this.requisicao.getData(); } public void serverSendResponse(byte[] resposta) { byte[] buffer = resposta; this.resposta = new DatagramPacket(buffer, buffer.length, this.requisicao.getAddress(), this.requisicao.getPort());
try { socket.send(this.resposta); } catch (Exception e) { e.printStackTrace(); } } @Override public void run() { try { while (true) { Mensagem requisicao = desempacotaRequisicao(serverGetRequest()); System.out.println("\nREQUISICAO: " + requisicao);
FilmeDespachante despachante = new FilmeDespachante(); byte[] resultado = despachante.selecionaEqueleto(requisicao);
System.out.println("\nRESPOSTA: " + resultado); serverSendResponse(empacotaResposta(resultado, requisicao.getRequestId())); } } catch (Exception e) { e.printStackTrace(); System.out.println("Nao foi possivel enviar a requisicao."); } } public static void main(String[] args) throws SocketException { DatagramSocket dsocket = new DatagramSocket(3470); UDPServer servidor = new UDPServer(dsocket); servidor.run(); }
}
-----------------------------------------------------------------------------------------------
Classe FilmeDespachante:
package filmoteca;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method;
import com.google.protobuf.ByteString; import filmoteca.Filmoteca.Mensagem;
public class FilmeDespachante { FilmeEsqueleto esqueleto = new FilmeEsqueleto(); public byte[] selecionaEqueleto(Mensagem request) { Class<?> objRef = null; Method method = null; byte[] resposta = null; try { objRef = Class.forName(request.getObjectReference()); String methodName = request.getMethodId(); System.out.println("Executando: " + methodName); method = objRef.getMethod(methodName, ByteString.class); resposta = (byte[]) (method.invoke(objRef.newInstance(), request.getArguments())); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (SecurityException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } return resposta; }
}
-------------------------------------------------------------------------------------------
Classe FilmeEsqueleto:
package filmoteca;
import java.io.IOException;
import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException;
import filmoteca.Filmoteca.CadastraFilme; import filmoteca.Filmoteca.Filme; import filmoteca.Filmoteca.ListaFilme; import filmoteca.Filmoteca.Resposta;
public class FilmeEsqueleto {
FilmeServente servente = new FilmeServente();
public byte[] addFilme(ByteString msg) throws IOException { // (1) Desempacota argumento de entrada // (2) chama o metodo do servente // (3) empacota resposta do metodo servente e retorna CadastraFilme.InstanciaFilme2.Builder filme = CadastraFilme.InstanciaFilme2.newBuilder(); Resposta.Builder res = null; try { filme.mergeFrom(msg); res = Resposta.newBuilder(); res.setMensagem(servente.adicionaFilme(filme.build()).toString()); } catch (InvalidProtocolBufferException e) { e.printStackTrace(); } return res.build().toByteArray();
}
public byte[] list(ByteString msg) throws InvalidProtocolBufferException {
ListaFilme menu = servente.list();
return menu.toByteArray();
}
public byte[] alteraFilme(ByteString msg) { // (1) Desempacota argumento de entrada // (2) chama o metodo do servente // (3) empacota resposta do metodo servente e retorna ListaFilme.InstanciaFilme.Builder filme = ListaFilme.InstanciaFilme.newBuilder(); Resposta.Builder res = null; try { filme.mergeFrom(msg); res = Resposta.newBuilder(); res.setMensagem(servente.alteraFilme(filme.build()).toString()); } catch (InvalidProtocolBufferException e) { e.printStackTrace(); } return res.build().toByteArray(); } public byte[] rmvFilme(ByteString msg) { // (1) Desempacota argumento de entrada // (2) chama o metodo do servente // (3) empacota resposta do m�todo servente e retorna Filme.Builder filme = Filme.newBuilder(); Resposta.Builder res = null; try { filme.mergeFrom(msg); res= Resposta.newBuilder(); res.setMensagem(servente.rmvFilme(filme.build()).toString()); } catch(InvalidProtocolBufferException e){ e.printStackTrace(); } return res.build().toByteArray(); }
}
---------------------------------------------------------------------------------------------
Classe FilmeServente:
package filmoteca;
import java.sql.Connection;
import banco.Conexao; import banco.FilmeDAO;
import filmoteca.Filmoteca.CadastraFilme;
import filmoteca.Filmoteca.ListaFilme;
import filmoteca.Filmoteca.Resposta; import filmoteca.Filmoteca.Filme;
public class FilmeServente {
private static ListaFilme.Builder menu = ListaFilme.newBuilder(); private static CadastraFilme.Builder menu2 = CadastraFilme.newBuilder();
public ListaFilme list() {
ListaFilme.Builder lista = null; FilmeDAO banco = new FilmeDAO(); Conexao c = new Conexao();
try { Connection conexao = c.start();
lista = menu.mergeFrom(banco.listar(conexao)); System.out.println("lista list servente: " + lista); return lista.build(); } catch (Exception e) { e.printStackTrace(); } return lista.build(); } public Resposta adicionaFilme(CadastraFilme.InstanciaFilme2 filme) { Resposta.Builder res = Resposta.newBuilder(); FilmeDAO banco = new FilmeDAO(); Conexao c = new Conexao();
try { Connection conexao = c.start(); menu2.addFilmec(filme); Boolean adicionado = banco.adicionaFilme(conexao, filme); if (adicionado == true) { res.setMensagem("Filme adicionado"); c.fecha(conexao); return res.build(); } else { res.setMensagem("Filme não adicionado"); return res.build(); } } catch (Exception e) { e.printStackTrace(); } return null;
} public Resposta alteraFilme (ListaFilme.InstanciaFilme filme) { Resposta.Builder res = Resposta.newBuilder(); FilmeDAO banco = new FilmeDAO(); Conexao c = new Conexao(); try { Connection conexao = c.start(); Boolean alterado = banco.alteraFilme(conexao, filme.getIdi(), filme.getStatusi()); if (alterado == true){ res.setMensagem("Status Alterado"); c.fecha(conexao); return res.build(); } else { res.setMensagem("Status nao alterado"); return res.build(); } } catch (Exception e) { e.printStackTrace(); } return null; } public Resposta rmvFilme(Filme filme) { Resposta.Builder res = Resposta.newBuilder(); FilmeDAO banco = new FilmeDAO(); Conexao c = new Conexao(); try { Connection conexao = c.start(); Boolean removido = banco.removeFilme(conexao, filme.getId()); if (removido==true){ res.setMensagem("Filme removido"); c.fecha(conexao); return res.build(); } else{ res.setMensagem("Filme nao removido"); return res.build(); } } catch(Exception e){ e.printStackTrace(); } return null; }
}
--------------------------------------------------------------------------------------------
Classe FilmeDAO:
package banco;
import java.sql.PreparedStatement; import java.sql.SQLException; import java.text.ParseException; import java.sql.Connection; import java.sql.ResultSet;
import filmoteca.Filmoteca; import filmoteca.Filmoteca.CadastraFilme; import filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2; import filmoteca.Filmoteca.Filme; import filmoteca.Filmoteca.Filme.Builder; import filmoteca.Filmoteca.ListaFilme; import filmoteca.Filmoteca.ListaFilme.InstanciaFilme;
public class FilmeDAO {
public Boolean adicionaFilme(Connection conexao, CadastraFilme.InstanciaFilme2 filme) throws SQLException, ParseException, java.text.ParseException { Boolean adicionado;
PreparedStatement inserir = conexao .prepareStatement("INSERT INTO filme (id, nome, genero, ano, diretor, status)" + "VALUES (?, ?, ?, ?, ?, ?)"); inserir.setInt(1, filme.getIdc()); inserir.setString(2, filme.getNomec()); inserir.setString(3, filme.getGeneroc()); inserir.setInt(4, filme.getAnoc()); inserir.setString(5, filme.getDiretorc()); inserir.setString(6, filme.getStatusc());
if (inserir.executeUpdate() != 0) { adicionado = true; inserir.close(); } else { adicionado = false; } return adicionado; }
public ListaFilme listar(Connection conexao) throws SQLException { PreparedStatement exibir = conexao .prepareStatement("SELECT * FROM filme"); ResultSet rs = exibir.executeQuery();
ListaFilme.Builder lista_filme = ListaFilme.newBuilder(); // Filme.Builder filme = Filme.newBuilder(); ListaFilme.InstanciaFilme.Builder filme = ListaFilme.InstanciaFilme .newBuilder();
while (rs.next()) { filme.setIdi(rs.getInt(1)); filme.setNomei(rs.getString(2)); filme.setGeneroi(rs.getString(3)); filme.setAnoi(rs.getInt(4)); filme.setDiretori(rs.getString(5)); filme.setStatusi(rs.getString(6));
lista_filme.addFilme(filme); System.out.println(lista_filme); } exibir.close(); return lista_filme.build(); }
public Boolean alteraFilme(Connection conexao, int id, String status) throws SQLException { Boolean alterado;
PreparedStatement ps = conexao .prepareStatement("update filme set status = '" + status + "' where id = " + id + ";");
if (ps.executeUpdate() == 1) { alterado = true; ps.close();
} else { alterado = false; } return alterado; }
public Boolean removeFilme(Connection db, int id) throws SQLException { Boolean removido;
PreparedStatement ps = db .prepareStatement("DELETE FROM filme WHERE id = " + id);
if (ps.executeUpdate() != 0) { removido = true; ps.close(); } else { removido = false; } return removido; }
}
-----------------------------------------------------------------------------------------------
Classe Conexao:
package banco;
import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException;
public class Conexao {
public Connection start() throws SQLException { Connection conexao; try { Class.forName("com.mysql.jdbc.Driver"); } catch(ClassNotFoundException e) { System.out.println("Driver nao encontrado."); e.printStackTrace(); } conexao = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/filmoteca", "root", "rejane13"); return conexao; } public void fecha(Connection conexao){ try { conexao.close(); } catch(SQLException e){ e.printStackTrace(); } } }
-----------------------------------------------------------------------------------------------
Classe Filmoteca:
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: mensagem2.proto
package filmoteca;
public final class Filmoteca { private Filmoteca() {} public static void registerAllExtensions( com.google.protobuf.ExtensionRegistry registry) { } public interface MensagemOrBuilder extends // @@protoc_insertion_point(interface_extends:filmes.Mensagem) com.google.protobuf.MessageOrBuilder {
/** * <code>required int32 messageType = 1;</code> */ boolean hasMessageType(); /** * <code>required int32 messageType = 1;</code> */ int getMessageType();
/** * <code>required int32 requestId = 2;</code> */ boolean hasRequestId(); /** * <code>required int32 requestId = 2;</code> */ int getRequestId();
/** * <code>required string objectReference = 3;</code> */ boolean hasObjectReference(); /** * <code>required string objectReference = 3;</code> */ java.lang.String getObjectReference(); /** * <code>required string objectReference = 3;</code> */ com.google.protobuf.ByteString getObjectReferenceBytes();
/** * <code>required string methodId = 4;</code> */ boolean hasMethodId(); /** * <code>required string methodId = 4;</code> */ java.lang.String getMethodId(); /** * <code>required string methodId = 4;</code> */ com.google.protobuf.ByteString getMethodIdBytes();
/** * <code>required bytes arguments = 5;</code> */ boolean hasArguments(); /** * <code>required bytes arguments = 5;</code> */ com.google.protobuf.ByteString getArguments(); } /** * Protobuf type {@code filmes.Mensagem} */ public static final class Mensagem extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:filmes.Mensagem) MensagemOrBuilder { // Use Mensagem.newBuilder() to construct. private Mensagem(com.google.protobuf.GeneratedMessage.Builder<?> builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } private Mensagem(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final Mensagem defaultInstance; public static Mensagem getDefaultInstance() { return defaultInstance; }
public Mensagem getDefaultInstanceForType() { return defaultInstance; }
private final com.google.protobuf.UnknownFieldSet unknownFields; @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private Mensagem( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } break; } case 8: { bitField0_ |= 0x00000001; messageType_ = input.readInt32(); break; } case 16: { bitField0_ |= 0x00000002; requestId_ = input.readInt32(); break; } case 26: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000004; objectReference_ = bs; break; } case 34: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000008; methodId_ = bs; break; } case 42: { bitField0_ |= 0x00000010; arguments_ = input.readBytes(); break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return filmoteca.Filmoteca.internal_static_filmes_Mensagem_descriptor; }
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return filmoteca.Filmoteca.internal_static_filmes_Mensagem_fieldAccessorTable .ensureFieldAccessorsInitialized( filmoteca.Filmoteca.Mensagem.class, filmoteca.Filmoteca.Mensagem.Builder.class); }
public static com.google.protobuf.Parser<Mensagem> PARSER = new com.google.protobuf.AbstractParser<Mensagem>() { public Mensagem parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new Mensagem(input, extensionRegistry); } };
@java.lang.Override public com.google.protobuf.Parser<Mensagem> getParserForType() { return PARSER; }
private int bitField0_; public static final int MESSAGETYPE_FIELD_NUMBER = 1; private int messageType_; /** * <code>required int32 messageType = 1;</code> */ public boolean hasMessageType() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>required int32 messageType = 1;</code> */ public int getMessageType() { return messageType_; }
public static final int REQUESTID_FIELD_NUMBER = 2; private int requestId_; /** * <code>required int32 requestId = 2;</code> */ public boolean hasRequestId() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <code>required int32 requestId = 2;</code> */ public int getRequestId() { return requestId_; }
public static final int OBJECTREFERENCE_FIELD_NUMBER = 3; private java.lang.Object objectReference_; /** * <code>required string objectReference = 3;</code> */ public boolean hasObjectReference() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <code>required string objectReference = 3;</code> */ public java.lang.String getObjectReference() { java.lang.Object ref = objectReference_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { objectReference_ = s; } return s; } } /** * <code>required string objectReference = 3;</code> */ public com.google.protobuf.ByteString getObjectReferenceBytes() { java.lang.Object ref = objectReference_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); objectReference_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } }
public static final int METHODID_FIELD_NUMBER = 4; private java.lang.Object methodId_; /** * <code>required string methodId = 4;</code> */ public boolean hasMethodId() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** * <code>required string methodId = 4;</code> */ public java.lang.String getMethodId() { java.lang.Object ref = methodId_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { methodId_ = s; } return s; } } /** * <code>required string methodId = 4;</code> */ public com.google.protobuf.ByteString getMethodIdBytes() { java.lang.Object ref = methodId_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); methodId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } }
public static final int ARGUMENTS_FIELD_NUMBER = 5; private com.google.protobuf.ByteString arguments_; /** * <code>required bytes arguments = 5;</code> */ public boolean hasArguments() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** * <code>required bytes arguments = 5;</code> */ public com.google.protobuf.ByteString getArguments() { return arguments_; }
private void initFields() { messageType_ = 0; requestId_ = 0; objectReference_ = ""; methodId_ = ""; arguments_ = com.google.protobuf.ByteString.EMPTY; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false;
if (!hasMessageType()) { memoizedIsInitialized = 0; return false; } if (!hasRequestId()) { memoizedIsInitialized = 0; return false; } if (!hasObjectReference()) { memoizedIsInitialized = 0; return false; } if (!hasMethodId()) { memoizedIsInitialized = 0; return false; } if (!hasArguments()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, messageType_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeInt32(2, requestId_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBytes(3, getObjectReferenceBytes()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeBytes(4, getMethodIdBytes()); } if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeBytes(5, arguments_); } getUnknownFields().writeTo(output); }
private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size;
size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(1, messageType_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(2, requestId_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(3, getObjectReferenceBytes()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(4, getMethodIdBytes()); } if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(5, arguments_); } 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 filmoteca.Filmoteca.Mensagem parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static filmoteca.Filmoteca.Mensagem parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static filmoteca.Filmoteca.Mensagem parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static filmoteca.Filmoteca.Mensagem parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static filmoteca.Filmoteca.Mensagem parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static filmoteca.Filmoteca.Mensagem parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } public static filmoteca.Filmoteca.Mensagem parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } public static filmoteca.Filmoteca.Mensagem parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static filmoteca.Filmoteca.Mensagem parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static filmoteca.Filmoteca.Mensagem parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); }
public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(filmoteca.Filmoteca.Mensagem prototype) { return newBuilder().mergeFrom(prototype); } 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; } /** * Protobuf type {@code filmes.Mensagem} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:filmes.Mensagem) filmoteca.Filmoteca.MensagemOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return filmoteca.Filmoteca.internal_static_filmes_Mensagem_descriptor; }
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return filmoteca.Filmoteca.internal_static_filmes_Mensagem_fieldAccessorTable .ensureFieldAccessorsInitialized( filmoteca.Filmoteca.Mensagem.class, filmoteca.Filmoteca.Mensagem.Builder.class); }
// Construct using filmoteca.Filmoteca.Mensagem.newBuilder() private Builder() { maybeForceBuilderInitialization(); }
private Builder( com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { } } private static Builder create() { return new Builder(); }
public Builder clear() { super.clear(); messageType_ = 0; bitField0_ = (bitField0_ & ~0x00000001); requestId_ = 0; bitField0_ = (bitField0_ & ~0x00000002); objectReference_ = ""; bitField0_ = (bitField0_ & ~0x00000004); methodId_ = ""; bitField0_ = (bitField0_ & ~0x00000008); arguments_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000010); return this; }
public Builder clone() { return create().mergeFrom(buildPartial()); }
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return filmoteca.Filmoteca.internal_static_filmes_Mensagem_descriptor; }
public filmoteca.Filmoteca.Mensagem getDefaultInstanceForType() { return filmoteca.Filmoteca.Mensagem.getDefaultInstance(); }
public filmoteca.Filmoteca.Mensagem build() { filmoteca.Filmoteca.Mensagem result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public filmoteca.Filmoteca.Mensagem buildPartial() { filmoteca.Filmoteca.Mensagem result = new filmoteca.Filmoteca.Mensagem(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.messageType_ = messageType_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.requestId_ = requestId_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } result.objectReference_ = objectReference_; if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000008; } result.methodId_ = methodId_; if (((from_bitField0_ & 0x00000010) == 0x00000010)) { to_bitField0_ |= 0x00000010; } result.arguments_ = arguments_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof filmoteca.Filmoteca.Mensagem) { return mergeFrom((filmoteca.Filmoteca.Mensagem)other); } else { super.mergeFrom(other); return this; } }
public Builder mergeFrom(filmoteca.Filmoteca.Mensagem other) { if (other == filmoteca.Filmoteca.Mensagem.getDefaultInstance()) return this; if (other.hasMessageType()) { setMessageType(other.getMessageType()); } if (other.hasRequestId()) { setRequestId(other.getRequestId()); } if (other.hasObjectReference()) { bitField0_ |= 0x00000004; objectReference_ = other.objectReference_; onChanged(); } if (other.hasMethodId()) { bitField0_ |= 0x00000008; methodId_ = other.methodId_; onChanged(); } if (other.hasArguments()) { setArguments(other.getArguments()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public final boolean isInitialized() { if (!hasMessageType()) { return false; } if (!hasRequestId()) { return false; } if (!hasObjectReference()) { return false; } if (!hasMethodId()) { return false; } if (!hasArguments()) { return false; } return true; }
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { filmoteca.Filmoteca.Mensagem parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (filmoteca.Filmoteca.Mensagem) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
private int messageType_ ; /** * <code>required int32 messageType = 1;</code> */ public boolean hasMessageType() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>required int32 messageType = 1;</code> */ public int getMessageType() { return messageType_; } /** * <code>required int32 messageType = 1;</code> */ public Builder setMessageType(int value) { bitField0_ |= 0x00000001; messageType_ = value; onChanged(); return this; } /** * <code>required int32 messageType = 1;</code> */ public Builder clearMessageType() { bitField0_ = (bitField0_ & ~0x00000001); messageType_ = 0; onChanged(); return this; }
private int requestId_ ; /** * <code>required int32 requestId = 2;</code> */ public boolean hasRequestId() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <code>required int32 requestId = 2;</code> */ public int getRequestId() { return requestId_; } /** * <code>required int32 requestId = 2;</code> */ public Builder setRequestId(int value) { bitField0_ |= 0x00000002; requestId_ = value; onChanged(); return this; } /** * <code>required int32 requestId = 2;</code> */ public Builder clearRequestId() { bitField0_ = (bitField0_ & ~0x00000002); requestId_ = 0; onChanged(); return this; }
private java.lang.Object objectReference_ = ""; /** * <code>required string objectReference = 3;</code> */ public boolean hasObjectReference() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <code>required string objectReference = 3;</code> */ public java.lang.String getObjectReference() { java.lang.Object ref = objectReference_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { objectReference_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>required string objectReference = 3;</code> */ public com.google.protobuf.ByteString getObjectReferenceBytes() { java.lang.Object ref = objectReference_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); objectReference_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>required string objectReference = 3;</code> */ public Builder setObjectReference( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000004; objectReference_ = value; onChanged(); return this; } /** * <code>required string objectReference = 3;</code> */ public Builder clearObjectReference() { bitField0_ = (bitField0_ & ~0x00000004); objectReference_ = getDefaultInstance().getObjectReference(); onChanged(); return this; } /** * <code>required string objectReference = 3;</code> */ public Builder setObjectReferenceBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000004; objectReference_ = value; onChanged(); return this; }
private java.lang.Object methodId_ = ""; /** * <code>required string methodId = 4;</code> */ public boolean hasMethodId() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** * <code>required string methodId = 4;</code> */ public java.lang.String getMethodId() { java.lang.Object ref = methodId_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { methodId_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>required string methodId = 4;</code> */ public com.google.protobuf.ByteString getMethodIdBytes() { java.lang.Object ref = methodId_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); methodId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>required string methodId = 4;</code> */ public Builder setMethodId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000008; methodId_ = value; onChanged(); return this; } /** * <code>required string methodId = 4;</code> */ public Builder clearMethodId() { bitField0_ = (bitField0_ & ~0x00000008); methodId_ = getDefaultInstance().getMethodId(); onChanged(); return this; } /** * <code>required string methodId = 4;</code> */ public Builder setMethodIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000008; methodId_ = value; onChanged(); return this; }
private com.google.protobuf.ByteString arguments_ = com.google.protobuf.ByteString.EMPTY; /** * <code>required bytes arguments = 5;</code> */ public boolean hasArguments() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** * <code>required bytes arguments = 5;</code> */ public com.google.protobuf.ByteString getArguments() { return arguments_; } /** * <code>required bytes arguments = 5;</code> */ public Builder setArguments(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000010; arguments_ = value; onChanged(); return this; } /** * <code>required bytes arguments = 5;</code> */ public Builder clearArguments() { bitField0_ = (bitField0_ & ~0x00000010); arguments_ = getDefaultInstance().getArguments(); onChanged(); return this; }
// @@protoc_insertion_point(builder_scope:filmes.Mensagem) }
static { defaultInstance = new Mensagem(true); defaultInstance.initFields(); }
// @@protoc_insertion_point(class_scope:filmes.Mensagem) }
public interface FilmeOrBuilder extends // @@protoc_insertion_point(interface_extends:filmes.Filme) com.google.protobuf.MessageOrBuilder {
/** * <code>required int32 id = 1;</code> */ boolean hasId(); /** * <code>required int32 id = 1;</code> */ int getId();
/** * <code>required string nome = 2;</code> */ boolean hasNome(); /** * <code>required string nome = 2;</code> */ java.lang.String getNome(); /** * <code>required string nome = 2;</code> */ com.google.protobuf.ByteString getNomeBytes();
/** * <code>required string genero = 3;</code> */ boolean hasGenero(); /** * <code>required string genero = 3;</code> */ java.lang.String getGenero(); /** * <code>required string genero = 3;</code> */ com.google.protobuf.ByteString getGeneroBytes();
/** * <code>required int32 ano = 4;</code> */ boolean hasAno(); /** * <code>required int32 ano = 4;</code> */ int getAno();
/** * <code>required string diretor = 5;</code> */ boolean hasDiretor(); /** * <code>required string diretor = 5;</code> */ java.lang.String getDiretor(); /** * <code>required string diretor = 5;</code> */ com.google.protobuf.ByteString getDiretorBytes();
/** * <code>required string status = 6;</code> */ boolean hasStatus(); /** * <code>required string status = 6;</code> */ java.lang.String getStatus(); /** * <code>required string status = 6;</code> */ com.google.protobuf.ByteString getStatusBytes(); } /** * Protobuf type {@code filmes.Filme} */ public static final class Filme extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:filmes.Filme) FilmeOrBuilder { // Use Filme.newBuilder() to construct. private Filme(com.google.protobuf.GeneratedMessage.Builder<?> builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } private Filme(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final Filme defaultInstance; public static Filme getDefaultInstance() { return defaultInstance; }
public Filme getDefaultInstanceForType() { return defaultInstance; }
private final com.google.protobuf.UnknownFieldSet unknownFields; @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private Filme( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } break; } case 8: { bitField0_ |= 0x00000001; id_ = input.readInt32(); break; } case 18: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000002; nome_ = bs; break; } case 26: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000004; genero_ = bs; break; } case 32: { bitField0_ |= 0x00000008; ano_ = input.readInt32(); break; } case 42: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000010; diretor_ = bs; break; } case 50: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000020; status_ = bs; break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return filmoteca.Filmoteca.internal_static_filmes_Filme_descriptor; }
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return filmoteca.Filmoteca.internal_static_filmes_Filme_fieldAccessorTable .ensureFieldAccessorsInitialized( filmoteca.Filmoteca.Filme.class, filmoteca.Filmoteca.Filme.Builder.class); }
public static com.google.protobuf.Parser<Filme> PARSER = new com.google.protobuf.AbstractParser<Filme>() { public Filme parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new Filme(input, extensionRegistry); } };
@java.lang.Override public com.google.protobuf.Parser<Filme> getParserForType() { return PARSER; }
private int bitField0_; public static final int ID_FIELD_NUMBER = 1; private int id_; /** * <code>required int32 id = 1;</code> */ public boolean hasId() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>required int32 id = 1;</code> */ public int getId() { return id_; }
public static final int NOME_FIELD_NUMBER = 2; private java.lang.Object nome_; /** * <code>required string nome = 2;</code> */ public boolean hasNome() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <code>required string nome = 2;</code> */ public java.lang.String getNome() { java.lang.Object ref = nome_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { nome_ = s; } return s; } } /** * <code>required string nome = 2;</code> */ public com.google.protobuf.ByteString getNomeBytes() { java.lang.Object ref = nome_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); nome_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } }
public static final int GENERO_FIELD_NUMBER = 3; private java.lang.Object genero_; /** * <code>required string genero = 3;</code> */ public boolean hasGenero() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <code>required string genero = 3;</code> */ public java.lang.String getGenero() { java.lang.Object ref = genero_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { genero_ = s; } return s; } } /** * <code>required string genero = 3;</code> */ public com.google.protobuf.ByteString getGeneroBytes() { java.lang.Object ref = genero_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); genero_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } }
public static final int ANO_FIELD_NUMBER = 4; private int ano_; /** * <code>required int32 ano = 4;</code> */ public boolean hasAno() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** * <code>required int32 ano = 4;</code> */ public int getAno() { return ano_; }
public static final int DIRETOR_FIELD_NUMBER = 5; private java.lang.Object diretor_; /** * <code>required string diretor = 5;</code> */ public boolean hasDiretor() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** * <code>required string diretor = 5;</code> */ public java.lang.String getDiretor() { java.lang.Object ref = diretor_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { diretor_ = s; } return s; } } /** * <code>required string diretor = 5;</code> */ public com.google.protobuf.ByteString getDiretorBytes() { java.lang.Object ref = diretor_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); diretor_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } }
public static final int STATUS_FIELD_NUMBER = 6; private java.lang.Object status_; /** * <code>required string status = 6;</code> */ public boolean hasStatus() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** * <code>required string status = 6;</code> */ public java.lang.String getStatus() { java.lang.Object ref = status_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { status_ = s; } return s; } } /** * <code>required string status = 6;</code> */ public com.google.protobuf.ByteString getStatusBytes() { java.lang.Object ref = status_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); status_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } }
private void initFields() { id_ = 0; nome_ = ""; genero_ = ""; ano_ = 0; diretor_ = ""; status_ = ""; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false;
if (!hasId()) { memoizedIsInitialized = 0; return false; } if (!hasNome()) { memoizedIsInitialized = 0; return false; } if (!hasGenero()) { memoizedIsInitialized = 0; return false; } if (!hasAno()) { memoizedIsInitialized = 0; return false; } if (!hasDiretor()) { memoizedIsInitialized = 0; return false; } if (!hasStatus()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, id_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeBytes(2, getNomeBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBytes(3, getGeneroBytes()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeInt32(4, ano_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeBytes(5, getDiretorBytes()); } if (((bitField0_ & 0x00000020) == 0x00000020)) { output.writeBytes(6, getStatusBytes()); } getUnknownFields().writeTo(output); }
private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size;
size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(1, id_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(2, getNomeBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(3, getGeneroBytes()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(4, ano_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(5, getDiretorBytes()); } if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(6, getStatusBytes()); } 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 filmoteca.Filmoteca.Filme parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static filmoteca.Filmoteca.Filme parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static filmoteca.Filmoteca.Filme parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static filmoteca.Filmoteca.Filme parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static filmoteca.Filmoteca.Filme parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static filmoteca.Filmoteca.Filme parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } public static filmoteca.Filmoteca.Filme parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } public static filmoteca.Filmoteca.Filme parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static filmoteca.Filmoteca.Filme parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static filmoteca.Filmoteca.Filme parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); }
public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(filmoteca.Filmoteca.Filme prototype) { return newBuilder().mergeFrom(prototype); } 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; } /** * Protobuf type {@code filmes.Filme} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:filmes.Filme) filmoteca.Filmoteca.FilmeOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return filmoteca.Filmoteca.internal_static_filmes_Filme_descriptor; }
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return filmoteca.Filmoteca.internal_static_filmes_Filme_fieldAccessorTable .ensureFieldAccessorsInitialized( filmoteca.Filmoteca.Filme.class, filmoteca.Filmoteca.Filme.Builder.class); }
// Construct using filmoteca.Filmoteca.Filme.newBuilder() private Builder() { maybeForceBuilderInitialization(); }
private Builder( com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { } } private static Builder create() { return new Builder(); }
public Builder clear() { super.clear(); id_ = 0; bitField0_ = (bitField0_ & ~0x00000001); nome_ = ""; bitField0_ = (bitField0_ & ~0x00000002); genero_ = ""; bitField0_ = (bitField0_ & ~0x00000004); ano_ = 0; bitField0_ = (bitField0_ & ~0x00000008); diretor_ = ""; bitField0_ = (bitField0_ & ~0x00000010); status_ = ""; bitField0_ = (bitField0_ & ~0x00000020); return this; }
public Builder clone() { return create().mergeFrom(buildPartial()); }
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return filmoteca.Filmoteca.internal_static_filmes_Filme_descriptor; }
public filmoteca.Filmoteca.Filme getDefaultInstanceForType() { return filmoteca.Filmoteca.Filme.getDefaultInstance(); }
public filmoteca.Filmoteca.Filme build() { filmoteca.Filmoteca.Filme result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public filmoteca.Filmoteca.Filme buildPartial() { filmoteca.Filmoteca.Filme result = new filmoteca.Filmoteca.Filme(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.id_ = id_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.nome_ = nome_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } result.genero_ = genero_; if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000008; } result.ano_ = ano_; if (((from_bitField0_ & 0x00000010) == 0x00000010)) { to_bitField0_ |= 0x00000010; } result.diretor_ = diretor_; if (((from_bitField0_ & 0x00000020) == 0x00000020)) { to_bitField0_ |= 0x00000020; } result.status_ = status_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof filmoteca.Filmoteca.Filme) { return mergeFrom((filmoteca.Filmoteca.Filme)other); } else { super.mergeFrom(other); return this; } }
public Builder mergeFrom(filmoteca.Filmoteca.Filme other) { if (other == filmoteca.Filmoteca.Filme.getDefaultInstance()) return this; if (other.hasId()) { setId(other.getId()); } if (other.hasNome()) { bitField0_ |= 0x00000002; nome_ = other.nome_; onChanged(); } if (other.hasGenero()) { bitField0_ |= 0x00000004; genero_ = other.genero_; onChanged(); } if (other.hasAno()) { setAno(other.getAno()); } if (other.hasDiretor()) { bitField0_ |= 0x00000010; diretor_ = other.diretor_; onChanged(); } if (other.hasStatus()) { bitField0_ |= 0x00000020; status_ = other.status_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public final boolean isInitialized() { if (!hasId()) { return false; } if (!hasNome()) { return false; } if (!hasGenero()) { return false; } if (!hasAno()) { return false; } if (!hasDiretor()) { return false; } if (!hasStatus()) { return false; } return true; }
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { filmoteca.Filmoteca.Filme parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (filmoteca.Filmoteca.Filme) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
private int id_ ; /** * <code>required int32 id = 1;</code> */ public boolean hasId() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>required int32 id = 1;</code> */ public int getId() { return id_; } /** * <code>required int32 id = 1;</code> */ public Builder setId(int value) { bitField0_ |= 0x00000001; id_ = value; onChanged(); return this; } /** * <code>required int32 id = 1;</code> */ public Builder clearId() { bitField0_ = (bitField0_ & ~0x00000001); id_ = 0; onChanged(); return this; }
private java.lang.Object nome_ = ""; /** * <code>required string nome = 2;</code> */ public boolean hasNome() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <code>required string nome = 2;</code> */ public java.lang.String getNome() { java.lang.Object ref = nome_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { nome_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>required string nome = 2;</code> */ public com.google.protobuf.ByteString getNomeBytes() { java.lang.Object ref = nome_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); nome_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>required string nome = 2;</code> */ public Builder setNome( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000002; nome_ = value; onChanged(); return this; } /** * <code>required string nome = 2;</code> */ public Builder clearNome() { bitField0_ = (bitField0_ & ~0x00000002); nome_ = getDefaultInstance().getNome(); onChanged(); return this; } /** * <code>required string nome = 2;</code> */ public Builder setNomeBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000002; nome_ = value; onChanged(); return this; }
private java.lang.Object genero_ = ""; /** * <code>required string genero = 3;</code> */ public boolean hasGenero() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <code>required string genero = 3;</code> */ public java.lang.String getGenero() { java.lang.Object ref = genero_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { genero_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>required string genero = 3;</code> */ public com.google.protobuf.ByteString getGeneroBytes() { java.lang.Object ref = genero_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); genero_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>required string genero = 3;</code> */ public Builder setGenero( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000004; genero_ = value; onChanged(); return this; } /** * <code>required string genero = 3;</code> */ public Builder clearGenero() { bitField0_ = (bitField0_ & ~0x00000004); genero_ = getDefaultInstance().getGenero(); onChanged(); return this; } /** * <code>required string genero = 3;</code> */ public Builder setGeneroBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000004; genero_ = value; onChanged(); return this; }
private int ano_ ; /** * <code>required int32 ano = 4;</code> */ public boolean hasAno() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** * <code>required int32 ano = 4;</code> */ public int getAno() { return ano_; } /** * <code>required int32 ano = 4;</code> */ public Builder setAno(int value) { bitField0_ |= 0x00000008; ano_ = value; onChanged(); return this; } /** * <code>required int32 ano = 4;</code> */ public Builder clearAno() { bitField0_ = (bitField0_ & ~0x00000008); ano_ = 0; onChanged(); return this; }
private java.lang.Object diretor_ = ""; /** * <code>required string diretor = 5;</code> */ public boolean hasDiretor() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** * <code>required string diretor = 5;</code> */ public java.lang.String getDiretor() { java.lang.Object ref = diretor_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { diretor_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>required string diretor = 5;</code> */ public com.google.protobuf.ByteString getDiretorBytes() { java.lang.Object ref = diretor_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); diretor_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>required string diretor = 5;</code> */ public Builder setDiretor( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000010; diretor_ = value; onChanged(); return this; } /** * <code>required string diretor = 5;</code> */ public Builder clearDiretor() { bitField0_ = (bitField0_ & ~0x00000010); diretor_ = getDefaultInstance().getDiretor(); onChanged(); return this; } /** * <code>required string diretor = 5;</code> */ public Builder setDiretorBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000010; diretor_ = value; onChanged(); return this; }
private java.lang.Object status_ = ""; /** * <code>required string status = 6;</code> */ public boolean hasStatus() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** * <code>required string status = 6;</code> */ public java.lang.String getStatus() { java.lang.Object ref = status_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { status_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>required string status = 6;</code> */ public com.google.protobuf.ByteString getStatusBytes() { java.lang.Object ref = status_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); status_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>required string status = 6;</code> */ public Builder setStatus( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000020; status_ = value; onChanged(); return this; } /** * <code>required string status = 6;</code> */ public Builder clearStatus() { bitField0_ = (bitField0_ & ~0x00000020); status_ = getDefaultInstance().getStatus(); onChanged(); return this; } /** * <code>required string status = 6;</code> */ public Builder setStatusBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000020; status_ = value; onChanged(); return this; }
// @@protoc_insertion_point(builder_scope:filmes.Filme) }
static { defaultInstance = new Filme(true); defaultInstance.initFields(); }
// @@protoc_insertion_point(class_scope:filmes.Filme) }
public interface RespostaOrBuilder extends // @@protoc_insertion_point(interface_extends:filmes.Resposta) com.google.protobuf.MessageOrBuilder {
/** * <code>required string mensagem = 1;</code> */ boolean hasMensagem(); /** * <code>required string mensagem = 1;</code> */ java.lang.String getMensagem(); /** * <code>required string mensagem = 1;</code> */ com.google.protobuf.ByteString getMensagemBytes(); } /** * Protobuf type {@code filmes.Resposta} */ public static final class Resposta extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:filmes.Resposta) RespostaOrBuilder { // Use Resposta.newBuilder() to construct. private Resposta(com.google.protobuf.GeneratedMessage.Builder<?> builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } private Resposta(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final Resposta defaultInstance; public static Resposta getDefaultInstance() { return defaultInstance; }
public Resposta getDefaultInstanceForType() { return defaultInstance; }
private final com.google.protobuf.UnknownFieldSet unknownFields; @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private Resposta( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } break; } case 10: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000001; mensagem_ = bs; break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return filmoteca.Filmoteca.internal_static_filmes_Resposta_descriptor; }
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return filmoteca.Filmoteca.internal_static_filmes_Resposta_fieldAccessorTable .ensureFieldAccessorsInitialized( filmoteca.Filmoteca.Resposta.class, filmoteca.Filmoteca.Resposta.Builder.class); }
public static com.google.protobuf.Parser<Resposta> PARSER = new com.google.protobuf.AbstractParser<Resposta>() { public Resposta parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new Resposta(input, extensionRegistry); } };
@java.lang.Override public com.google.protobuf.Parser<Resposta> getParserForType() { return PARSER; }
private int bitField0_; public static final int MENSAGEM_FIELD_NUMBER = 1; private java.lang.Object mensagem_; /** * <code>required string mensagem = 1;</code> */ public boolean hasMensagem() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>required string mensagem = 1;</code> */ public java.lang.String getMensagem() { java.lang.Object ref = mensagem_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { mensagem_ = s; } return s; } } /** * <code>required string mensagem = 1;</code> */ public com.google.protobuf.ByteString getMensagemBytes() { java.lang.Object ref = mensagem_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); mensagem_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } }
private void initFields() { mensagem_ = ""; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false;
if (!hasMensagem()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeBytes(1, getMensagemBytes()); } getUnknownFields().writeTo(output); }
private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size;
size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, getMensagemBytes()); } 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 filmoteca.Filmoteca.Resposta parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static filmoteca.Filmoteca.Resposta parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static filmoteca.Filmoteca.Resposta parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static filmoteca.Filmoteca.Resposta parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static filmoteca.Filmoteca.Resposta parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static filmoteca.Filmoteca.Resposta parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } public static filmoteca.Filmoteca.Resposta parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } public static filmoteca.Filmoteca.Resposta parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static filmoteca.Filmoteca.Resposta parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static filmoteca.Filmoteca.Resposta parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); }
public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(filmoteca.Filmoteca.Resposta prototype) { return newBuilder().mergeFrom(prototype); } 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; } /** * Protobuf type {@code filmes.Resposta} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:filmes.Resposta) filmoteca.Filmoteca.RespostaOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return filmoteca.Filmoteca.internal_static_filmes_Resposta_descriptor; }
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return filmoteca.Filmoteca.internal_static_filmes_Resposta_fieldAccessorTable .ensureFieldAccessorsInitialized( filmoteca.Filmoteca.Resposta.class, filmoteca.Filmoteca.Resposta.Builder.class); }
// Construct using filmoteca.Filmoteca.Resposta.newBuilder() private Builder() { maybeForceBuilderInitialization(); }
private Builder( com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { } } private static Builder create() { return new Builder(); }
public Builder clear() { super.clear(); mensagem_ = ""; bitField0_ = (bitField0_ & ~0x00000001); return this; }
public Builder clone() { return create().mergeFrom(buildPartial()); }
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return filmoteca.Filmoteca.internal_static_filmes_Resposta_descriptor; }
public filmoteca.Filmoteca.Resposta getDefaultInstanceForType() { return filmoteca.Filmoteca.Resposta.getDefaultInstance(); }
public filmoteca.Filmoteca.Resposta build() { filmoteca.Filmoteca.Resposta result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public filmoteca.Filmoteca.Resposta buildPartial() { filmoteca.Filmoteca.Resposta result = new filmoteca.Filmoteca.Resposta(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.mensagem_ = mensagem_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof filmoteca.Filmoteca.Resposta) { return mergeFrom((filmoteca.Filmoteca.Resposta)other); } else { super.mergeFrom(other); return this; } }
public Builder mergeFrom(filmoteca.Filmoteca.Resposta other) { if (other == filmoteca.Filmoteca.Resposta.getDefaultInstance()) return this; if (other.hasMensagem()) { bitField0_ |= 0x00000001; mensagem_ = other.mensagem_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public final boolean isInitialized() { if (!hasMensagem()) { return false; } return true; }
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { filmoteca.Filmoteca.Resposta parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (filmoteca.Filmoteca.Resposta) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
private java.lang.Object mensagem_ = ""; /** * <code>required string mensagem = 1;</code> */ public boolean hasMensagem() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>required string mensagem = 1;</code> */ public java.lang.String getMensagem() { java.lang.Object ref = mensagem_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { mensagem_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>required string mensagem = 1;</code> */ public com.google.protobuf.ByteString getMensagemBytes() { java.lang.Object ref = mensagem_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); mensagem_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>required string mensagem = 1;</code> */ public Builder setMensagem( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000001; mensagem_ = value; onChanged(); return this; } /** * <code>required string mensagem = 1;</code> */ public Builder clearMensagem() { bitField0_ = (bitField0_ & ~0x00000001); mensagem_ = getDefaultInstance().getMensagem(); onChanged(); return this; } /** * <code>required string mensagem = 1;</code> */ public Builder setMensagemBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000001; mensagem_ = value; onChanged(); return this; }
// @@protoc_insertion_point(builder_scope:filmes.Resposta) }
static { defaultInstance = new Resposta(true); defaultInstance.initFields(); }
// @@protoc_insertion_point(class_scope:filmes.Resposta) }
public interface ListaFilmeOrBuilder extends // @@protoc_insertion_point(interface_extends:filmes.ListaFilme) com.google.protobuf.MessageOrBuilder {
/** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ java.util.List<filmoteca.Filmoteca.ListaFilme.InstanciaFilme> getFilmeList(); /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ filmoteca.Filmoteca.ListaFilme.InstanciaFilme getFilme(int index); /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ int getFilmeCount(); /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ java.util.List<? extends filmoteca.Filmoteca.ListaFilme.InstanciaFilmeOrBuilder> getFilmeOrBuilderList(); /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ filmoteca.Filmoteca.ListaFilme.InstanciaFilmeOrBuilder getFilmeOrBuilder( int index); } /** * Protobuf type {@code filmes.ListaFilme} */ public static final class ListaFilme extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:filmes.ListaFilme) ListaFilmeOrBuilder { // Use ListaFilme.newBuilder() to construct. private ListaFilme(com.google.protobuf.GeneratedMessage.Builder<?> builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } private ListaFilme(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final ListaFilme defaultInstance; public static ListaFilme getDefaultInstance() { return defaultInstance; }
public ListaFilme getDefaultInstanceForType() { return defaultInstance; }
private final com.google.protobuf.UnknownFieldSet unknownFields; @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private ListaFilme( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } break; } case 10: { if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { filme_ = new java.util.ArrayList<filmoteca.Filmoteca.ListaFilme.InstanciaFilme>(); mutable_bitField0_ |= 0x00000001; } filme_.add(input.readMessage(filmoteca.Filmoteca.ListaFilme.InstanciaFilme.PARSER, extensionRegistry)); break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { filme_ = java.util.Collections.unmodifiableList(filme_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return filmoteca.Filmoteca.internal_static_filmes_ListaFilme_descriptor; }
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return filmoteca.Filmoteca.internal_static_filmes_ListaFilme_fieldAccessorTable .ensureFieldAccessorsInitialized( filmoteca.Filmoteca.ListaFilme.class, filmoteca.Filmoteca.ListaFilme.Builder.class); }
public static com.google.protobuf.Parser<ListaFilme> PARSER = new com.google.protobuf.AbstractParser<ListaFilme>() { public ListaFilme parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new ListaFilme(input, extensionRegistry); } };
@java.lang.Override public com.google.protobuf.Parser<ListaFilme> getParserForType() { return PARSER; }
public interface InstanciaFilmeOrBuilder extends // @@protoc_insertion_point(interface_extends:filmes.ListaFilme.InstanciaFilme) com.google.protobuf.MessageOrBuilder {
/** * <code>required int32 idi = 1;</code> */ boolean hasIdi(); /** * <code>required int32 idi = 1;</code> */ int getIdi();
/** * <code>required string nomei = 2;</code> */ boolean hasNomei(); /** * <code>required string nomei = 2;</code> */ java.lang.String getNomei(); /** * <code>required string nomei = 2;</code> */ com.google.protobuf.ByteString getNomeiBytes();
/** * <code>required string generoi = 3;</code> */ boolean hasGeneroi(); /** * <code>required string generoi = 3;</code> */ java.lang.String getGeneroi(); /** * <code>required string generoi = 3;</code> */ com.google.protobuf.ByteString getGeneroiBytes();
/** * <code>required int32 anoi = 4;</code> */ boolean hasAnoi(); /** * <code>required int32 anoi = 4;</code> */ int getAnoi();
/** * <code>required string diretori = 5;</code> */ boolean hasDiretori(); /** * <code>required string diretori = 5;</code> */ java.lang.String getDiretori(); /** * <code>required string diretori = 5;</code> */ com.google.protobuf.ByteString getDiretoriBytes();
/** * <code>required string statusi = 6;</code> */ boolean hasStatusi(); /** * <code>required string statusi = 6;</code> */ java.lang.String getStatusi(); /** * <code>required string statusi = 6;</code> */ com.google.protobuf.ByteString getStatusiBytes(); } /** * Protobuf type {@code filmes.ListaFilme.InstanciaFilme} */ public static final class InstanciaFilme extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:filmes.ListaFilme.InstanciaFilme) InstanciaFilmeOrBuilder { // Use InstanciaFilme.newBuilder() to construct. private InstanciaFilme(com.google.protobuf.GeneratedMessage.Builder<?> builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } private InstanciaFilme(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final InstanciaFilme defaultInstance; public static InstanciaFilme getDefaultInstance() { return defaultInstance; }
public InstanciaFilme getDefaultInstanceForType() { return defaultInstance; }
private final com.google.protobuf.UnknownFieldSet unknownFields; @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private InstanciaFilme( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } break; } case 8: { bitField0_ |= 0x00000001; idi_ = input.readInt32(); break; } case 18: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000002; nomei_ = bs; break; } case 26: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000004; generoi_ = bs; break; } case 32: { bitField0_ |= 0x00000008; anoi_ = input.readInt32(); break; } case 42: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000010; diretori_ = bs; break; } case 50: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000020; statusi_ = bs; break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return filmoteca.Filmoteca.internal_static_filmes_ListaFilme_InstanciaFilme_descriptor; }
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return filmoteca.Filmoteca.internal_static_filmes_ListaFilme_InstanciaFilme_fieldAccessorTable .ensureFieldAccessorsInitialized( filmoteca.Filmoteca.ListaFilme.InstanciaFilme.class, filmoteca.Filmoteca.ListaFilme.InstanciaFilme.Builder.class); }
public static com.google.protobuf.Parser<InstanciaFilme> PARSER = new com.google.protobuf.AbstractParser<InstanciaFilme>() { public InstanciaFilme parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new InstanciaFilme(input, extensionRegistry); } };
@java.lang.Override public com.google.protobuf.Parser<InstanciaFilme> getParserForType() { return PARSER; }
private int bitField0_; public static final int IDI_FIELD_NUMBER = 1; private int idi_; /** * <code>required int32 idi = 1;</code> */ public boolean hasIdi() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>required int32 idi = 1;</code> */ public int getIdi() { return idi_; }
public static final int NOMEI_FIELD_NUMBER = 2; private java.lang.Object nomei_; /** * <code>required string nomei = 2;</code> */ public boolean hasNomei() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <code>required string nomei = 2;</code> */ public java.lang.String getNomei() { java.lang.Object ref = nomei_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { nomei_ = s; } return s; } } /** * <code>required string nomei = 2;</code> */ public com.google.protobuf.ByteString getNomeiBytes() { java.lang.Object ref = nomei_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); nomei_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } }
public static final int GENEROI_FIELD_NUMBER = 3; private java.lang.Object generoi_; /** * <code>required string generoi = 3;</code> */ public boolean hasGeneroi() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <code>required string generoi = 3;</code> */ public java.lang.String getGeneroi() { java.lang.Object ref = generoi_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { generoi_ = s; } return s; } } /** * <code>required string generoi = 3;</code> */ public com.google.protobuf.ByteString getGeneroiBytes() { java.lang.Object ref = generoi_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); generoi_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } }
public static final int ANOI_FIELD_NUMBER = 4; private int anoi_; /** * <code>required int32 anoi = 4;</code> */ public boolean hasAnoi() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** * <code>required int32 anoi = 4;</code> */ public int getAnoi() { return anoi_; }
public static final int DIRETORI_FIELD_NUMBER = 5; private java.lang.Object diretori_; /** * <code>required string diretori = 5;</code> */ public boolean hasDiretori() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** * <code>required string diretori = 5;</code> */ public java.lang.String getDiretori() { java.lang.Object ref = diretori_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { diretori_ = s; } return s; } } /** * <code>required string diretori = 5;</code> */ public com.google.protobuf.ByteString getDiretoriBytes() { java.lang.Object ref = diretori_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); diretori_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } }
public static final int STATUSI_FIELD_NUMBER = 6; private java.lang.Object statusi_; /** * <code>required string statusi = 6;</code> */ public boolean hasStatusi() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** * <code>required string statusi = 6;</code> */ public java.lang.String getStatusi() { java.lang.Object ref = statusi_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { statusi_ = s; } return s; } } /** * <code>required string statusi = 6;</code> */ public com.google.protobuf.ByteString getStatusiBytes() { java.lang.Object ref = statusi_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); statusi_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } }
private void initFields() { idi_ = 0; nomei_ = ""; generoi_ = ""; anoi_ = 0; diretori_ = ""; statusi_ = ""; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false;
if (!hasIdi()) { memoizedIsInitialized = 0; return false; } if (!hasNomei()) { memoizedIsInitialized = 0; return false; } if (!hasGeneroi()) { memoizedIsInitialized = 0; return false; } if (!hasAnoi()) { memoizedIsInitialized = 0; return false; } if (!hasDiretori()) { memoizedIsInitialized = 0; return false; } if (!hasStatusi()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, idi_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeBytes(2, getNomeiBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBytes(3, getGeneroiBytes()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeInt32(4, anoi_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeBytes(5, getDiretoriBytes()); } if (((bitField0_ & 0x00000020) == 0x00000020)) { output.writeBytes(6, getStatusiBytes()); } getUnknownFields().writeTo(output); }
private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size;
size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(1, idi_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(2, getNomeiBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(3, getGeneroiBytes()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(4, anoi_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(5, getDiretoriBytes()); } if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(6, getStatusiBytes()); } 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 filmoteca.Filmoteca.ListaFilme.InstanciaFilme parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static filmoteca.Filmoteca.ListaFilme.InstanciaFilme parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static filmoteca.Filmoteca.ListaFilme.InstanciaFilme parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static filmoteca.Filmoteca.ListaFilme.InstanciaFilme parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static filmoteca.Filmoteca.ListaFilme.InstanciaFilme parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static filmoteca.Filmoteca.ListaFilme.InstanciaFilme parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } public static filmoteca.Filmoteca.ListaFilme.InstanciaFilme parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } public static filmoteca.Filmoteca.ListaFilme.InstanciaFilme parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static filmoteca.Filmoteca.ListaFilme.InstanciaFilme parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static filmoteca.Filmoteca.ListaFilme.InstanciaFilme parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); }
public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(filmoteca.Filmoteca.ListaFilme.InstanciaFilme prototype) { return newBuilder().mergeFrom(prototype); } 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; } /** * Protobuf type {@code filmes.ListaFilme.InstanciaFilme} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:filmes.ListaFilme.InstanciaFilme) filmoteca.Filmoteca.ListaFilme.InstanciaFilmeOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return filmoteca.Filmoteca.internal_static_filmes_ListaFilme_InstanciaFilme_descriptor; }
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return filmoteca.Filmoteca.internal_static_filmes_ListaFilme_InstanciaFilme_fieldAccessorTable .ensureFieldAccessorsInitialized( filmoteca.Filmoteca.ListaFilme.InstanciaFilme.class, filmoteca.Filmoteca.ListaFilme.InstanciaFilme.Builder.class); }
// Construct using filmoteca.Filmoteca.ListaFilme.InstanciaFilme.newBuilder() private Builder() { maybeForceBuilderInitialization(); }
private Builder( com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { } } private static Builder create() { return new Builder(); }
public Builder clear() { super.clear(); idi_ = 0; bitField0_ = (bitField0_ & ~0x00000001); nomei_ = ""; bitField0_ = (bitField0_ & ~0x00000002); generoi_ = ""; bitField0_ = (bitField0_ & ~0x00000004); anoi_ = 0; bitField0_ = (bitField0_ & ~0x00000008); diretori_ = ""; bitField0_ = (bitField0_ & ~0x00000010); statusi_ = ""; bitField0_ = (bitField0_ & ~0x00000020); return this; }
public Builder clone() { return create().mergeFrom(buildPartial()); }
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return filmoteca.Filmoteca.internal_static_filmes_ListaFilme_InstanciaFilme_descriptor; }
public filmoteca.Filmoteca.ListaFilme.InstanciaFilme getDefaultInstanceForType() { return filmoteca.Filmoteca.ListaFilme.InstanciaFilme.getDefaultInstance(); }
public filmoteca.Filmoteca.ListaFilme.InstanciaFilme build() { filmoteca.Filmoteca.ListaFilme.InstanciaFilme result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public filmoteca.Filmoteca.ListaFilme.InstanciaFilme buildPartial() { filmoteca.Filmoteca.ListaFilme.InstanciaFilme result = new filmoteca.Filmoteca.ListaFilme.InstanciaFilme(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.idi_ = idi_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.nomei_ = nomei_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } result.generoi_ = generoi_; if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000008; } result.anoi_ = anoi_; if (((from_bitField0_ & 0x00000010) == 0x00000010)) { to_bitField0_ |= 0x00000010; } result.diretori_ = diretori_; if (((from_bitField0_ & 0x00000020) == 0x00000020)) { to_bitField0_ |= 0x00000020; } result.statusi_ = statusi_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof filmoteca.Filmoteca.ListaFilme.InstanciaFilme) { return mergeFrom((filmoteca.Filmoteca.ListaFilme.InstanciaFilme)other); } else { super.mergeFrom(other); return this; } }
public Builder mergeFrom(filmoteca.Filmoteca.ListaFilme.InstanciaFilme other) { if (other == filmoteca.Filmoteca.ListaFilme.InstanciaFilme.getDefaultInstance()) return this; if (other.hasIdi()) { setIdi(other.getIdi()); } if (other.hasNomei()) { bitField0_ |= 0x00000002; nomei_ = other.nomei_; onChanged(); } if (other.hasGeneroi()) { bitField0_ |= 0x00000004; generoi_ = other.generoi_; onChanged(); } if (other.hasAnoi()) { setAnoi(other.getAnoi()); } if (other.hasDiretori()) { bitField0_ |= 0x00000010; diretori_ = other.diretori_; onChanged(); } if (other.hasStatusi()) { bitField0_ |= 0x00000020; statusi_ = other.statusi_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public final boolean isInitialized() { if (!hasIdi()) { return false; } if (!hasNomei()) { return false; } if (!hasGeneroi()) { return false; } if (!hasAnoi()) { return false; } if (!hasDiretori()) { return false; } if (!hasStatusi()) { return false; } return true; }
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { filmoteca.Filmoteca.ListaFilme.InstanciaFilme parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (filmoteca.Filmoteca.ListaFilme.InstanciaFilme) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
private int idi_ ; /** * <code>required int32 idi = 1;</code> */ public boolean hasIdi() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>required int32 idi = 1;</code> */ public int getIdi() { return idi_; } /** * <code>required int32 idi = 1;</code> */ public Builder setIdi(int value) { bitField0_ |= 0x00000001; idi_ = value; onChanged(); return this; } /** * <code>required int32 idi = 1;</code> */ public Builder clearIdi() { bitField0_ = (bitField0_ & ~0x00000001); idi_ = 0; onChanged(); return this; }
private java.lang.Object nomei_ = ""; /** * <code>required string nomei = 2;</code> */ public boolean hasNomei() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <code>required string nomei = 2;</code> */ public java.lang.String getNomei() { java.lang.Object ref = nomei_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { nomei_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>required string nomei = 2;</code> */ public com.google.protobuf.ByteString getNomeiBytes() { java.lang.Object ref = nomei_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); nomei_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>required string nomei = 2;</code> */ public Builder setNomei( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000002; nomei_ = value; onChanged(); return this; } /** * <code>required string nomei = 2;</code> */ public Builder clearNomei() { bitField0_ = (bitField0_ & ~0x00000002); nomei_ = getDefaultInstance().getNomei(); onChanged(); return this; } /** * <code>required string nomei = 2;</code> */ public Builder setNomeiBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000002; nomei_ = value; onChanged(); return this; }
private java.lang.Object generoi_ = ""; /** * <code>required string generoi = 3;</code> */ public boolean hasGeneroi() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <code>required string generoi = 3;</code> */ public java.lang.String getGeneroi() { java.lang.Object ref = generoi_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { generoi_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>required string generoi = 3;</code> */ public com.google.protobuf.ByteString getGeneroiBytes() { java.lang.Object ref = generoi_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); generoi_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>required string generoi = 3;</code> */ public Builder setGeneroi( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000004; generoi_ = value; onChanged(); return this; } /** * <code>required string generoi = 3;</code> */ public Builder clearGeneroi() { bitField0_ = (bitField0_ & ~0x00000004); generoi_ = getDefaultInstance().getGeneroi(); onChanged(); return this; } /** * <code>required string generoi = 3;</code> */ public Builder setGeneroiBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000004; generoi_ = value; onChanged(); return this; }
private int anoi_ ; /** * <code>required int32 anoi = 4;</code> */ public boolean hasAnoi() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** * <code>required int32 anoi = 4;</code> */ public int getAnoi() { return anoi_; } /** * <code>required int32 anoi = 4;</code> */ public Builder setAnoi(int value) { bitField0_ |= 0x00000008; anoi_ = value; onChanged(); return this; } /** * <code>required int32 anoi = 4;</code> */ public Builder clearAnoi() { bitField0_ = (bitField0_ & ~0x00000008); anoi_ = 0; onChanged(); return this; }
private java.lang.Object diretori_ = ""; /** * <code>required string diretori = 5;</code> */ public boolean hasDiretori() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** * <code>required string diretori = 5;</code> */ public java.lang.String getDiretori() { java.lang.Object ref = diretori_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { diretori_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>required string diretori = 5;</code> */ public com.google.protobuf.ByteString getDiretoriBytes() { java.lang.Object ref = diretori_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); diretori_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>required string diretori = 5;</code> */ public Builder setDiretori( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000010; diretori_ = value; onChanged(); return this; } /** * <code>required string diretori = 5;</code> */ public Builder clearDiretori() { bitField0_ = (bitField0_ & ~0x00000010); diretori_ = getDefaultInstance().getDiretori(); onChanged(); return this; } /** * <code>required string diretori = 5;</code> */ public Builder setDiretoriBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000010; diretori_ = value; onChanged(); return this; }
private java.lang.Object statusi_ = ""; /** * <code>required string statusi = 6;</code> */ public boolean hasStatusi() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** * <code>required string statusi = 6;</code> */ public java.lang.String getStatusi() { java.lang.Object ref = statusi_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { statusi_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>required string statusi = 6;</code> */ public com.google.protobuf.ByteString getStatusiBytes() { java.lang.Object ref = statusi_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); statusi_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>required string statusi = 6;</code> */ public Builder setStatusi( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000020; statusi_ = value; onChanged(); return this; } /** * <code>required string statusi = 6;</code> */ public Builder clearStatusi() { bitField0_ = (bitField0_ & ~0x00000020); statusi_ = getDefaultInstance().getStatusi(); onChanged(); return this; } /** * <code>required string statusi = 6;</code> */ public Builder setStatusiBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000020; statusi_ = value; onChanged(); return this; }
// @@protoc_insertion_point(builder_scope:filmes.ListaFilme.InstanciaFilme) }
static { defaultInstance = new InstanciaFilme(true); defaultInstance.initFields(); }
// @@protoc_insertion_point(class_scope:filmes.ListaFilme.InstanciaFilme) }
public static final int FILME_FIELD_NUMBER = 1; private java.util.List<filmoteca.Filmoteca.ListaFilme.InstanciaFilme> filme_; /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public java.util.List<filmoteca.Filmoteca.ListaFilme.InstanciaFilme> getFilmeList() { return filme_; } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public java.util.List<? extends filmoteca.Filmoteca.ListaFilme.InstanciaFilmeOrBuilder> getFilmeOrBuilderList() { return filme_; } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public int getFilmeCount() { return filme_.size(); } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public filmoteca.Filmoteca.ListaFilme.InstanciaFilme getFilme(int index) { return filme_.get(index); } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public filmoteca.Filmoteca.ListaFilme.InstanciaFilmeOrBuilder getFilmeOrBuilder( int index) { return filme_.get(index); }
private void initFields() { filme_ = java.util.Collections.emptyList(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false;
for (int i = 0; i < getFilmeCount(); i++) { if (!getFilme(i).isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); for (int i = 0; i < filme_.size(); i++) { output.writeMessage(1, filme_.get(i)); } getUnknownFields().writeTo(output); }
private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size;
size = 0; for (int i = 0; i < filme_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, filme_.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 filmoteca.Filmoteca.ListaFilme parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static filmoteca.Filmoteca.ListaFilme parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static filmoteca.Filmoteca.ListaFilme parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static filmoteca.Filmoteca.ListaFilme parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static filmoteca.Filmoteca.ListaFilme parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static filmoteca.Filmoteca.ListaFilme parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } public static filmoteca.Filmoteca.ListaFilme parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } public static filmoteca.Filmoteca.ListaFilme parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static filmoteca.Filmoteca.ListaFilme parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static filmoteca.Filmoteca.ListaFilme parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); }
public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(filmoteca.Filmoteca.ListaFilme prototype) { return newBuilder().mergeFrom(prototype); } 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; } /** * Protobuf type {@code filmes.ListaFilme} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:filmes.ListaFilme) filmoteca.Filmoteca.ListaFilmeOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return filmoteca.Filmoteca.internal_static_filmes_ListaFilme_descriptor; }
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return filmoteca.Filmoteca.internal_static_filmes_ListaFilme_fieldAccessorTable .ensureFieldAccessorsInitialized( filmoteca.Filmoteca.ListaFilme.class, filmoteca.Filmoteca.ListaFilme.Builder.class); }
// Construct using filmoteca.Filmoteca.ListaFilme.newBuilder() private Builder() { maybeForceBuilderInitialization(); }
private Builder( com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { getFilmeFieldBuilder(); } } private static Builder create() { return new Builder(); }
public Builder clear() { super.clear(); if (filmeBuilder_ == null) { filme_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { filmeBuilder_.clear(); } return this; }
public Builder clone() { return create().mergeFrom(buildPartial()); }
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return filmoteca.Filmoteca.internal_static_filmes_ListaFilme_descriptor; }
public filmoteca.Filmoteca.ListaFilme getDefaultInstanceForType() { return filmoteca.Filmoteca.ListaFilme.getDefaultInstance(); }
public filmoteca.Filmoteca.ListaFilme build() { filmoteca.Filmoteca.ListaFilme result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public filmoteca.Filmoteca.ListaFilme buildPartial() { filmoteca.Filmoteca.ListaFilme result = new filmoteca.Filmoteca.ListaFilme(this); int from_bitField0_ = bitField0_; if (filmeBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001)) { filme_ = java.util.Collections.unmodifiableList(filme_); bitField0_ = (bitField0_ & ~0x00000001); } result.filme_ = filme_; } else { result.filme_ = filmeBuilder_.build(); } onBuilt(); return result; }
public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof filmoteca.Filmoteca.ListaFilme) { return mergeFrom((filmoteca.Filmoteca.ListaFilme)other); } else { super.mergeFrom(other); return this; } }
public Builder mergeFrom(filmoteca.Filmoteca.ListaFilme other) { if (other == filmoteca.Filmoteca.ListaFilme.getDefaultInstance()) return this; if (filmeBuilder_ == null) { if (!other.filme_.isEmpty()) { if (filme_.isEmpty()) { filme_ = other.filme_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureFilmeIsMutable(); filme_.addAll(other.filme_); } onChanged(); } } else { if (!other.filme_.isEmpty()) { if (filmeBuilder_.isEmpty()) { filmeBuilder_.dispose(); filmeBuilder_ = null; filme_ = other.filme_; bitField0_ = (bitField0_ & ~0x00000001); filmeBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getFilmeFieldBuilder() : null; } else { filmeBuilder_.addAllMessages(other.filme_); } } } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public final boolean isInitialized() { for (int i = 0; i < getFilmeCount(); i++) { if (!getFilme(i).isInitialized()) { return false; } } return true; }
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { filmoteca.Filmoteca.ListaFilme parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (filmoteca.Filmoteca.ListaFilme) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
private java.util.List<filmoteca.Filmoteca.ListaFilme.InstanciaFilme> filme_ = java.util.Collections.emptyList(); private void ensureFilmeIsMutable() { if (!((bitField0_ & 0x00000001) == 0x00000001)) { filme_ = new java.util.ArrayList<filmoteca.Filmoteca.ListaFilme.InstanciaFilme>(filme_); bitField0_ |= 0x00000001; } }
private com.google.protobuf.RepeatedFieldBuilder< filmoteca.Filmoteca.ListaFilme.InstanciaFilme, filmoteca.Filmoteca.ListaFilme.InstanciaFilme.Builder, filmoteca.Filmoteca.ListaFilme.InstanciaFilmeOrBuilder> filmeBuilder_;
/** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public java.util.List<filmoteca.Filmoteca.ListaFilme.InstanciaFilme> getFilmeList() { if (filmeBuilder_ == null) { return java.util.Collections.unmodifiableList(filme_); } else { return filmeBuilder_.getMessageList(); } } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public int getFilmeCount() { if (filmeBuilder_ == null) { return filme_.size(); } else { return filmeBuilder_.getCount(); } } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public filmoteca.Filmoteca.ListaFilme.InstanciaFilme getFilme(int index) { if (filmeBuilder_ == null) { return filme_.get(index); } else { return filmeBuilder_.getMessage(index); } } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public Builder setFilme( int index, filmoteca.Filmoteca.ListaFilme.InstanciaFilme value) { if (filmeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureFilmeIsMutable(); filme_.set(index, value); onChanged(); } else { filmeBuilder_.setMessage(index, value); } return this; } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public Builder setFilme( int index, filmoteca.Filmoteca.ListaFilme.InstanciaFilme.Builder builderForValue) { if (filmeBuilder_ == null) { ensureFilmeIsMutable(); filme_.set(index, builderForValue.build()); onChanged(); } else { filmeBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public Builder addFilme(filmoteca.Filmoteca.ListaFilme.InstanciaFilme value) { if (filmeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureFilmeIsMutable(); filme_.add(value); onChanged(); } else { filmeBuilder_.addMessage(value); } return this; } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public Builder addFilme( int index, filmoteca.Filmoteca.ListaFilme.InstanciaFilme value) { if (filmeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureFilmeIsMutable(); filme_.add(index, value); onChanged(); } else { filmeBuilder_.addMessage(index, value); } return this; } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public Builder addFilme( filmoteca.Filmoteca.ListaFilme.InstanciaFilme.Builder builderForValue) { if (filmeBuilder_ == null) { ensureFilmeIsMutable(); filme_.add(builderForValue.build()); onChanged(); } else { filmeBuilder_.addMessage(builderForValue.build()); } return this; } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public Builder addFilme( int index, filmoteca.Filmoteca.ListaFilme.InstanciaFilme.Builder builderForValue) { if (filmeBuilder_ == null) { ensureFilmeIsMutable(); filme_.add(index, builderForValue.build()); onChanged(); } else { filmeBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public Builder addAllFilme( java.lang.Iterable<? extends filmoteca.Filmoteca.ListaFilme.InstanciaFilme> values) { if (filmeBuilder_ == null) { ensureFilmeIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, filme_); onChanged(); } else { filmeBuilder_.addAllMessages(values); } return this; } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public Builder clearFilme() { if (filmeBuilder_ == null) { filme_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { filmeBuilder_.clear(); } return this; } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public Builder removeFilme(int index) { if (filmeBuilder_ == null) { ensureFilmeIsMutable(); filme_.remove(index); onChanged(); } else { filmeBuilder_.remove(index); } return this; } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public filmoteca.Filmoteca.ListaFilme.InstanciaFilme.Builder getFilmeBuilder( int index) { return getFilmeFieldBuilder().getBuilder(index); } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public filmoteca.Filmoteca.ListaFilme.InstanciaFilmeOrBuilder getFilmeOrBuilder( int index) { if (filmeBuilder_ == null) { return filme_.get(index); } else { return filmeBuilder_.getMessageOrBuilder(index); } } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public java.util.List<? extends filmoteca.Filmoteca.ListaFilme.InstanciaFilmeOrBuilder> getFilmeOrBuilderList() { if (filmeBuilder_ != null) { return filmeBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(filme_); } } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public filmoteca.Filmoteca.ListaFilme.InstanciaFilme.Builder addFilmeBuilder() { return getFilmeFieldBuilder().addBuilder( filmoteca.Filmoteca.ListaFilme.InstanciaFilme.getDefaultInstance()); } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public filmoteca.Filmoteca.ListaFilme.InstanciaFilme.Builder addFilmeBuilder( int index) { return getFilmeFieldBuilder().addBuilder( index, filmoteca.Filmoteca.ListaFilme.InstanciaFilme.getDefaultInstance()); } /** * <code>repeated .filmes.ListaFilme.InstanciaFilme filme = 1;</code> */ public java.util.List<filmoteca.Filmoteca.ListaFilme.InstanciaFilme.Builder> getFilmeBuilderList() { return getFilmeFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilder< filmoteca.Filmoteca.ListaFilme.InstanciaFilme, filmoteca.Filmoteca.ListaFilme.InstanciaFilme.Builder, filmoteca.Filmoteca.ListaFilme.InstanciaFilmeOrBuilder> getFilmeFieldBuilder() { if (filmeBuilder_ == null) { filmeBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< filmoteca.Filmoteca.ListaFilme.InstanciaFilme, filmoteca.Filmoteca.ListaFilme.InstanciaFilme.Builder, filmoteca.Filmoteca.ListaFilme.InstanciaFilmeOrBuilder>( filme_, ((bitField0_ & 0x00000001) == 0x00000001), getParentForChildren(), isClean()); filme_ = null; } return filmeBuilder_; }
// @@protoc_insertion_point(builder_scope:filmes.ListaFilme) }
static { defaultInstance = new ListaFilme(true); defaultInstance.initFields(); }
// @@protoc_insertion_point(class_scope:filmes.ListaFilme) }
public interface CadastraFilmeOrBuilder extends // @@protoc_insertion_point(interface_extends:filmes.CadastraFilme) com.google.protobuf.MessageOrBuilder {
/** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ java.util.List<filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2> getFilmecList(); /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 getFilmec(int index); /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ int getFilmecCount(); /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ java.util.List<? extends filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2OrBuilder> getFilmecOrBuilderList(); /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2OrBuilder getFilmecOrBuilder( int index); } /** * Protobuf type {@code filmes.CadastraFilme} */ public static final class CadastraFilme extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:filmes.CadastraFilme) CadastraFilmeOrBuilder { // Use CadastraFilme.newBuilder() to construct. private CadastraFilme(com.google.protobuf.GeneratedMessage.Builder<?> builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } private CadastraFilme(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final CadastraFilme defaultInstance; public static CadastraFilme getDefaultInstance() { return defaultInstance; }
public CadastraFilme getDefaultInstanceForType() { return defaultInstance; }
private final com.google.protobuf.UnknownFieldSet unknownFields; @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private CadastraFilme( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } break; } case 10: { if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { filmec_ = new java.util.ArrayList<filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2>(); mutable_bitField0_ |= 0x00000001; } filmec_.add(input.readMessage(filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.PARSER, extensionRegistry)); break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { filmec_ = java.util.Collections.unmodifiableList(filmec_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return filmoteca.Filmoteca.internal_static_filmes_CadastraFilme_descriptor; }
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return filmoteca.Filmoteca.internal_static_filmes_CadastraFilme_fieldAccessorTable .ensureFieldAccessorsInitialized( filmoteca.Filmoteca.CadastraFilme.class, filmoteca.Filmoteca.CadastraFilme.Builder.class); }
public static com.google.protobuf.Parser<CadastraFilme> PARSER = new com.google.protobuf.AbstractParser<CadastraFilme>() { public CadastraFilme parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new CadastraFilme(input, extensionRegistry); } };
@java.lang.Override public com.google.protobuf.Parser<CadastraFilme> getParserForType() { return PARSER; }
public interface InstanciaFilme2OrBuilder extends // @@protoc_insertion_point(interface_extends:filmes.CadastraFilme.InstanciaFilme2) com.google.protobuf.MessageOrBuilder {
/** * <code>required int32 idc = 1;</code> */ boolean hasIdc(); /** * <code>required int32 idc = 1;</code> */ int getIdc();
/** * <code>required string nomec = 2;</code> */ boolean hasNomec(); /** * <code>required string nomec = 2;</code> */ java.lang.String getNomec(); /** * <code>required string nomec = 2;</code> */ com.google.protobuf.ByteString getNomecBytes();
/** * <code>required string generoc = 3;</code> */ boolean hasGeneroc(); /** * <code>required string generoc = 3;</code> */ java.lang.String getGeneroc(); /** * <code>required string generoc = 3;</code> */ com.google.protobuf.ByteString getGenerocBytes();
/** * <code>required int32 anoc = 4;</code> */ boolean hasAnoc(); /** * <code>required int32 anoc = 4;</code> */ int getAnoc();
/** * <code>required string diretorc = 5;</code> */ boolean hasDiretorc(); /** * <code>required string diretorc = 5;</code> */ java.lang.String getDiretorc(); /** * <code>required string diretorc = 5;</code> */ com.google.protobuf.ByteString getDiretorcBytes();
/** * <code>required string statusc = 6;</code> */ boolean hasStatusc(); /** * <code>required string statusc = 6;</code> */ java.lang.String getStatusc(); /** * <code>required string statusc = 6;</code> */ com.google.protobuf.ByteString getStatuscBytes(); } /** * Protobuf type {@code filmes.CadastraFilme.InstanciaFilme2} */ public static final class InstanciaFilme2 extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:filmes.CadastraFilme.InstanciaFilme2) InstanciaFilme2OrBuilder { // Use InstanciaFilme2.newBuilder() to construct. private InstanciaFilme2(com.google.protobuf.GeneratedMessage.Builder<?> builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } private InstanciaFilme2(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final InstanciaFilme2 defaultInstance; public static InstanciaFilme2 getDefaultInstance() { return defaultInstance; }
public InstanciaFilme2 getDefaultInstanceForType() { return defaultInstance; }
private final com.google.protobuf.UnknownFieldSet unknownFields; @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private InstanciaFilme2( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } break; } case 8: { bitField0_ |= 0x00000001; idc_ = input.readInt32(); break; } case 18: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000002; nomec_ = bs; break; } case 26: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000004; generoc_ = bs; break; } case 32: { bitField0_ |= 0x00000008; anoc_ = input.readInt32(); break; } case 42: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000010; diretorc_ = bs; break; } case 50: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000020; statusc_ = bs; break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return filmoteca.Filmoteca.internal_static_filmes_CadastraFilme_InstanciaFilme2_descriptor; }
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return filmoteca.Filmoteca.internal_static_filmes_CadastraFilme_InstanciaFilme2_fieldAccessorTable .ensureFieldAccessorsInitialized( filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.class, filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.Builder.class); }
public static com.google.protobuf.Parser<InstanciaFilme2> PARSER = new com.google.protobuf.AbstractParser<InstanciaFilme2>() { public InstanciaFilme2 parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new InstanciaFilme2(input, extensionRegistry); } };
@java.lang.Override public com.google.protobuf.Parser<InstanciaFilme2> getParserForType() { return PARSER; }
private int bitField0_; public static final int IDC_FIELD_NUMBER = 1; private int idc_; /** * <code>required int32 idc = 1;</code> */ public boolean hasIdc() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>required int32 idc = 1;</code> */ public int getIdc() { return idc_; }
public static final int NOMEC_FIELD_NUMBER = 2; private java.lang.Object nomec_; /** * <code>required string nomec = 2;</code> */ public boolean hasNomec() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <code>required string nomec = 2;</code> */ public java.lang.String getNomec() { java.lang.Object ref = nomec_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { nomec_ = s; } return s; } } /** * <code>required string nomec = 2;</code> */ public com.google.protobuf.ByteString getNomecBytes() { java.lang.Object ref = nomec_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); nomec_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } }
public static final int GENEROC_FIELD_NUMBER = 3; private java.lang.Object generoc_; /** * <code>required string generoc = 3;</code> */ public boolean hasGeneroc() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <code>required string generoc = 3;</code> */ public java.lang.String getGeneroc() { java.lang.Object ref = generoc_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { generoc_ = s; } return s; } } /** * <code>required string generoc = 3;</code> */ public com.google.protobuf.ByteString getGenerocBytes() { java.lang.Object ref = generoc_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); generoc_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } }
public static final int ANOC_FIELD_NUMBER = 4; private int anoc_; /** * <code>required int32 anoc = 4;</code> */ public boolean hasAnoc() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** * <code>required int32 anoc = 4;</code> */ public int getAnoc() { return anoc_; }
public static final int DIRETORC_FIELD_NUMBER = 5; private java.lang.Object diretorc_; /** * <code>required string diretorc = 5;</code> */ public boolean hasDiretorc() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** * <code>required string diretorc = 5;</code> */ public java.lang.String getDiretorc() { java.lang.Object ref = diretorc_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { diretorc_ = s; } return s; } } /** * <code>required string diretorc = 5;</code> */ public com.google.protobuf.ByteString getDiretorcBytes() { java.lang.Object ref = diretorc_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); diretorc_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } }
public static final int STATUSC_FIELD_NUMBER = 6; private java.lang.Object statusc_; /** * <code>required string statusc = 6;</code> */ public boolean hasStatusc() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** * <code>required string statusc = 6;</code> */ public java.lang.String getStatusc() { java.lang.Object ref = statusc_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { statusc_ = s; } return s; } } /** * <code>required string statusc = 6;</code> */ public com.google.protobuf.ByteString getStatuscBytes() { java.lang.Object ref = statusc_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); statusc_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } }
private void initFields() { idc_ = 0; nomec_ = ""; generoc_ = ""; anoc_ = 0; diretorc_ = ""; statusc_ = ""; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false;
if (!hasIdc()) { memoizedIsInitialized = 0; return false; } if (!hasNomec()) { memoizedIsInitialized = 0; return false; } if (!hasGeneroc()) { memoizedIsInitialized = 0; return false; } if (!hasAnoc()) { memoizedIsInitialized = 0; return false; } if (!hasDiretorc()) { memoizedIsInitialized = 0; return false; } if (!hasStatusc()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, idc_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeBytes(2, getNomecBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBytes(3, getGenerocBytes()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeInt32(4, anoc_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeBytes(5, getDiretorcBytes()); } if (((bitField0_ & 0x00000020) == 0x00000020)) { output.writeBytes(6, getStatuscBytes()); } getUnknownFields().writeTo(output); }
private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size;
size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(1, idc_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(2, getNomecBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(3, getGenerocBytes()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(4, anoc_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(5, getDiretorcBytes()); } if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(6, getStatuscBytes()); } 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 filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } public static filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } public static filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); }
public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 prototype) { return newBuilder().mergeFrom(prototype); } 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; } /** * Protobuf type {@code filmes.CadastraFilme.InstanciaFilme2} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:filmes.CadastraFilme.InstanciaFilme2) filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2OrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return filmoteca.Filmoteca.internal_static_filmes_CadastraFilme_InstanciaFilme2_descriptor; }
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return filmoteca.Filmoteca.internal_static_filmes_CadastraFilme_InstanciaFilme2_fieldAccessorTable .ensureFieldAccessorsInitialized( filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.class, filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.Builder.class); }
// Construct using filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.newBuilder() private Builder() { maybeForceBuilderInitialization(); }
private Builder( com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { } } private static Builder create() { return new Builder(); }
public Builder clear() { super.clear(); idc_ = 0; bitField0_ = (bitField0_ & ~0x00000001); nomec_ = ""; bitField0_ = (bitField0_ & ~0x00000002); generoc_ = ""; bitField0_ = (bitField0_ & ~0x00000004); anoc_ = 0; bitField0_ = (bitField0_ & ~0x00000008); diretorc_ = ""; bitField0_ = (bitField0_ & ~0x00000010); statusc_ = ""; bitField0_ = (bitField0_ & ~0x00000020); return this; }
public Builder clone() { return create().mergeFrom(buildPartial()); }
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return filmoteca.Filmoteca.internal_static_filmes_CadastraFilme_InstanciaFilme2_descriptor; }
public filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 getDefaultInstanceForType() { return filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.getDefaultInstance(); }
public filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 build() { filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 buildPartial() { filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 result = new filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.idc_ = idc_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.nomec_ = nomec_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } result.generoc_ = generoc_; if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000008; } result.anoc_ = anoc_; if (((from_bitField0_ & 0x00000010) == 0x00000010)) { to_bitField0_ |= 0x00000010; } result.diretorc_ = diretorc_; if (((from_bitField0_ & 0x00000020) == 0x00000020)) { to_bitField0_ |= 0x00000020; } result.statusc_ = statusc_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2) { return mergeFrom((filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2)other); } else { super.mergeFrom(other); return this; } }
public Builder mergeFrom(filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 other) { if (other == filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.getDefaultInstance()) return this; if (other.hasIdc()) { setIdc(other.getIdc()); } if (other.hasNomec()) { bitField0_ |= 0x00000002; nomec_ = other.nomec_; onChanged(); } if (other.hasGeneroc()) { bitField0_ |= 0x00000004; generoc_ = other.generoc_; onChanged(); } if (other.hasAnoc()) { setAnoc(other.getAnoc()); } if (other.hasDiretorc()) { bitField0_ |= 0x00000010; diretorc_ = other.diretorc_; onChanged(); } if (other.hasStatusc()) { bitField0_ |= 0x00000020; statusc_ = other.statusc_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public final boolean isInitialized() { if (!hasIdc()) { return false; } if (!hasNomec()) { return false; } if (!hasGeneroc()) { return false; } if (!hasAnoc()) { return false; } if (!hasDiretorc()) { return false; } if (!hasStatusc()) { return false; } return true; }
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
private int idc_ ; /** * <code>required int32 idc = 1;</code> */ public boolean hasIdc() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * <code>required int32 idc = 1;</code> */ public int getIdc() { return idc_; } /** * <code>required int32 idc = 1;</code> */ public Builder setIdc(int value) { bitField0_ |= 0x00000001; idc_ = value; onChanged(); return this; } /** * <code>required int32 idc = 1;</code> */ public Builder clearIdc() { bitField0_ = (bitField0_ & ~0x00000001); idc_ = 0; onChanged(); return this; }
private java.lang.Object nomec_ = ""; /** * <code>required string nomec = 2;</code> */ public boolean hasNomec() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <code>required string nomec = 2;</code> */ public java.lang.String getNomec() { java.lang.Object ref = nomec_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { nomec_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>required string nomec = 2;</code> */ public com.google.protobuf.ByteString getNomecBytes() { java.lang.Object ref = nomec_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); nomec_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>required string nomec = 2;</code> */ public Builder setNomec( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000002; nomec_ = value; onChanged(); return this; } /** * <code>required string nomec = 2;</code> */ public Builder clearNomec() { bitField0_ = (bitField0_ & ~0x00000002); nomec_ = getDefaultInstance().getNomec(); onChanged(); return this; } /** * <code>required string nomec = 2;</code> */ public Builder setNomecBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000002; nomec_ = value; onChanged(); return this; }
private java.lang.Object generoc_ = ""; /** * <code>required string generoc = 3;</code> */ public boolean hasGeneroc() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <code>required string generoc = 3;</code> */ public java.lang.String getGeneroc() { java.lang.Object ref = generoc_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { generoc_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>required string generoc = 3;</code> */ public com.google.protobuf.ByteString getGenerocBytes() { java.lang.Object ref = generoc_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); generoc_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>required string generoc = 3;</code> */ public Builder setGeneroc( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000004; generoc_ = value; onChanged(); return this; } /** * <code>required string generoc = 3;</code> */ public Builder clearGeneroc() { bitField0_ = (bitField0_ & ~0x00000004); generoc_ = getDefaultInstance().getGeneroc(); onChanged(); return this; } /** * <code>required string generoc = 3;</code> */ public Builder setGenerocBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000004; generoc_ = value; onChanged(); return this; }
private int anoc_ ; /** * <code>required int32 anoc = 4;</code> */ public boolean hasAnoc() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** * <code>required int32 anoc = 4;</code> */ public int getAnoc() { return anoc_; } /** * <code>required int32 anoc = 4;</code> */ public Builder setAnoc(int value) { bitField0_ |= 0x00000008; anoc_ = value; onChanged(); return this; } /** * <code>required int32 anoc = 4;</code> */ public Builder clearAnoc() { bitField0_ = (bitField0_ & ~0x00000008); anoc_ = 0; onChanged(); return this; }
private java.lang.Object diretorc_ = ""; /** * <code>required string diretorc = 5;</code> */ public boolean hasDiretorc() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** * <code>required string diretorc = 5;</code> */ public java.lang.String getDiretorc() { java.lang.Object ref = diretorc_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { diretorc_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>required string diretorc = 5;</code> */ public com.google.protobuf.ByteString getDiretorcBytes() { java.lang.Object ref = diretorc_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); diretorc_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>required string diretorc = 5;</code> */ public Builder setDiretorc( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000010; diretorc_ = value; onChanged(); return this; } /** * <code>required string diretorc = 5;</code> */ public Builder clearDiretorc() { bitField0_ = (bitField0_ & ~0x00000010); diretorc_ = getDefaultInstance().getDiretorc(); onChanged(); return this; } /** * <code>required string diretorc = 5;</code> */ public Builder setDiretorcBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000010; diretorc_ = value; onChanged(); return this; }
private java.lang.Object statusc_ = ""; /** * <code>required string statusc = 6;</code> */ public boolean hasStatusc() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** * <code>required string statusc = 6;</code> */ public java.lang.String getStatusc() { java.lang.Object ref = statusc_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { statusc_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>required string statusc = 6;</code> */ public com.google.protobuf.ByteString getStatuscBytes() { java.lang.Object ref = statusc_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); statusc_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>required string statusc = 6;</code> */ public Builder setStatusc( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000020; statusc_ = value; onChanged(); return this; } /** * <code>required string statusc = 6;</code> */ public Builder clearStatusc() { bitField0_ = (bitField0_ & ~0x00000020); statusc_ = getDefaultInstance().getStatusc(); onChanged(); return this; } /** * <code>required string statusc = 6;</code> */ public Builder setStatuscBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000020; statusc_ = value; onChanged(); return this; }
// @@protoc_insertion_point(builder_scope:filmes.CadastraFilme.InstanciaFilme2) }
static { defaultInstance = new InstanciaFilme2(true); defaultInstance.initFields(); }
// @@protoc_insertion_point(class_scope:filmes.CadastraFilme.InstanciaFilme2) }
public static final int FILMEC_FIELD_NUMBER = 1; private java.util.List<filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2> filmec_; /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public java.util.List<filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2> getFilmecList() { return filmec_; } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public java.util.List<? extends filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2OrBuilder> getFilmecOrBuilderList() { return filmec_; } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public int getFilmecCount() { return filmec_.size(); } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 getFilmec(int index) { return filmec_.get(index); } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2OrBuilder getFilmecOrBuilder( int index) { return filmec_.get(index); }
private void initFields() { filmec_ = java.util.Collections.emptyList(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false;
for (int i = 0; i < getFilmecCount(); i++) { if (!getFilmec(i).isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); for (int i = 0; i < filmec_.size(); i++) { output.writeMessage(1, filmec_.get(i)); } getUnknownFields().writeTo(output); }
private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size;
size = 0; for (int i = 0; i < filmec_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, filmec_.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 filmoteca.Filmoteca.CadastraFilme parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static filmoteca.Filmoteca.CadastraFilme parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static filmoteca.Filmoteca.CadastraFilme parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static filmoteca.Filmoteca.CadastraFilme parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static filmoteca.Filmoteca.CadastraFilme parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static filmoteca.Filmoteca.CadastraFilme parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } public static filmoteca.Filmoteca.CadastraFilme parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } public static filmoteca.Filmoteca.CadastraFilme parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static filmoteca.Filmoteca.CadastraFilme parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } public static filmoteca.Filmoteca.CadastraFilme parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); }
public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(filmoteca.Filmoteca.CadastraFilme prototype) { return newBuilder().mergeFrom(prototype); } 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; } /** * Protobuf type {@code filmes.CadastraFilme} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:filmes.CadastraFilme) filmoteca.Filmoteca.CadastraFilmeOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return filmoteca.Filmoteca.internal_static_filmes_CadastraFilme_descriptor; }
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return filmoteca.Filmoteca.internal_static_filmes_CadastraFilme_fieldAccessorTable .ensureFieldAccessorsInitialized( filmoteca.Filmoteca.CadastraFilme.class, filmoteca.Filmoteca.CadastraFilme.Builder.class); }
// Construct using filmoteca.Filmoteca.CadastraFilme.newBuilder() private Builder() { maybeForceBuilderInitialization(); }
private Builder( com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { getFilmecFieldBuilder(); } } private static Builder create() { return new Builder(); }
public Builder clear() { super.clear(); if (filmecBuilder_ == null) { filmec_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { filmecBuilder_.clear(); } return this; }
public Builder clone() { return create().mergeFrom(buildPartial()); }
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return filmoteca.Filmoteca.internal_static_filmes_CadastraFilme_descriptor; }
public filmoteca.Filmoteca.CadastraFilme getDefaultInstanceForType() { return filmoteca.Filmoteca.CadastraFilme.getDefaultInstance(); }
public filmoteca.Filmoteca.CadastraFilme build() { filmoteca.Filmoteca.CadastraFilme result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public filmoteca.Filmoteca.CadastraFilme buildPartial() { filmoteca.Filmoteca.CadastraFilme result = new filmoteca.Filmoteca.CadastraFilme(this); int from_bitField0_ = bitField0_; if (filmecBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001)) { filmec_ = java.util.Collections.unmodifiableList(filmec_); bitField0_ = (bitField0_ & ~0x00000001); } result.filmec_ = filmec_; } else { result.filmec_ = filmecBuilder_.build(); } onBuilt(); return result; }
public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof filmoteca.Filmoteca.CadastraFilme) { return mergeFrom((filmoteca.Filmoteca.CadastraFilme)other); } else { super.mergeFrom(other); return this; } }
public Builder mergeFrom(filmoteca.Filmoteca.CadastraFilme other) { if (other == filmoteca.Filmoteca.CadastraFilme.getDefaultInstance()) return this; if (filmecBuilder_ == null) { if (!other.filmec_.isEmpty()) { if (filmec_.isEmpty()) { filmec_ = other.filmec_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureFilmecIsMutable(); filmec_.addAll(other.filmec_); } onChanged(); } } else { if (!other.filmec_.isEmpty()) { if (filmecBuilder_.isEmpty()) { filmecBuilder_.dispose(); filmecBuilder_ = null; filmec_ = other.filmec_; bitField0_ = (bitField0_ & ~0x00000001); filmecBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getFilmecFieldBuilder() : null; } else { filmecBuilder_.addAllMessages(other.filmec_); } } } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public final boolean isInitialized() { for (int i = 0; i < getFilmecCount(); i++) { if (!getFilmec(i).isInitialized()) { return false; } } return true; }
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { filmoteca.Filmoteca.CadastraFilme parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (filmoteca.Filmoteca.CadastraFilme) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
private java.util.List<filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2> filmec_ = java.util.Collections.emptyList(); private void ensureFilmecIsMutable() { if (!((bitField0_ & 0x00000001) == 0x00000001)) { filmec_ = new java.util.ArrayList<filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2>(filmec_); bitField0_ |= 0x00000001; } }
private com.google.protobuf.RepeatedFieldBuilder< filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2, filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.Builder, filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2OrBuilder> filmecBuilder_;
/** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public java.util.List<filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2> getFilmecList() { if (filmecBuilder_ == null) { return java.util.Collections.unmodifiableList(filmec_); } else { return filmecBuilder_.getMessageList(); } } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public int getFilmecCount() { if (filmecBuilder_ == null) { return filmec_.size(); } else { return filmecBuilder_.getCount(); } } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 getFilmec(int index) { if (filmecBuilder_ == null) { return filmec_.get(index); } else { return filmecBuilder_.getMessage(index); } } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public Builder setFilmec( int index, filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 value) { if (filmecBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureFilmecIsMutable(); filmec_.set(index, value); onChanged(); } else { filmecBuilder_.setMessage(index, value); } return this; } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public Builder setFilmec( int index, filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.Builder builderForValue) { if (filmecBuilder_ == null) { ensureFilmecIsMutable(); filmec_.set(index, builderForValue.build()); onChanged(); } else { filmecBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public Builder addFilmec(filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 value) { if (filmecBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureFilmecIsMutable(); filmec_.add(value); onChanged(); } else { filmecBuilder_.addMessage(value); } return this; } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public Builder addFilmec( int index, filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2 value) { if (filmecBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureFilmecIsMutable(); filmec_.add(index, value); onChanged(); } else { filmecBuilder_.addMessage(index, value); } return this; } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public Builder addFilmec( filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.Builder builderForValue) { if (filmecBuilder_ == null) { ensureFilmecIsMutable(); filmec_.add(builderForValue.build()); onChanged(); } else { filmecBuilder_.addMessage(builderForValue.build()); } return this; } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public Builder addFilmec( int index, filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.Builder builderForValue) { if (filmecBuilder_ == null) { ensureFilmecIsMutable(); filmec_.add(index, builderForValue.build()); onChanged(); } else { filmecBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public Builder addAllFilmec( java.lang.Iterable<? extends filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2> values) { if (filmecBuilder_ == null) { ensureFilmecIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, filmec_); onChanged(); } else { filmecBuilder_.addAllMessages(values); } return this; } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public Builder clearFilmec() { if (filmecBuilder_ == null) { filmec_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { filmecBuilder_.clear(); } return this; } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public Builder removeFilmec(int index) { if (filmecBuilder_ == null) { ensureFilmecIsMutable(); filmec_.remove(index); onChanged(); } else { filmecBuilder_.remove(index); } return this; } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.Builder getFilmecBuilder( int index) { return getFilmecFieldBuilder().getBuilder(index); } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2OrBuilder getFilmecOrBuilder( int index) { if (filmecBuilder_ == null) { return filmec_.get(index); } else { return filmecBuilder_.getMessageOrBuilder(index); } } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public java.util.List<? extends filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2OrBuilder> getFilmecOrBuilderList() { if (filmecBuilder_ != null) { return filmecBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(filmec_); } } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.Builder addFilmecBuilder() { return getFilmecFieldBuilder().addBuilder( filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.getDefaultInstance()); } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.Builder addFilmecBuilder( int index) { return getFilmecFieldBuilder().addBuilder( index, filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.getDefaultInstance()); } /** * <code>repeated .filmes.CadastraFilme.InstanciaFilme2 filmec = 1;</code> */ public java.util.List<filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.Builder> getFilmecBuilderList() { return getFilmecFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilder< filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2, filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.Builder, filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2OrBuilder> getFilmecFieldBuilder() { if (filmecBuilder_ == null) { filmecBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2, filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2.Builder, filmoteca.Filmoteca.CadastraFilme.InstanciaFilme2OrBuilder>( filmec_, ((bitField0_ & 0x00000001) == 0x00000001), getParentForChildren(), isClean()); filmec_ = null; } return filmecBuilder_; }
// @@protoc_insertion_point(builder_scope:filmes.CadastraFilme) }
static { defaultInstance = new CadastraFilme(true); defaultInstance.initFields(); }
// @@protoc_insertion_point(class_scope:filmes.CadastraFilme) }
private static final com.google.protobuf.Descriptors.Descriptor internal_static_filmes_Mensagem_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_filmes_Mensagem_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_filmes_Filme_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_filmes_Filme_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_filmes_Resposta_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_filmes_Resposta_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_filmes_ListaFilme_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_filmes_ListaFilme_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_filmes_ListaFilme_InstanciaFilme_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_filmes_ListaFilme_InstanciaFilme_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_filmes_CadastraFilme_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_filmes_CadastraFilme_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_filmes_CadastraFilme_InstanciaFilme2_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_filmes_CadastraFilme_InstanciaFilme2_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; } private static com.google.protobuf.Descriptors.FileDescriptor descriptor; static { java.lang.String[] descriptorData = { "\n\017mensagem2.proto\022\006filmes\"p\n\010Mensagem\022\023\n" + "\013messageType\030\001 \002(\005\022\021\n\trequestId\030\002 \002(\005\022\027\n" + "\017objectReference\030\003 \002(\t\022\020\n\010methodId\030\004 \002(\t" + "\022\021\n\targuments\030\005 \002(\014\"_\n\005Filme\022\n\n\002id\030\001 \002(\005" + "\022\014\n\004nome\030\002 \002(\t\022\016\n\006genero\030\003 \002(\t\022\013\n\003ano\030\004 " + "\002(\005\022\017\n\007diretor\030\005 \002(\t\022\016\n\006status\030\006 \002(\t\"\034\n\010" + "Resposta\022\020\n\010mensagem\030\001 \002(\t\"\256\001\n\nListaFilm" + "e\0220\n\005filme\030\001 \003(\0132!.filmes.ListaFilme.Ins" + "tanciaFilme\032n\n\016InstanciaFilme\022\013\n\003idi\030\001 \002" + "(\005\022\r\n\005nomei\030\002 \002(\t\022\017\n\007generoi\030\003 \002(\t\022\014\n\004an", "oi\030\004 \002(\005\022\020\n\010diretori\030\005 \002(\t\022\017\n\007statusi\030\006 " + "\002(\t\"\267\001\n\rCadastraFilme\0225\n\006filmec\030\001 \003(\0132%." + "filmes.CadastraFilme.InstanciaFilme2\032o\n\017" + "InstanciaFilme2\022\013\n\003idc\030\001 \002(\005\022\r\n\005nomec\030\002 " + "\002(\t\022\017\n\007generoc\030\003 \002(\t\022\014\n\004anoc\030\004 \002(\005\022\020\n\010di" + "retorc\030\005 \002(\t\022\017\n\007statusc\030\006 \002(\tB\026\n\tfilmote" + "caB\tFilmoteca" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.Descriptors.FileDescriptor root) { descriptor = root; return null; } }; com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { }, assigner); internal_static_filmes_Mensagem_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_filmes_Mensagem_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_filmes_Mensagem_descriptor, new java.lang.String[] { "MessageType", "RequestId", "ObjectReference", "MethodId", "Arguments", }); internal_static_filmes_Filme_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_filmes_Filme_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_filmes_Filme_descriptor, new java.lang.String[] { "Id", "Nome", "Genero", "Ano", "Diretor", "Status", }); internal_static_filmes_Resposta_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_filmes_Resposta_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_filmes_Resposta_descriptor, new java.lang.String[] { "Mensagem", }); internal_static_filmes_ListaFilme_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_filmes_ListaFilme_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_filmes_ListaFilme_descriptor, new java.lang.String[] { "Filme", }); internal_static_filmes_ListaFilme_InstanciaFilme_descriptor = internal_static_filmes_ListaFilme_descriptor.getNestedTypes().get(0); internal_static_filmes_ListaFilme_InstanciaFilme_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_filmes_ListaFilme_InstanciaFilme_descriptor, new java.lang.String[] { "Idi", "Nomei", "Generoi", "Anoi", "Diretori", "Statusi", }); internal_static_filmes_CadastraFilme_descriptor = getDescriptor().getMessageTypes().get(4); internal_static_filmes_CadastraFilme_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_filmes_CadastraFilme_descriptor, new java.lang.String[] { "Filmec", }); internal_static_filmes_CadastraFilme_InstanciaFilme2_descriptor = internal_static_filmes_CadastraFilme_descriptor.getNestedTypes().get(0); internal_static_filmes_CadastraFilme_InstanciaFilme2_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_filmes_CadastraFilme_InstanciaFilme2_descriptor, new java.lang.String[] { "Idc", "Nomec", "Generoc", "Anoc", "Diretorc", "Statusc", }); }
// @@protoc_insertion_point(outer_class_scope) }
1 note · View note
realtimeconfeu-blog · 12 years ago
Text
Learning How To Let Go: Improving performance with binary data-interchange formats and protocols
Kyle Drake participated to all Realtime Confs so far! He's been one of the true groupies and he'll now get to be on stage. Until recently he worked for Geoloqi, a started which combined geolocation and realtime and eventually got acquired by ESRI.
At Realtime Conf Europe, he'll tell us about about formats and how to improve the thruput of your API using stuff like Protocol Buffers, Message Pack and BSON:
Human readable formats like JSON have become very popular in recent years, and it's no question why. There is something very comfortable about being able to take the data going through your system, and just paste it into a text editor or console to work with it, and easily read it.
Binary formats and protocols used to dominate computing, mainly to deal with limitations in the bandwidth and CPU constraints. As our machines and internet connections (compared to the modems of the past), many have opted to accept the trades off of being "human readable" and easier to work with, at the cost of some inefficiency.
However, this is not always a good tradeoff. As we start dealing with the challenges of increased popularity of large-data services, it becomes important to find ways to minimize the amount of data "boilerplate" needed to transfer information.
I will introduce some of the concepts of both binary formats (like MessagePack and BSON) and transport protocols like Protocol Buffers, and show how to easily use them in your systems. I will also show novel ways to simultaneously provide both binary and JSON output for your APIs, giving your developers an efficiency improvement choice that does not require a lot of changes to your code, and do not neccessatily make the data harder to work with.
0 notes
reddypidugu · 5 years ago
Photo
Tumblr media
gRPC framework enables us to define 4 different kinds of APIs which can be used for different use cases. - Unary API - Server Streaming API - Client Streaming API - Bi-directional Streaming API To know more about this API watch the video: https://youtu.be/p-H9T-2lat0 #grpc #streaming #api #protocolbuffers https://www.instagram.com/p/CBF5dGjn6sT/?igshid=1esx09ln4s030
0 notes
reddypidugu · 5 years ago
Photo
Tumblr media
gRPC framework enables us to define 4 different kinds of APIs which can be used for different use cases. - Unary API - Server Streaming API - Client Streaming API - Bi-directional Streaming API To know more about this API watch the video: https://youtu.be/p-H9T-2lat0 #grpc #streaming #api #protocolbuffers https://www.instagram.com/p/CBF5VfAJaOI/?igshid=yurvcba7coji
0 notes