/** * Tries to parse the passed-in uaid into a valid UUID. If the string cannot * be parsed into a valid UUID a new UUID will be generated. * * @param uaid the UserAgentID string representation to be parsed. * @return {@code String} the UserAgentID in UUID format representing the passed in uaid, or * a new UUID if the uaid was not in a valid UUID format. */ public static String fromString(final String uaid) { try { return UUID.fromString(uaid).toString(); } catch (final Exception e) { return newUAID(); } }
public HelloMessageImpl(final String uaid, final Set<String> channelIds) { if (nullOrEmpty(uaid)) { this.uaid = newUAID(); this.channelIds = Collections.emptySet(); } else { this.channelIds = channelIds; this.uaid = fromString(uaid); } }
public HelloMessageImpl(final String uaid, final Set<String> channelIds) { if (nullOrEmpty(uaid)) { this.uaid = newUAID(); this.channelIds = Collections.emptySet(); } else { this.channelIds = channelIds; this.uaid = fromString(uaid); } }