grpc.leaderboard._RankedElement Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of client-protos Show documentation
Show all versions of client-protos Show documentation
Java protobuf protocols that define the Momento gRPC wire format
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: leaderboard.proto
package grpc.leaderboard;
/**
*
* Query APIs returning RankedElement offer the familiar Element id and score tuple, but they
* also include the rank per the individual API's ranking semantic.
*
*
* Protobuf type {@code leaderboard._RankedElement}
*/
public final class _RankedElement extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:leaderboard._RankedElement)
_RankedElementOrBuilder {
private static final long serialVersionUID = 0L;
// Use _RankedElement.newBuilder() to construct.
private _RankedElement(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private _RankedElement() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new _RankedElement();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return grpc.leaderboard.LeaderboardOuterClass.internal_static_leaderboard__RankedElement_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return grpc.leaderboard.LeaderboardOuterClass.internal_static_leaderboard__RankedElement_fieldAccessorTable
.ensureFieldAccessorsInitialized(
grpc.leaderboard._RankedElement.class, grpc.leaderboard._RankedElement.Builder.class);
}
public static final int ID_FIELD_NUMBER = 1;
private int id_ = 0;
/**
* uint32 id = 1;
* @return The id.
*/
@java.lang.Override
public int getId() {
return id_;
}
public static final int RANK_FIELD_NUMBER = 3;
private int rank_ = 0;
/**
* uint32 rank = 3;
* @return The rank.
*/
@java.lang.Override
public int getRank() {
return rank_;
}
public static final int SCORE_FIELD_NUMBER = 4;
private double score_ = 0D;
/**
* double score = 4;
* @return The score.
*/
@java.lang.Override
public double getScore() {
return score_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (id_ != 0) {
output.writeUInt32(1, id_);
}
if (rank_ != 0) {
output.writeUInt32(3, rank_);
}
if (java.lang.Double.doubleToRawLongBits(score_) != 0) {
output.writeDouble(4, score_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (id_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(1, id_);
}
if (rank_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(3, rank_);
}
if (java.lang.Double.doubleToRawLongBits(score_) != 0) {
size += com.google.protobuf.CodedOutputStream
.computeDoubleSize(4, score_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof grpc.leaderboard._RankedElement)) {
return super.equals(obj);
}
grpc.leaderboard._RankedElement other = (grpc.leaderboard._RankedElement) obj;
if (getId()
!= other.getId()) return false;
if (getRank()
!= other.getRank()) return false;
if (java.lang.Double.doubleToLongBits(getScore())
!= java.lang.Double.doubleToLongBits(
other.getScore())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + ID_FIELD_NUMBER;
hash = (53 * hash) + getId();
hash = (37 * hash) + RANK_FIELD_NUMBER;
hash = (53 * hash) + getRank();
hash = (37 * hash) + SCORE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
java.lang.Double.doubleToLongBits(getScore()));
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static grpc.leaderboard._RankedElement parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static grpc.leaderboard._RankedElement parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static grpc.leaderboard._RankedElement parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static grpc.leaderboard._RankedElement parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static grpc.leaderboard._RankedElement parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static grpc.leaderboard._RankedElement parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static grpc.leaderboard._RankedElement parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static grpc.leaderboard._RankedElement parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static grpc.leaderboard._RankedElement parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static grpc.leaderboard._RankedElement parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static grpc.leaderboard._RankedElement parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static grpc.leaderboard._RankedElement parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(grpc.leaderboard._RankedElement prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* Query APIs returning RankedElement offer the familiar Element id and score tuple, but they
* also include the rank per the individual API's ranking semantic.
*
*
* Protobuf type {@code leaderboard._RankedElement}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:leaderboard._RankedElement)
grpc.leaderboard._RankedElementOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return grpc.leaderboard.LeaderboardOuterClass.internal_static_leaderboard__RankedElement_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return grpc.leaderboard.LeaderboardOuterClass.internal_static_leaderboard__RankedElement_fieldAccessorTable
.ensureFieldAccessorsInitialized(
grpc.leaderboard._RankedElement.class, grpc.leaderboard._RankedElement.Builder.class);
}
// Construct using grpc.leaderboard._RankedElement.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
id_ = 0;
rank_ = 0;
score_ = 0D;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return grpc.leaderboard.LeaderboardOuterClass.internal_static_leaderboard__RankedElement_descriptor;
}
@java.lang.Override
public grpc.leaderboard._RankedElement getDefaultInstanceForType() {
return grpc.leaderboard._RankedElement.getDefaultInstance();
}
@java.lang.Override
public grpc.leaderboard._RankedElement build() {
grpc.leaderboard._RankedElement result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public grpc.leaderboard._RankedElement buildPartial() {
grpc.leaderboard._RankedElement result = new grpc.leaderboard._RankedElement(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(grpc.leaderboard._RankedElement result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.id_ = id_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.rank_ = rank_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.score_ = score_;
}
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof grpc.leaderboard._RankedElement) {
return mergeFrom((grpc.leaderboard._RankedElement)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(grpc.leaderboard._RankedElement other) {
if (other == grpc.leaderboard._RankedElement.getDefaultInstance()) return this;
if (other.getId() != 0) {
setId(other.getId());
}
if (other.getRank() != 0) {
setRank(other.getRank());
}
if (other.getScore() != 0D) {
setScore(other.getScore());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
id_ = input.readUInt32();
bitField0_ |= 0x00000001;
break;
} // case 8
case 24: {
rank_ = input.readUInt32();
bitField0_ |= 0x00000002;
break;
} // case 24
case 33: {
score_ = input.readDouble();
bitField0_ |= 0x00000004;
break;
} // case 33
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private int id_ ;
/**
* uint32 id = 1;
* @return The id.
*/
@java.lang.Override
public int getId() {
return id_;
}
/**
* uint32 id = 1;
* @param value The id to set.
* @return This builder for chaining.
*/
public Builder setId(int value) {
id_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* uint32 id = 1;
* @return This builder for chaining.
*/
public Builder clearId() {
bitField0_ = (bitField0_ & ~0x00000001);
id_ = 0;
onChanged();
return this;
}
private int rank_ ;
/**
* uint32 rank = 3;
* @return The rank.
*/
@java.lang.Override
public int getRank() {
return rank_;
}
/**
* uint32 rank = 3;
* @param value The rank to set.
* @return This builder for chaining.
*/
public Builder setRank(int value) {
rank_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* uint32 rank = 3;
* @return This builder for chaining.
*/
public Builder clearRank() {
bitField0_ = (bitField0_ & ~0x00000002);
rank_ = 0;
onChanged();
return this;
}
private double score_ ;
/**
* double score = 4;
* @return The score.
*/
@java.lang.Override
public double getScore() {
return score_;
}
/**
* double score = 4;
* @param value The score to set.
* @return This builder for chaining.
*/
public Builder setScore(double value) {
score_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
* double score = 4;
* @return This builder for chaining.
*/
public Builder clearScore() {
bitField0_ = (bitField0_ & ~0x00000004);
score_ = 0D;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:leaderboard._RankedElement)
}
// @@protoc_insertion_point(class_scope:leaderboard._RankedElement)
private static final grpc.leaderboard._RankedElement DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new grpc.leaderboard._RankedElement();
}
public static grpc.leaderboard._RankedElement getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<_RankedElement>
PARSER = new com.google.protobuf.AbstractParser<_RankedElement>() {
@java.lang.Override
public _RankedElement parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser<_RankedElement> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<_RankedElement> getParserForType() {
return PARSER;
}
@java.lang.Override
public grpc.leaderboard._RankedElement getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}