@classmethod
def from_string(cls, text):
    """Constructs from string.

        :param text: the version in format '[{epoch-}]-{version}-{release}'
        """
    components = text.split('-')
    if len(components) > 2:
        epoch = components[0]
        components = components[1:]
    else:
        epoch = 0
    return cls(epoch, components[0], components[1])
