- Preconditions.checkNotNull(shardName, "shardName should not be null");
- Preconditions.checkNotNull(memberName, "memberName should not be null");
- Preconditions.checkNotNull(type, "type should not be null");
+ fullName = memberName.getName() + "-shard-" + shardName + "-" + type;
+ }
+
+ 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);
+ Preconditions.checkArgument(matcher.matches(), "Invalid shard id \"%s\"", shardIdString);