@param \google\protobuf\FieldDescriptorProto $fieldDescriptor

@return boolean
508161
protected function isProtobufExtension(FieldDescriptorProto $fieldDescriptor)
    {
        if ( ! $fieldDescriptor->hasExtendee()) {
            return false;
        }

        $extendee = trim($fieldDescriptor->getExtendee(), '.');
        $package  = 'google.protobuf';
        $length   = strlen($package);

        return (substr($extendee, 0, $length) === $package);
    }
1153825
public function getFieldDefinition($fieldDefinitionIdentifier)
    {
        if (isset($this->fieldDefinitionsByIdentifier[$fieldDefinitionIdentifier])) {
            return $this->fieldDefinitionsByIdentifier[$fieldDefinitionIdentifier];
        }

        return null;
    }
1315864
public boolean cchanged(String descriptor) {
		if (liveVersion != null) {
			boolean b = liveVersion.hasConstructorChanged(descriptor);
			return b;
		}
		return false;
	}
37660
protected function getClassifiedName(FieldDescriptorProto $field)
    {
        $name  = $field->getName();
        $value = $this->getClassifiedValue($name);

        return $value;
    }
1072740
public static function field($descriptor, $name = null)
    {
        if (is_a($descriptor, 'frictionlessdata\\tableschema\\Fields\\BaseField')) {
            return $descriptor;
        } else {
            if (Utils::isJsonString($descriptor)) {
                $descriptor = json_decode($descriptor);
            } elseif (is_array($descriptor)) {
                $descriptor = json_decode(json_encode($descriptor));
            }
            if (!isset($descriptor->name) && !is_null($name)) {
                $descriptor->name = $name;
            }
            foreach (static::$fieldClasses as $fieldClass) {
                /** @var BaseField $fieldClass */
                if ($field = $fieldClass::inferDescriptor($descriptor)) {
                    return $field;
                }
            }
            throw new FieldValidationException([
                new SchemaValidationError(
                    SchemaValidationError::SCHEMA_VIOLATION,
                    'Could not find a valid field for descriptor: '.json_encode($descriptor)),
            ]);
        }
    }
188235
protected function generateFieldWriteStatement(Entity $entity, FieldDescriptorProto $field)
    {
        $generator = new WriteFieldStatementGenerator($this->context);
        $statement = $generator->generateFieldWriteStatement($entity, $field);

        return $statement;
    }
594712
protected function getAccessorName($type, FieldDescriptorProto $field)
    {
        $classified = $this->getClassifiedName($field);
        $method     = $type . $classified;

        if ($field->getLabel() === Label::LABEL_REPEATED()) {
            return $method . 'List';
        }

        return $method;
    }
207129
protected function getDefaultFieldValue(FieldDescriptorProto $field)
    {
        $type  = $field->getType();
        $value = $field->getDefaultValue();

        if ($value === null) {
            return 'null';
        }

        if ($type === Type::TYPE_ENUM()) {
            $typeName  = $field->getTypeName();
            $refEntity = $this->getEntity($typeName);
            $reference = $refEntity->getNamespacedName();
            $const     = $reference . '::' . $value . '()';

            return $const;
        }

        if ($type === Type::TYPE_BOOL()) {
            $value = filter_var($value, FILTER_VALIDATE_BOOLEAN);
        }

        return var_export($value, true);
    }
709868
protected function hasFieldDefinition(Type $type, FieldDefinition $fieldDef)
    {
        foreach ($type->fieldDefinitions as $existFieldDef) {
            if ($existFieldDef->id == $fieldDef->id) {
                return true;
            }
        }

        return false;
    }
142607
public function find(ExampleDescriptor $descriptor)
    {
        $filename = $descriptor->getFilePath();

        $file = $this->getExampleFileContents($filename);
        if (! $file) {
            return "** File not found : {$filename} **";
        }

        return implode('', array_slice($file, $descriptor->getStartingLine() - 1, $descriptor->getLineCount()));
    }
302975
public function add( Descriptor $argDescriptor ) : Support
   {

      $this->_attributes[ $argDescriptor->getName() ] = $argDescriptor;

      return $this;

   }
1260304
protected function getFieldLabelName(FieldDescriptorProto $field)
    {
        $label = $field->getLabel()->value();
        $name  = Field::getLabelName($label);

        return $name ?: 'unknown';
    }
568125
protected function getCamelizedName(FieldDescriptorProto $field)
    {
        $name  = $field->getName();
        $value = $this->getCamelizedValue($name);

        return $value;
    }
395332
@Nonnull
    public BugInstance addField(FieldDescriptor fieldDescriptor) {
        FieldAnnotation fieldAnnotation = FieldAnnotation.fromFieldDescriptor(fieldDescriptor);
        add(fieldAnnotation);
        return this;
    }
152222
public function addField(\google\protobuf\FieldDescriptorProto $value)
    {
        if ($this->field === null) {
            $this->field = new \Protobuf\MessageCollection();
        }

        $this->field->add($value);
    }
1078173
private function getDefaultSearchFields(array $fieldDescriptors): array
    {
        $defaultSearchFields = [];
        foreach ($fieldDescriptors as $fieldDescriptor) {
            if (FieldDescriptorInterface::SEARCHABILITY_YES === $fieldDescriptor->getSearchability()) {
                $defaultSearchFields[] = $fieldDescriptor->getName();
            }
        }

        return $defaultSearchFields;
    }
170741
protected function mapReflectorToDescriptor(Method $reflector, MethodDescriptor $descriptor): void
    {
        $descriptor->setFullyQualifiedStructuralElementName($reflector->getFqsen());
        $descriptor->setName($reflector->getName());
        $descriptor->setVisibility((string) $reflector->getVisibility() ?: 'public');
        $descriptor->setFinal($reflector->isFinal());
        $descriptor->setAbstract($reflector->isAbstract());
        $descriptor->setStatic($reflector->isStatic());
        $descriptor->setLine($reflector->getLocation()->getLineNumber());
        $descriptor->setReturnType($reflector->getReturnType());
    }