public class IotHubConnectionStringBuilder extends Object
| Constructor and Description |
|---|
IotHubConnectionStringBuilder() |
| Modifier and Type | Method and Description |
|---|---|
static IotHubConnectionString |
createConnectionString(String connectionString)
Static constructor to create IotHubConnectionString deserialize the given string
|
static IotHubConnectionString |
createConnectionString(String hostName,
AuthenticationMethod authenticationMethod)
Static constructor to create IotHubConnectionString from host name and authentication method
|
protected static void |
parse(String connectionString,
IotHubConnectionString iotHubConnectionString)
Deserialize connection string
|
protected static String |
parseIotHubName(IotHubConnectionString iotHubConnectionString)
Parse the iot hub name part from the host name
|
protected static void |
setAuthenticationMethod(AuthenticationMethod authenticationMethod,
IotHubConnectionString iotHubConnectionString)
Set authentication method to target IotHubConnectionString object
|
protected static void |
setHostName(String hostName,
IotHubConnectionString iotHubConnectionString)
Set host name value to target IotHubConnectionString object
|
protected static void |
validate(IotHubConnectionString iotHubConnectionString)
Validate IotHubConnectionString format
|
protected static void |
validateFormat(String value,
String propertyName,
String regex)
Validate string property using given regex
|
protected static void |
validateFormatIfSpecified(String value,
String propertyName,
String regex)
Validate string property using given regex if value is not null or empty
|
public static IotHubConnectionString createConnectionString(String connectionString) throws IOException
connectionString - The serialized connection stringIOException - This exception is thrown if the object creation failedpublic static IotHubConnectionString createConnectionString(String hostName, AuthenticationMethod authenticationMethod) throws IOException
hostName - The hostName stringauthenticationMethod - The AuthenticationMethod objectIOException - This exception is thrown if the object creation failedprotected static void parse(String connectionString, IotHubConnectionString iotHubConnectionString) throws IOException
connectionString - The connection string to deserializeiotHubConnectionString - The target object for deserializationIOException - This exception is thrown if the parsing failedprotected static String parseIotHubName(IotHubConnectionString iotHubConnectionString)
iotHubConnectionString - The source iotHubConnectionString containing the hostNameprotected static void validate(IotHubConnectionString iotHubConnectionString) throws IllegalArgumentException
iotHubConnectionString - The object to validateIllegalArgumentException - This exception is thrown if the input object is nullprotected static void validateFormat(String value, String propertyName, String regex)
value - The string value to validatepropertyName - The property nameregex - The regex used for validationprotected static void validateFormatIfSpecified(String value, String propertyName, String regex)
value - string value to validatepropertyName - property nameregex - regex used for validationprotected static void setHostName(String hostName, IotHubConnectionString iotHubConnectionString)
hostName - host name stringiotHubConnectionString - target IotHubConnectionString objectprotected static void setAuthenticationMethod(AuthenticationMethod authenticationMethod, IotHubConnectionString iotHubConnectionString)
authenticationMethod - value to setiotHubConnectionString - target IotHubConnectionString objectCopyright © 2017. All rights reserved.