private String getConnectFieldName(Descriptors.FieldDescriptor descriptor) { String name = descriptor.getName(); for (Map.Entry<Descriptors.FieldDescriptor, Object> option: descriptor.getOptions().getAllFields().entrySet()) { if (option.getKey().getName().equalsIgnoreCase(this.legacyName)) { name = option.getValue().toString(); } } connectProtoNameMap.put(getProtoMapKey(descriptor.getContainingType().getFullName(), name), descriptor.getName()); return name; }
/** Returns true if this field has a valid jstype annotation. */ public static boolean hasJsType(FieldDescriptor fieldDescriptor) { if (!JS_TYPEABLE_FIELDS.contains(fieldDescriptor.getType())) { return false; } if (fieldDescriptor.getOptions().hasJstype()) { return true; } return false; }
/** Returns true if this field has a valid jstype annotation. */ public static boolean hasJsType(FieldDescriptor fieldDescriptor) { if (!JS_TYPEABLE_FIELDS.contains(fieldDescriptor.getType())) { return false; } if (fieldDescriptor.getOptions().hasJstype()) { return true; } return false; }
messageType.getFullName()); } else { if (field.getOptions().getDeprecated()) { helper.warning(node, "The field '%s' is deprecated.", field.getName());
messageType.getFullName()); } else { if (field.getOptions().getDeprecated()) { helper.warning(node, "The field '%s' is deprecated.", field.getName());
/** Does this field have the {@code [packed = true]} option or is this field * packable in proto3 and not explicitly setted to unpacked? */ @Override public boolean isPacked() { if (!isPackable()) { return false; } if (getFile().getSyntax() == FileDescriptor.Syntax.PROTO2) { return getOptions().getPacked(); } else { return !getOptions().hasPacked() || getOptions().getPacked(); } }
public static JSType getJsType(FieldDescriptor fieldDescriptor) { boolean hasJstype = fieldDescriptor.getOptions().hasJstype(); if (hasJstype) { return fieldDescriptor.getOptions().getJstype(); } return null; }
/** Does this field have the {@code [packed = true]} option? */ public boolean isPacked() { return getOptions().getPacked(); }
public static JSType getJsType(FieldDescriptor fieldDescriptor) { boolean hasJstype = fieldDescriptor.getOptions().hasJstype(); if (hasJstype) { return fieldDescriptor.getOptions().getJstype(); } return null; }
/** * Gets whether the field is of type int52. This means that although the * field's native type is int64, only 52 bits of information are used. * * @return whether the field is a 52-bit integer */ public boolean isInt52() { return properties.getUseInt52() // && field.getOptions().hasExtension(Extensions.int52) && field.getOptions().getExtension(Extensions.int52); }
private void protoFieldOptions(RecordTypeBuilder recordType, Descriptors.Descriptor descriptor) { // Add indexes from custom options. for (Descriptors.FieldDescriptor fieldDescriptor : descriptor.getFields()) { RecordMetaDataOptionsProto.FieldOptions fieldOptions = fieldDescriptor.getOptions() .getExtension(RecordMetaDataOptionsProto.field); if (fieldOptions != null) { protoFieldOptions(recordType, descriptor, fieldDescriptor, fieldOptions); } } }
/** Does this field have the {@code [packed = true]} option or is this field * packable in proto3 and not explicitly setted to unpacked? */ @Override public boolean isPacked() { if (!isPackable()) { return false; } if (getFile().getSyntax() == FileDescriptor.Syntax.PROTO2) { return getOptions().getPacked(); } else { return !getOptions().hasPacked() || getOptions().getPacked(); } }
/** Does this field have the {@code [packed = true]} option? */ public boolean isPacked() { return getOptions().getPacked(); }