Static Public Member Functions | Static Public Attributes | Static Protected Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
com.google.protobuf.jruby.Utils Class Reference

Static Public Member Functions

static void checkNameAvailability (ThreadContext context, String name)
 
static void checkNameAvailability (ThreadContext context, String name)
 
static IRubyObject checkType (ThreadContext context, Descriptors.FieldDescriptor.Type fieldType, IRubyObject value, RubyModule typeClass)
 
static IRubyObject checkType (ThreadContext context, FieldDescriptor.Type fieldType, String fieldName, IRubyObject value, RubyModule typeClass)
 
static RaiseException createExpectedTypeError (ThreadContext context, String type, String fieldType, String fieldName, IRubyObject value)
 
static RaiseException createInvalidTypeError (ThreadContext context, String fieldType, String fieldName, IRubyObject value)
 
static RaiseException createTypeError (ThreadContext context, String message)
 
static String escapeIdentifier (String name)
 
static IRubyObject fieldTypeToRuby (ThreadContext context, DescriptorProtos.FieldDescriptorProto.Type type)
 
static IRubyObject fieldTypeToRuby (ThreadContext context, Descriptors.FieldDescriptor.Type type)
 
static IRubyObject fieldTypeToRuby (ThreadContext context, FieldDescriptor.Type type)
 
static IRubyObject fieldTypeToRuby (ThreadContext context, FieldDescriptorProto.Type type)
 
static boolean isMapEntry (Descriptors.FieldDescriptor fieldDescriptor)
 
static boolean isMapEntry (FieldDescriptor fieldDescriptor)
 
static RubyFieldDescriptor msgdefCreateField (ThreadContext context, String label, IRubyObject name, IRubyObject type, IRubyObject number, IRubyObject typeClass, RubyClass cFieldDescriptor)
 
static int num2uint (IRubyObject value)
 
static int num2uint (IRubyObject value)
 
static long num2ulong (Ruby runtime, IRubyObject value)
 
static long num2ulong (Ruby runtime, IRubyObject value)
 
static Descriptors.FieldDescriptor.Type rubyToFieldType (IRubyObject typeClass)
 
static FieldDescriptor.Type rubyToFieldType (IRubyObject typeClass)
 
static IRubyObject symToString (IRubyObject sym)
 
static String unescapeIdentifier (String name)
 
static IRubyObject validateStringEncoding (ThreadContext context, Descriptors.FieldDescriptor.Type type, IRubyObject value)
 
static IRubyObject wrapPrimaryValue (ThreadContext context, Descriptors.FieldDescriptor.Type fieldType, Object value)
 
static IRubyObject wrapPrimaryValue (ThreadContext context, FieldDescriptor.Type fieldType, Object value)
 
static IRubyObject wrapPrimaryValue (ThreadContext context, FieldDescriptor.Type fieldType, Object value, boolean encodeBytes)
 

Static Public Attributes

static String BADNAME_REPLACEMENT = "__DOT__"
 
static String DESCRIPTOR_INSTANCE_VAR = "@descriptor"
 
static final String DESCRIPTOR_INSTANCE_VAR = "@descriptor"
 
static String EQUAL_SIGN = "="
 
static final String EQUAL_SIGN = "="
 

Static Protected Member Functions

static void checkIntTypePrecision (ThreadContext context, Descriptors.FieldDescriptor.Type type, IRubyObject value)
 
static boolean isRubyNum (Object value)
 
static boolean isRubyNum (Object value)
 
static void validateTypeClass (ThreadContext context, Descriptors.FieldDescriptor.Type type, IRubyObject value)
 
static void validateTypeClass (ThreadContext context, FieldDescriptor.Type type, IRubyObject value)
 

Static Private Member Functions

static IRubyObject fieldTypeToRuby (ThreadContext context, String typeName)
 
static IRubyObject fieldTypeToRuby (ThreadContext context, String typeName)
 
static IRubyObject validateAndEncodeString (ThreadContext context, String fieldType, String fieldName, IRubyObject value, String encoding)
 

Static Private Attributes

static RubyClass cTypeError
 
static final String EXPECTED_TYPE_ERROR_FORMAT = "Expected %s type for %s field '%s' (given %s)."
 
static final String INVALID_TYPE_ERROR_FORMAT = "Invalid argument for %s field '%s' (given %s)."
 
static BigInteger UINT64_COMPLEMENTARY = new BigInteger("18446744073709551616")
 
static final BigInteger UINT64_COMPLEMENTARY = new BigInteger("18446744073709551616")
 
static long UINT_MAX = 0xffffffffl
 
static final long UINT_MAX = 0xffffffffl
 

Detailed Description

Definition at line 49 of file bloaty/third_party/protobuf/ruby/src/main/java/com/google/protobuf/jruby/Utils.java.

Member Function Documentation

◆ checkIntTypePrecision()

static void com.google.protobuf.jruby.Utils.checkIntTypePrecision ( ThreadContext  context,
Descriptors.FieldDescriptor.Type  type,
IRubyObject  value 
)
inlinestaticprotected

◆ checkNameAvailability() [1/2]

static void com.google.protobuf.jruby.Utils.checkNameAvailability ( ThreadContext  context,
String  name 
)
inlinestatic

◆ checkNameAvailability() [2/2]

static void com.google.protobuf.jruby.Utils.checkNameAvailability ( ThreadContext  context,
String  name 
)
inlinestatic

◆ checkType() [1/2]

static IRubyObject com.google.protobuf.jruby.Utils.checkType ( ThreadContext  context,
Descriptors.FieldDescriptor.Type  fieldType,
IRubyObject  value,
RubyModule  typeClass 
)
inlinestatic

◆ checkType() [2/2]

static IRubyObject com.google.protobuf.jruby.Utils.checkType ( ThreadContext  context,
FieldDescriptor.Type  fieldType,
String  fieldName,
IRubyObject  value,
RubyModule  typeClass 
)
inlinestatic

◆ createExpectedTypeError()

static RaiseException com.google.protobuf.jruby.Utils.createExpectedTypeError ( ThreadContext  context,
String  type,
String  fieldType,
String  fieldName,
IRubyObject  value 
)
inlinestatic

◆ createInvalidTypeError()

static RaiseException com.google.protobuf.jruby.Utils.createInvalidTypeError ( ThreadContext  context,
String  fieldType,
String  fieldName,
IRubyObject  value 
)
inlinestatic

◆ createTypeError()

static RaiseException com.google.protobuf.jruby.Utils.createTypeError ( ThreadContext  context,
String  message 
)
inlinestatic

◆ escapeIdentifier()

static String com.google.protobuf.jruby.Utils.escapeIdentifier ( String  name)
inlinestatic

Replace invalid "." in descriptor with DOT

Parameters
name
Returns

Definition at line 217 of file bloaty/third_party/protobuf/ruby/src/main/java/com/google/protobuf/jruby/Utils.java.

◆ fieldTypeToRuby() [1/6]

static IRubyObject com.google.protobuf.jruby.Utils.fieldTypeToRuby ( ThreadContext  context,
DescriptorProtos.FieldDescriptorProto.Type  type 
)
inlinestatic

◆ fieldTypeToRuby() [2/6]

static IRubyObject com.google.protobuf.jruby.Utils.fieldTypeToRuby ( ThreadContext  context,
Descriptors.FieldDescriptor.Type  type 
)
inlinestatic

◆ fieldTypeToRuby() [3/6]

static IRubyObject com.google.protobuf.jruby.Utils.fieldTypeToRuby ( ThreadContext  context,
FieldDescriptor.Type  type 
)
inlinestatic

◆ fieldTypeToRuby() [4/6]

static IRubyObject com.google.protobuf.jruby.Utils.fieldTypeToRuby ( ThreadContext  context,
FieldDescriptorProto.Type  type 
)
inlinestatic

◆ fieldTypeToRuby() [5/6]

static IRubyObject com.google.protobuf.jruby.Utils.fieldTypeToRuby ( ThreadContext  context,
String  typeName 
)
inlinestaticprivate

◆ fieldTypeToRuby() [6/6]

static IRubyObject com.google.protobuf.jruby.Utils.fieldTypeToRuby ( ThreadContext  context,
String  typeName 
)
inlinestaticprivate

◆ isMapEntry() [1/2]

static boolean com.google.protobuf.jruby.Utils.isMapEntry ( Descriptors.FieldDescriptor  fieldDescriptor)
inlinestatic

◆ isMapEntry() [2/2]

static boolean com.google.protobuf.jruby.Utils.isMapEntry ( FieldDescriptor  fieldDescriptor)
inlinestatic

◆ isRubyNum() [1/2]

static boolean com.google.protobuf.jruby.Utils.isRubyNum ( Object  value)
inlinestaticprotected

◆ isRubyNum() [2/2]

static boolean com.google.protobuf.jruby.Utils.isRubyNum ( Object  value)
inlinestaticprotected

◆ msgdefCreateField()

static RubyFieldDescriptor com.google.protobuf.jruby.Utils.msgdefCreateField ( ThreadContext  context,
String  label,
IRubyObject  name,
IRubyObject  type,
IRubyObject  number,
IRubyObject  typeClass,
RubyClass  cFieldDescriptor 
)
inlinestatic

◆ num2uint() [1/2]

static int com.google.protobuf.jruby.Utils.num2uint ( IRubyObject  value)
inlinestatic

◆ num2uint() [2/2]

static int com.google.protobuf.jruby.Utils.num2uint ( IRubyObject  value)
inlinestatic

◆ num2ulong() [1/2]

static long com.google.protobuf.jruby.Utils.num2ulong ( Ruby  runtime,
IRubyObject  value 
)
inlinestatic

◆ num2ulong() [2/2]

static long com.google.protobuf.jruby.Utils.num2ulong ( Ruby  runtime,
IRubyObject  value 
)
inlinestatic

◆ rubyToFieldType() [1/2]

static Descriptors.FieldDescriptor.Type com.google.protobuf.jruby.Utils.rubyToFieldType ( IRubyObject  typeClass)
inlinestatic

◆ rubyToFieldType() [2/2]

static FieldDescriptor.Type com.google.protobuf.jruby.Utils.rubyToFieldType ( IRubyObject  typeClass)
inlinestatic

◆ symToString()

static IRubyObject com.google.protobuf.jruby.Utils.symToString ( IRubyObject  sym)
inlinestatic

◆ unescapeIdentifier()

static String com.google.protobuf.jruby.Utils.unescapeIdentifier ( String  name)
inlinestatic

Replace DOT in descriptor name with "."

Parameters
name
Returns

Definition at line 226 of file bloaty/third_party/protobuf/ruby/src/main/java/com/google/protobuf/jruby/Utils.java.

◆ validateAndEncodeString()

static IRubyObject com.google.protobuf.jruby.Utils.validateAndEncodeString ( ThreadContext  context,
String  fieldType,
String  fieldName,
IRubyObject  value,
String  encoding 
)
inlinestaticprivate

◆ validateStringEncoding()

static IRubyObject com.google.protobuf.jruby.Utils.validateStringEncoding ( ThreadContext  context,
Descriptors.FieldDescriptor.Type  type,
IRubyObject  value 
)
inlinestatic

◆ validateTypeClass() [1/2]

static void com.google.protobuf.jruby.Utils.validateTypeClass ( ThreadContext  context,
Descriptors.FieldDescriptor.Type  type,
IRubyObject  value 
)
inlinestaticprotected

◆ validateTypeClass() [2/2]

static void com.google.protobuf.jruby.Utils.validateTypeClass ( ThreadContext  context,
FieldDescriptor.Type  type,
IRubyObject  value 
)
inlinestaticprotected

◆ wrapPrimaryValue() [1/3]

static IRubyObject com.google.protobuf.jruby.Utils.wrapPrimaryValue ( ThreadContext  context,
Descriptors.FieldDescriptor.Type  fieldType,
Object  value 
)
inlinestatic

◆ wrapPrimaryValue() [2/3]

static IRubyObject com.google.protobuf.jruby.Utils.wrapPrimaryValue ( ThreadContext  context,
FieldDescriptor.Type  fieldType,
Object  value 
)
inlinestatic

◆ wrapPrimaryValue() [3/3]

static IRubyObject com.google.protobuf.jruby.Utils.wrapPrimaryValue ( ThreadContext  context,
FieldDescriptor.Type  fieldType,
Object  value,
boolean  encodeBytes 
)
inlinestatic

Member Data Documentation

◆ BADNAME_REPLACEMENT

String com.google.protobuf.jruby.Utils.BADNAME_REPLACEMENT = "__DOT__"
static

◆ cTypeError

RubyClass com.google.protobuf.jruby.Utils.cTypeError
staticprivate

◆ DESCRIPTOR_INSTANCE_VAR [1/2]

String com.google.protobuf.jruby.Utils.DESCRIPTOR_INSTANCE_VAR = "@descriptor"
static

◆ DESCRIPTOR_INSTANCE_VAR [2/2]

final String com.google.protobuf.jruby.Utils.DESCRIPTOR_INSTANCE_VAR = "@descriptor"
static

◆ EQUAL_SIGN [1/2]

String com.google.protobuf.jruby.Utils.EQUAL_SIGN = "="
static

◆ EQUAL_SIGN [2/2]

final String com.google.protobuf.jruby.Utils.EQUAL_SIGN = "="
static

◆ EXPECTED_TYPE_ERROR_FORMAT

final String com.google.protobuf.jruby.Utils.EXPECTED_TYPE_ERROR_FORMAT = "Expected %s type for %s field '%s' (given %s)."
staticprivate

◆ INVALID_TYPE_ERROR_FORMAT

final String com.google.protobuf.jruby.Utils.INVALID_TYPE_ERROR_FORMAT = "Invalid argument for %s field '%s' (given %s)."
staticprivate

◆ UINT64_COMPLEMENTARY [1/2]

BigInteger com.google.protobuf.jruby.Utils.UINT64_COMPLEMENTARY = new BigInteger("18446744073709551616")
staticprivate

◆ UINT64_COMPLEMENTARY [2/2]

final BigInteger com.google.protobuf.jruby.Utils.UINT64_COMPLEMENTARY = new BigInteger("18446744073709551616")
staticprivate

◆ UINT_MAX [1/2]

long com.google.protobuf.jruby.Utils.UINT_MAX = 0xffffffffl
staticprivate

◆ UINT_MAX [2/2]

final long com.google.protobuf.jruby.Utils.UINT_MAX = 0xffffffffl
staticprivate

The documentation for this class was generated from the following file:


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:08