func NewRegexStringComparator(pattern string, patternFlags int32,
	charset, engine string) *RegexStringComparator {
	return &RegexStringComparator{
		Pattern:      proto.String(pattern),
		PatternFlags: proto.Int32(patternFlags),
		Charset:      proto.String(charset),
		Engine:       proto.String(engine),
	}
}
NewRegexStringComparator is TODO
package filter
import (
	"errors"
	"github.com/tsuna/gohbase/pb"
	"google.golang.org/protobuf/proto"
)
const comparatorPath = "org.apache.hadoop.hbase.filter."
type BitComparatorBitwiseOp int32
func (o BitComparatorBitwiseOp) isValid() bool {
	return o >= 1 && o <= 3
}
const (
	BitComparatorAND BitComparatorBitwiseOp = 1
	BitComparatorOR  BitComparatorBitwiseOp = 2
	BitComparatorXOR BitComparatorBitwiseOp = 3
)
var _ Comparator = (*BinaryComparator)(nil)
var _ Comparator = (*LongComparator)(nil)
var _ Comparator = (*BinaryPrefixComparator)(nil)
var _ Comparator = (*BitComparator)(nil)
var _ Comparator = (*NullComparator)(nil)
var _ Comparator = (*RegexStringComparator)(nil)
var _ Comparator = (*SubstringComparator)(nil)
type Comparator interface {
	ConstructPBComparator() (*pb.Comparator, error)
}
type ByteArrayComparable pb.ByteArrayComparable
func NewByteArrayComparable(value []byte) *ByteArrayComparable {
	return &ByteArrayComparable{
		Value: value,
	}
}
func (b *ByteArrayComparable) toPB() *pb.ByteArrayComparable {
	return (*pb.ByteArrayComparable)(b)
}
type BinaryComparator pb.BinaryComparator
func NewBinaryComparator(comparable *ByteArrayComparable) *BinaryComparator {
	return &BinaryComparator{
		Comparable: comparable.toPB(),
	}
}
func (c *BinaryComparator) ConstructPBComparator() (*pb.Comparator, error) {
	serializedComparator, err := proto.Marshal((*pb.BinaryComparator)(c))
	if err != nil {
		return nil, err
	}
	comparator := &pb.Comparator{
		Name:                 proto.String(comparatorPath + "BinaryComparator"),
		SerializedComparator: serializedComparator,
	}
	return comparator, nil
}
type LongComparator pb.LongComparator
func NewLongComparator(comparable *ByteArrayComparable) *LongComparator {
	return &LongComparator{
		Comparable: comparable.toPB(),
	}
}
func (c *LongComparator) ConstructPBComparator() (*pb.Comparator, error) {
	serializedComparator, err := proto.Marshal((*pb.LongComparator)(c))
	if err != nil {
		return nil, err
	}
	comparator := &pb.Comparator{
		Name:                 proto.String(comparatorPath + "LongComparator"),
		SerializedComparator: serializedComparator,
	}
	return comparator, nil
}
type BinaryPrefixComparator pb.BinaryPrefixComparator
func NewBinaryPrefixComparator(comparable *ByteArrayComparable) *BinaryPrefixComparator {
	return &BinaryPrefixComparator{
		Comparable: comparable.toPB(),
	}
}
func (c *BinaryPrefixComparator) ConstructPBComparator() (*pb.Comparator, error) {
	serializedComparator, err := proto.Marshal((*pb.BinaryPrefixComparator)(c))
	if err != nil {
		return nil, err
	}
	comparator := &pb.Comparator{
		Name:                 proto.String(comparatorPath + "BinaryPrefixComparator"),
		SerializedComparator: serializedComparator,
	}
	return comparator, nil
}
type BitComparator pb.BitComparator
func NewBitComparator(bitwiseOp BitComparatorBitwiseOp,
	comparable *ByteArrayComparable) *BitComparator {
	op := pb.BitComparator_BitwiseOp(bitwiseOp)
	return &BitComparator{
		Comparable: comparable.toPB(),
		BitwiseOp:  &op,
	}
}
func (c *BitComparator) ConstructPBComparator() (*pb.Comparator, error) {
	if !BitComparatorBitwiseOp(*c.BitwiseOp).isValid() {
		return nil, errors.New("Invalid bitwise operator specified")
	}
	serializedComparator, err := proto.Marshal((*pb.BitComparator)(c))
	if err != nil {
		return nil, err
	}
	comparator := &pb.Comparator{
		Name:                 proto.String(comparatorPath + "BitComparator"),
		SerializedComparator: serializedComparator,
	}
	return comparator, nil
}
type NullComparator struct{}
func NewNullComparator() NullComparator {
	return NullComparator{}
}
func (c NullComparator) ConstructPBComparator() (*pb.Comparator, error) {
	serializedComparator, err := proto.Marshal(&pb.NullComparator{})
	if err != nil {
		return nil, err
	}
	comparator := &pb.Comparator{
		Name:                 proto.String(comparatorPath + "NullComparator"),
		SerializedComparator: serializedComparator,
	}
	return comparator, nil
}
type RegexStringComparator pb.RegexStringComparator