File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
main/java/com/twilio/converter
test/java/com/twilio/converter Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 11package com .twilio .converter ;
22
3+ import com .twilio .type .PhoneNumber ;
4+
35import java .net .URI ;
46import java .net .URISyntaxException ;
57import java .util .ArrayList ;
@@ -21,6 +23,16 @@ public static URI uriFromString(final String url) {
2123 }
2224 }
2325
26+ /**
27+ * Create a @see com.twilio.types.PhoneNumber from a string
28+ *
29+ * @param pn PhoneNumber to convert
30+ * @return built @see com.twilio.types.PhoneNumber
31+ */
32+ public static PhoneNumber phoneNumberFromString (final String pn ) {
33+ return new PhoneNumber (pn );
34+ }
35+
2436 /**
2537 * Create a list from a single element.
2638 *
Original file line number Diff line number Diff line change 11package com .twilio .converter ;
22
33import com .google .common .collect .Lists ;
4+ import com .twilio .type .PhoneNumber ;
45import org .junit .Assert ;
56import org .junit .Test ;
67
@@ -20,6 +21,12 @@ public void testPromoteUri() {
2021 );
2122 }
2223
24+ @ Test
25+ public void testPhoneNumberFromString () {
26+ PhoneNumber pn = Promoter .phoneNumberFromString ("+12345678910" );
27+ Assert .assertEquals (new PhoneNumber ("+12345678910" ), pn );
28+ }
29+
2330 @ Test
2431 public void testPromoteList () {
2532 String s = "hi" ;
You can’t perform that action at this time.
0 commit comments