Skip to content

'Constructors' for alternate data formats #34

@simbrett

Description

@simbrett

Hello,
I'm new to ValueOf so this may be a basic question, but it there a way of creating an object with alternative data formats? For example I would like to represent a telephone number as a long, but I also want to be able to create the object using a string.

So I would like to accept:
1234567890 (long)
But I would also like to create the object using
(123)456-7890 (string)
or 123-456-7890 (string)
or +1 123-45-6789 (string).

In all cases, the actual data would be represented as a long.

I realize that I'm supposed to create the object using TelephoneNumber.From(1234567890)
but can I have the alternate constructors?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions