All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.twilio.sdk.converter.Promoter Maven / Gradle / Ivy

There is a newer version: 7.0.0-rc-7
Show newest version
package com.twilio.sdk.converter;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;

public class Promoter {

    /**
     * Create a @see java.net.URI from a string
     *
     * @param url url to convert
     * @return built @see java.net.URI
     */
    public static URI uriFromString(final String url) {
        try {
            return new URI(url);
        } catch (URISyntaxException e) {
            return null;
        }
    }

    /**
     * Create a list from a single element.
     *
     * @param one the single element
     * @param  type of the element
     * @return List containing the single element
     */
    public static  List listOfOne(final T one) {
        List list = new ArrayList<>();
        list.add(one);
        return list;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy