- Preconditions.checkNotNull(shardName, "shardName should not be null");
- Preconditions.checkNotNull(memberName, "memberName should not be null");
- Preconditions.checkNotNull(type, "type should not be null");
+ public static ShardIdentifier create(final String shardName, final MemberName memberName, final String type) {
+ return new ShardIdentifier(shardName, memberName, type);
+ }
+
+ public static ShardIdentifier fromShardIdString(final String shardIdString) {
+ final Matcher matcher = PATTERN.matcher(shardIdString);
+ checkArgument(matcher.matches(), "Invalid shard id \"%s\"", shardIdString);