// Code generated by protoc-gen-gogo.
// source: primitive.proto
// DO NOT EDIT!

/*
	Package proto is a generated protocol buffer package.

	It is generated from these files:
		primitive.proto

	It has these top-level messages:
		Primitive
*/
package proto

import proto1 "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"

import io "io"

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto1.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto1.GoGoProtoPackageIsVersion2 // please upgrade the proto package

type PrimitiveType int32

const (
	PrimitiveType_LINK      PrimitiveType = 0
	PrimitiveType_IRI       PrimitiveType = 1
	PrimitiveType_STRING    PrimitiveType = 2
	PrimitiveType_BNODE     PrimitiveType = 3
	PrimitiveType_TYPED_STR PrimitiveType = 4
	PrimitiveType_LANG_STR  PrimitiveType = 5
	PrimitiveType_INT       PrimitiveType = 6
	PrimitiveType_FLOAT     PrimitiveType = 7
	PrimitiveType_BOOL      PrimitiveType = 8
	PrimitiveType_TIMESTAMP PrimitiveType = 9
)

var PrimitiveType_name = map[int32]string{
	0: "LINK",
	1: "IRI",
	2: "STRING",
	3: "BNODE",
	4: "TYPED_STR",
	5: "LANG_STR",
	6: "INT",
	7: "FLOAT",
	8: "BOOL",
	9: "TIMESTAMP",
}
var PrimitiveType_value = map[string]int32{
	"LINK":      0,
	"IRI":       1,
	"STRING":    2,
	"BNODE":     3,
	"TYPED_STR": 4,
	"LANG_STR":  5,
	"INT":       6,
	"FLOAT":     7,
	"BOOL":      8,
	"TIMESTAMP": 9,
}

func (x PrimitiveType) String() string {
	return proto1.EnumName(PrimitiveType_name, int32(x))
}
func (PrimitiveType) EnumDescriptor() ([]byte, []int) { return fileDescriptorPrimitive, []int{0} }

type Primitive struct {
	ID        uint64 `protobuf:"varint,1,opt,name=ID,json=iD,proto3" json:"ID,omitempty"`
	Subject   uint64 `protobuf:"varint,2,opt,name=Subject,json=subject,proto3" json:"Subject,omitempty"`
	Predicate uint64 `protobuf:"varint,3,opt,name=Predicate,json=predicate,proto3" json:"Predicate,omitempty"`
	Object    uint64 `protobuf:"varint,4,opt,name=Object,json=object,proto3" json:"Object,omitempty"`
	Label     uint64 `protobuf:"varint,5,opt,name=Label,json=label,proto3" json:"Label,omitempty"`
	Replaces  uint64 `protobuf:"varint,6,opt,name=Replaces,json=replaces,proto3" json:"Replaces,omitempty"`
	Timestamp int64  `protobuf:"varint,7,opt,name=Timestamp,json=timestamp,proto3" json:"Timestamp,omitempty"`
	Value     []byte `protobuf:"bytes,8,opt,name=Value,json=value,proto3" json:"Value,omitempty"`
	Deleted   bool   `protobuf:"varint,9,opt,name=Deleted,json=deleted,proto3" json:"Deleted,omitempty"`
}

func (m *Primitive) Reset()                    { *m = Primitive{} }
func (m *Primitive) String() string            { return proto1.CompactTextString(m) }
func (*Primitive) ProtoMessage()               {}
func (*Primitive) Descriptor() ([]byte, []int) { return fileDescriptorPrimitive, []int{0} }

func (m *Primitive) GetID() uint64 {
	if m != nil {
		return m.ID
	}
	return 0
}

func (m *Primitive) GetSubject() uint64 {
	if m != nil {
		return m.Subject
	}
	return 0
}

func (m *Primitive) GetPredicate() uint64 {
	if m != nil {
		return m.Predicate
	}
	return 0
}

func (m *Primitive) GetObject() uint64 {
	if m != nil {
		return m.Object
	}
	return 0
}

func (m *Primitive) GetLabel() uint64 {
	if m != nil {
		return m.Label
	}
	return 0
}

func (m *Primitive) GetReplaces() uint64 {
	if m != nil {
		return m.Replaces
	}
	return 0
}

func (m *Primitive) GetTimestamp() int64 {
	if m != nil {
		return m.Timestamp
	}
	return 0
}

func (m *Primitive) GetValue() []byte {
	if m != nil {
		return m.Value
	}
	return nil
}

func (m *Primitive) GetDeleted() bool {
	if m != nil {
		return m.Deleted
	}
	return false
}

func init() {
	proto1.RegisterType((*Primitive)(nil), "proto.Primitive")
	proto1.RegisterEnum("proto.PrimitiveType", PrimitiveType_name, PrimitiveType_value)
}
func (m *Primitive) Marshal() (dAtA []byte, err error) {
	size := m.ProtoSize()
	dAtA = make([]byte, size)
	n, err := m.MarshalTo(dAtA)
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *Primitive) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if m.ID != 0 {
		dAtA[i] = 0x8
		i++
		i = encodeVarintPrimitive(dAtA, i, uint64(m.ID))
	}
	if m.Subject != 0 {
		dAtA[i] = 0x10
		i++
		i = encodeVarintPrimitive(dAtA, i, uint64(m.Subject))
	}
	if m.Predicate != 0 {
		dAtA[i] = 0x18
		i++
		i = encodeVarintPrimitive(dAtA, i, uint64(m.Predicate))
	}
	if m.Object != 0 {
		dAtA[i] = 0x20
		i++
		i = encodeVarintPrimitive(dAtA, i, uint64(m.Object))
	}
	if m.Label != 0 {
		dAtA[i] = 0x28
		i++
		i = encodeVarintPrimitive(dAtA, i, uint64(m.Label))
	}
	if m.Replaces != 0 {
		dAtA[i] = 0x30
		i++
		i = encodeVarintPrimitive(dAtA, i, uint64(m.Replaces))
	}
	if m.Timestamp != 0 {
		dAtA[i] = 0x38
		i++
		i = encodeVarintPrimitive(dAtA, i, uint64(m.Timestamp))
	}
	if len(m.Value) > 0 {
		dAtA[i] = 0x42
		i++
		i = encodeVarintPrimitive(dAtA, i, uint64(len(m.Value)))
		i += copy(dAtA[i:], m.Value)
	}
	if m.Deleted {
		dAtA[i] = 0x48
		i++
		if m.Deleted {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i++
	}
	return i, nil
}

func encodeFixed64Primitive(dAtA []byte, offset int, v uint64) int {
	dAtA[offset] = uint8(v)
	dAtA[offset+1] = uint8(v >> 8)
	dAtA[offset+2] = uint8(v >> 16)
	dAtA[offset+3] = uint8(v >> 24)
	dAtA[offset+4] = uint8(v >> 32)
	dAtA[offset+5] = uint8(v >> 40)
	dAtA[offset+6] = uint8(v >> 48)
	dAtA[offset+7] = uint8(v >> 56)
	return offset + 8
}
func encodeFixed32Primitive(dAtA []byte, offset int, v uint32) int {
	dAtA[offset] = uint8(v)
	dAtA[offset+1] = uint8(v >> 8)
	dAtA[offset+2] = uint8(v >> 16)
	dAtA[offset+3] = uint8(v >> 24)
	return offset + 4
}
func encodeVarintPrimitive(dAtA []byte, offset int, v uint64) int {
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return offset + 1
}
func (m *Primitive) ProtoSize() (n int) {
	var l int
	_ = l
	if m.ID != 0 {
		n += 1 + sovPrimitive(uint64(m.ID))
	}
	if m.Subject != 0 {
		n += 1 + sovPrimitive(uint64(m.Subject))
	}
	if m.Predicate != 0 {
		n += 1 + sovPrimitive(uint64(m.Predicate))
	}
	if m.Object != 0 {
		n += 1 + sovPrimitive(uint64(m.Object))
	}
	if m.Label != 0 {
		n += 1 + sovPrimitive(uint64(m.Label))
	}
	if m.Replaces != 0 {
		n += 1 + sovPrimitive(uint64(m.Replaces))
	}
	if m.Timestamp != 0 {
		n += 1 + sovPrimitive(uint64(m.Timestamp))
	}
	l = len(m.Value)
	if l > 0 {
		n += 1 + l + sovPrimitive(uint64(l))
	}
	if m.Deleted {
		n += 2
	}
	return n
}

func sovPrimitive(x uint64) (n int) {
	for {
		n++
		x >>= 7
		if x == 0 {
			break
		}
	}
	return n
}
func sozPrimitive(x uint64) (n int) {
	return sovPrimitive(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Primitive) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowPrimitive
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: Primitive: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Primitive: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
			}
			m.ID = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPrimitive
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.ID |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType)
			}
			m.Subject = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPrimitive
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Subject |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Predicate", wireType)
			}
			m.Predicate = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPrimitive
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Predicate |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 4:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Object", wireType)
			}
			m.Object = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPrimitive
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Object |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 5:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType)
			}
			m.Label = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPrimitive
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Label |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 6:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Replaces", wireType)
			}
			m.Replaces = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPrimitive
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Replaces |= (uint64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 7:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
			}
			m.Timestamp = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPrimitive
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Timestamp |= (int64(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 8:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPrimitive
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				byteLen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return ErrInvalidLengthPrimitive
			}
			postIndex := iNdEx + byteLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
			if m.Value == nil {
				m.Value = []byte{}
			}
			iNdEx = postIndex
		case 9:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Deleted", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowPrimitive
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.Deleted = bool(v != 0)
		default:
			iNdEx = preIndex
			skippy, err := skipPrimitive(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthPrimitive
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipPrimitive(dAtA []byte) (n int, err error) {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return 0, ErrIntOverflowPrimitive
			}
			if iNdEx >= l {
				return 0, io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		wireType := int(wire & 0x7)
		switch wireType {
		case 0:
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowPrimitive
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				iNdEx++
				if dAtA[iNdEx-1] < 0x80 {
					break
				}
			}
			return iNdEx, nil
		case 1:
			iNdEx += 8
			return iNdEx, nil
		case 2:
			var length int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowPrimitive
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				length |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			iNdEx += length
			if length < 0 {
				return 0, ErrInvalidLengthPrimitive
			}
			return iNdEx, nil
		case 3:
			for {
				var innerWire uint64
				var start int = iNdEx
				for shift := uint(0); ; shift += 7 {
					if shift >= 64 {
						return 0, ErrIntOverflowPrimitive
					}
					if iNdEx >= l {
						return 0, io.ErrUnexpectedEOF
					}
					b := dAtA[iNdEx]
					iNdEx++
					innerWire |= (uint64(b) & 0x7F) << shift
					if b < 0x80 {
						break
					}
				}
				innerWireType := int(innerWire & 0x7)
				if innerWireType == 4 {
					break
				}
				next, err := skipPrimitive(dAtA[start:])
				if err != nil {
					return 0, err
				}
				iNdEx = start + next
			}
			return iNdEx, nil
		case 4:
			return iNdEx, nil
		case 5:
			iNdEx += 4
			return iNdEx, nil
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
	}
	panic("unreachable")
}

var (
	ErrInvalidLengthPrimitive = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPrimitive   = fmt.Errorf("proto: integer overflow")
)

func init() { proto1.RegisterFile("primitive.proto", fileDescriptorPrimitive) }

var fileDescriptorPrimitive = []byte{
	// 357 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0x91, 0xdf, 0x4a, 0xeb, 0x30,
	0x1c, 0xc7, 0x4f, 0xfa, 0xbf, 0x61, 0x3b, 0x27, 0x84, 0x83, 0x84, 0x21, 0xa3, 0x78, 0x55, 0x04,
	0xb7, 0x0b, 0x9f, 0x60, 0xa3, 0x73, 0x14, 0xbb, 0x76, 0xa4, 0x41, 0xf0, 0x4a, 0xda, 0x2e, 0xce,
	0x4a, 0x4b, 0xcb, 0x96, 0x0e, 0xbc, 0xf6, 0x45, 0x7c, 0x1c, 0x2f, 0x7d, 0x86, 0x79, 0xe9, 0x4b,
	0x48, 0x52, 0xe7, 0x55, 0xf2, 0xf9, 0xfe, 0xf8, 0x7c, 0x93, 0x10, 0xf8, 0xaf, 0xdd, 0x95, 0x75,
	0x29, 0xca, 0x03, 0x9f, 0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