gitlab.com/evatix-go/core@v1.3.55/keymk/Option.go (about)

     1  package keymk
     2  
     3  type Option struct {
     4  	Joiner                          string
     5  	IsSkipEmptyEntry, IsUseBrackets bool
     6  	StartBracket, EndBracket        string
     7  }
     8  
     9  func (it *Option) IsAddEntryRegardlessOfEmptiness() bool {
    10  	if it == nil {
    11  		return false
    12  	}
    13  
    14  	return !it.IsSkipEmptyEntry
    15  }
    16  
    17  func (it *Option) ClonePtr() *Option {
    18  	if it == nil {
    19  		return nil
    20  	}
    21  
    22  	return &Option{
    23  		Joiner:           it.Joiner,
    24  		IsSkipEmptyEntry: it.IsSkipEmptyEntry,
    25  		IsUseBrackets:    it.IsUseBrackets,
    26  		StartBracket:     it.StartBracket,
    27  		EndBracket:       it.EndBracket,
    28  	}
    29  }
    30  
    31  func (it Option) Clone() Option {
    32  	return Option{
    33  		Joiner:           it.Joiner,
    34  		IsSkipEmptyEntry: it.IsSkipEmptyEntry,
    35  		IsUseBrackets:    it.IsUseBrackets,
    36  		StartBracket:     it.StartBracket,
    37  		EndBracket:       it.EndBracket,
    38  	}
    39  }