add equal function for compare types with array field 'data'