<?php

 
 
 
 
 
 

namespace Google\Protobuf;

use Google\Protobuf\Internal\GetPublicDescriptorTrait;

class Descriptor
{
    use GetPublicDescriptorTrait;

    private $internal_desc;

    


    public function __construct($internal_desc)
    {
        $this->internal_desc = $internal_desc;
    }

    


    public function getFullName()
    {
        return trim($this->internal_desc->getFullName(), ".");
    }

    


    public function getClass()
    {
        return $this->internal_desc->getClass();
    }

    



    public function getField($index)
    {
        return $this->getPublicDescriptor($this->internal_desc->getFieldByIndex($index));
    }

    


    public function getFieldCount()
    {
        return count($this->internal_desc->getField());
    }

    



    public function getOneofDecl($index)
    {
        return $this->getPublicDescriptor($this->internal_desc->getOneofDecl()[$index]);
    }

    


    public function getOneofDeclCount()
    {
        return count($this->internal_desc->getOneofDecl());
    }

    


    public function getRealOneofDeclCount()
    {
        return $this->internal_desc->getRealOneofDeclCount();
    }
}
