Build a validator that checks if the data is equal to an exact value.

def _build_static_validator(exact_value):
    """Build a validator that checks if the data is equal to an exact value."""

    def static_validator(data):
        """Validate by equality."""
        if data == exact_value:
            return data

        raise NotValid('%r is not equal to %r' % (data, exact_value))

    return static_validator