Modules/Patterns/Pattern.vb

22 lines
636 B
VB.net

Public Class Pattern
Public ReadOnly Property Type As String
Public ReadOnly Property Value As String
Public Sub New(pType As String, pValue As String)
Me.Type = pType
Me.Value = pValue
End Sub
Public Overrides Function ToString() As String
Return $"{{#{Type}#{Value}}}"
End Function
Public Overrides Function GetHashCode() As Integer
Return (Value.GetHashCode & Type.GetHashCode).GetHashCode
End Function
Public Overrides Function Equals(obj As Object) As Boolean
Return Me.GetHashCode = DirectCast(obj, Pattern).GetHashCode
End Function
End Class