'Provides the string representation of our policy. This does not
necessarily match the rule that we were constructed from (due to things
like IPv6 address collapsing or the multiple representations that our mask
can have). However, it is a valid that would be accepted by our constructor
to re-create this rule.'

@lru_cache()
def __str__(self):

    label = ('accept    ' if self.is_accept else 'reject    ')
    if self.is_address_wildcard():
        label += '*:'
    else:
        address_type = self.get_address_type()
        if (address_type == AddressType.IPv4):
            label += self.address
        else:
            label += ('[%s]' % self.address)
        if (((address_type == AddressType.IPv4) and (self._masked_bits == 32)) or ((address_type == AddressType.IPv6) and (self._masked_bits == 128))):
            label += ':'
        elif (self._masked_bits is not None):
            label += ('/%i:' % self._masked_bits)
        else:
            label += ('/%s:' % self.get_mask())
    if self.is_port_wildcard():
        label += '*'
    elif (self.min_port == self.max_port):
        label += str(self.min_port)
    else:
        label += ('%i-%i' % (self.min_port, self.max_port))
    return label
