func (m *Match) GetType() MatchType {

	if m.MatchType != UnknownMatchType { // only figure out match type if its the default
		return m.MatchType
	}

	if fieldsPresent(m.Custom) {
		m.MatchType = CustomCheck
		return CustomCheck
	}

	if fieldsPresent(m.Authorisation) {
		m.MatchType = Authorisation
		return Authorisation
	}

	if fieldsPresent(m.Header) {
		return m.getHeaderType()
	}

	if fieldsPresent(m.HeaderPresent) {
		m.MatchType = HeaderPresent
		return HeaderPresent
	}
	if fieldsPresent(m.JSON, m.Regex) {
		m.MatchType = BodyJSONRegex
		return BodyJSONRegex
	}

	if fieldsPresent(m.Regex) {
		m.MatchType = BodyRegex
		return BodyRegex
	}

	if fieldsPresent(m.JSON, m.Value) {
		m.MatchType = BodyJSONValue
		return BodyJSONValue
	}

	if fieldsPresent(m.JSON) {
		if m.Count > 0 {
			m.MatchType = BodyJSONCount
			return BodyJSONCount
		}
	}

	if fieldsPresent(m.JSON) {
		m.MatchType = BodyJSONPresent
		return BodyJSONPresent
	}

	if m.BodyLength != nil {
		m.MatchType = BodyLength
		return BodyLength
	}

	return UnknownMatchType
}
// GetType - returns the type of a match
returns the type of a match
// GetType - returns the type of a match
func (m *Match) GetType() MatchType {
	if m.MatchType != UnknownMatchType { 
		return m.MatchType
	}
	if fieldsPresent(m.Custom) {
		m.MatchType = CustomCheck
		return CustomCheck
	}
	if fieldsPresent(m.Authorisation) {
		m.MatchType = Authorisation
		return Authorisation
	}
	if fieldsPresent(m.Header) {
		return m.getHeaderType()
	}
	if fieldsPresent(m.HeaderPresent) {
		m.MatchType = HeaderPresent
		return HeaderPresent
	}
	if fieldsPresent(m.JSON, m.Regex) {
		m.MatchType = BodyJSONRegex
		return BodyJSONRegex
	}
	if fieldsPresent(m.Regex) {
		m.MatchType = BodyRegex
		return BodyRegex
	}
	if fieldsPresent(m.JSON, m.Value) {
		m.MatchType = BodyJSONValue
		return BodyJSONValue
	}
	if fieldsPresent(m.JSON) {
		if m.Count > 0 {
			m.MatchType = BodyJSONCount
			return BodyJSONCount
		}
	}
	if fieldsPresent(m.JSON) {
		m.MatchType = BodyJSONPresent
		return BodyJSONPresent
	}
	if m.BodyLength != nil {
		m.MatchType = BodyLength
		return BodyLength
	}
	return UnknownMatchType
}
func ( m * Match ) GetType ( ) MatchType { if m . MatchType != UnknownMatchType { return m . MatchType } if fieldsPresent ( m . Custom ) { m . MatchType = CustomCheck return CustomCheck } if fieldsPresent ( m . Authorisation ) { m . MatchType = Authorisation return Authorisation } if fieldsPresent ( m . Header ) { return m . getHeaderType ( ) } if fieldsPresent ( m . HeaderPresent ) { m . MatchType = HeaderPresent return HeaderPresent } if fieldsPresent ( m . JSON , m . Regex ) { m . MatchType = BodyJSONRegex return BodyJSONRegex } if fieldsPresent ( m . Regex ) { m . MatchType = BodyRegex return BodyRegex } if fieldsPresent ( m . JSON , m . Value ) { m . MatchType = BodyJSONValue return BodyJSONValue } if fieldsPresent ( m . JSON ) { if m . Count > 0 { m . MatchType = BodyJSONCount return BodyJSONCount } } if fieldsPresent ( m . JSON ) { m . MatchType = BodyJSONPresent return BodyJSONPresent } if m . BodyLength != nil { m . MatchType = BodyLength return BodyLength } return UnknownMatchType }
returns the type of a match
returns the type of a match
// only figure out match type if its the default