Java Code Examples for com.google.protobuf.Internal.EnumLite#getNumber()

The following examples show how to use com.google.protobuf.Internal.EnumLite#getNumber() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OutboundRpcMessage.java    From Bats with Apache License 2.0 4 votes vote down vote up
public OutboundRpcMessage(RpcMode mode, EnumLite rpcType, int coordinationId, MessageLite pBody, ByteBuf... dBodies) {
    this(mode, rpcType.getNumber(), coordinationId, pBody, dBodies);
}
 
Example 2
Source File: OutboundRpcMessage.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
public OutboundRpcMessage(RpcMode mode, EnumLite rpcType, int coordinationId, MessageLite pBody, ByteBuf... dBodies) {
    this(mode, rpcType.getNumber(), coordinationId, pBody, dBodies);
}
 
Example 3
Source File: AbstractMessage.java    From play-store-api with GNU General Public License v3.0 4 votes vote down vote up
/**
 * @deprecated from v3.0.0-beta-3+, for compatibility with v2.5.0 and v2.6.1
 * generated code.
 */
@Deprecated
protected static int hashEnum(EnumLite e) {
  return e.getNumber();
}
 
Example 4
Source File: AbstractMessage.java    From travelguide with Apache License 2.0 2 votes vote down vote up
/**
 * Helper method for implementing {@link Message#hashCode()}.
 * <p>
 * This is needed because {@link java.lang.Enum#hashCode()} is final, but we
 * need to use the field number as the hash code to ensure compatibility
 * between statically and dynamically generated enum objects.
 */
protected static int hashEnum(EnumLite e) {
  return e.getNumber();
}
 
Example 5
Source File: AbstractMessage.java    From android-chromium with BSD 2-Clause "Simplified" License 2 votes vote down vote up
/**
 * Helper method for implementing {@link Message#hashCode()}.
 * <p>
 * This is needed because {@link java.lang.Enum#hashCode()} is final, but we
 * need to use the field number as the hash code to ensure compatibility
 * between statically and dynamically generated enum objects.
 */
protected static int hashEnum(EnumLite e) {
  return e.getNumber();
}
 
Example 6
Source File: AbstractMessage.java    From android-chromium with BSD 2-Clause "Simplified" License 2 votes vote down vote up
/**
 * Helper method for implementing {@link Message#hashCode()}.
 * <p>
 * This is needed because {@link java.lang.Enum#hashCode()} is final, but we
 * need to use the field number as the hash code to ensure compatibility
 * between statically and dynamically generated enum objects.
 */
protected static int hashEnum(EnumLite e) {
  return e.getNumber();
}