gitlab.com/evatix-go/core@v1.3.55/coreinstruction/BaseDisplay.go (about)

     1  package coreinstruction
     2  
     3  import (
     4  	"regexp"
     5  	"strings"
     6  )
     7  
     8  type BaseDisplay struct {
     9  	Display string `json:"Display"`
    10  }
    11  
    12  func (receiver BaseDisplay) IsDisplay(display string) bool {
    13  	return receiver.Display == display
    14  }
    15  
    16  func (receiver BaseDisplay) IsDisplayCaseInsensitive(display string) bool {
    17  	return strings.EqualFold(receiver.Display, display)
    18  }
    19  
    20  func (receiver BaseDisplay) IsDisplayContains(displayContains string) bool {
    21  	return strings.Contains(receiver.Display, displayContains)
    22  
    23  }
    24  
    25  func (receiver BaseDisplay) IsDisplayRegexMatches(regex *regexp.Regexp) bool {
    26  	return regex.MatchString(receiver.Display)
    27  }