# automatically generated by the FlatBuffers compiler, do not modify

# namespace: feather_v1_fbs

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class Column(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAs(cls, buf, offset=0):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = Column()
        x.Init(buf, n + offset)
        return x

    @classmethod
    def GetRootAsColumn(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    # Column
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # Column
    def Name(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # Column
    def Values(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from feather_v1_fbs.PrimitiveArray import PrimitiveArray
            obj = PrimitiveArray()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Column
    def MetadataType(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
        return 0

    # Column
    def Metadata(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            from flatbuffers.table import Table
            obj = Table(bytearray(), 0)
            self._tab.Union(obj, o)
            return obj
        return None

    # This should (probably) be JSON
    # Column
    def UserMetadata(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

def Start(builder): builder.StartObject(5)
def ColumnStart(builder):
    """This method is deprecated. Please switch to Start."""
    return Start(builder)
def AddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0)
def ColumnAddName(builder, name):
    """This method is deprecated. Please switch to AddName."""
    return AddName(builder, name)
def AddValues(builder, values): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(values), 0)
def ColumnAddValues(builder, values):
    """This method is deprecated. Please switch to AddValues."""
    return AddValues(builder, values)
def AddMetadataType(builder, metadataType): builder.PrependUint8Slot(2, metadataType, 0)
def ColumnAddMetadataType(builder, metadataType):
    """This method is deprecated. Please switch to AddMetadataType."""
    return AddMetadataType(builder, metadataType)
def AddMetadata(builder, metadata): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(metadata), 0)
def ColumnAddMetadata(builder, metadata):
    """This method is deprecated. Please switch to AddMetadata."""
    return AddMetadata(builder, metadata)
def AddUserMetadata(builder, userMetadata): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(userMetadata), 0)
def ColumnAddUserMetadata(builder, userMetadata):
    """This method is deprecated. Please switch to AddUserMetadata."""
    return AddUserMetadata(builder, userMetadata)
def End(builder): return builder.EndObject()
def ColumnEnd(builder):
    """This method is deprecated. Please switch to End."""
    return End(builder)