@Test void createAllowsValidNamespaces() { create("minecraft", "brand"); }
public static MinecraftChannelIdentifier create(String namespace, String name) { Preconditions.checkArgument(!Strings.isNullOrEmpty(namespace), "namespace is null or empty"); Preconditions.checkArgument(name != null, "namespace is null or empty"); Preconditions.checkArgument(VALID_IDENTIFIER_REGEX.matcher(namespace).matches(), "namespace is not valid"); Preconditions .checkArgument(VALID_IDENTIFIER_REGEX.matcher(name).matches(), "name is not valid"); return new MinecraftChannelIdentifier(namespace, name); }
MinecraftChannelIdentifier implements ChannelIdentifier { public static MinecraftChannelIdentifier create(String namespace, String name) { Preconditions.checkArgument(!Strings.isNullOrEmpty(namespace), "namespace is null or empty"); Preconditions.checkArgument(name != null, "namespace is null or empty"); Preconditions.checkArgument(VALID_IDENTIFIER_REGEX.matcher(namespace).matches(), "namespace is not valid"); Preconditions .checkArgument(VALID_IDENTIFIER_REGEX.matcher(name).matches(), "name is not valid"); return new MinecraftChannelIdentifier(namespace, name); } }
MinecraftChannelIdentifier implements ChannelIdentifier { public static MinecraftChannelIdentifier create(String namespace, String name) { Preconditions.checkArgument(!Strings.isNullOrEmpty(namespace), "namespace is null or empty"); Preconditions.checkArgument(name != null, "namespace is null or empty"); Preconditions.checkArgument(VALID_IDENTIFIER_REGEX.matcher(namespace).matches(), "namespace is not valid"); Preconditions .checkArgument(VALID_IDENTIFIER_REGEX.matcher(name).matches(), "name is not valid"); return new MinecraftChannelIdentifier(namespace, name); } private  MinecraftChannelIdentifier(String namespace, String name); }
MinecraftChannelIdentifier implements ChannelIdentifier { public static MinecraftChannelIdentifier create(String namespace, String name) { Preconditions.checkArgument(!Strings.isNullOrEmpty(namespace), "namespace is null or empty"); Preconditions.checkArgument(name != null, "namespace is null or empty"); Preconditions.checkArgument(VALID_IDENTIFIER_REGEX.matcher(namespace).matches(), "namespace is not valid"); Preconditions .checkArgument(VALID_IDENTIFIER_REGEX.matcher(name).matches(), "name is not valid"); return new MinecraftChannelIdentifier(namespace, name); } private  MinecraftChannelIdentifier(String namespace, String name); static MinecraftChannelIdentifier forDefaultNamespace(String name); static MinecraftChannelIdentifier create(String namespace, String name); String getNamespace(); String getName(); @Override String toString(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override String getId(); }
MinecraftChannelIdentifier implements ChannelIdentifier { public static MinecraftChannelIdentifier create(String namespace, String name) { Preconditions.checkArgument(!Strings.isNullOrEmpty(namespace), "namespace is null or empty"); Preconditions.checkArgument(name != null, "namespace is null or empty"); Preconditions.checkArgument(VALID_IDENTIFIER_REGEX.matcher(namespace).matches(), "namespace is not valid"); Preconditions .checkArgument(VALID_IDENTIFIER_REGEX.matcher(name).matches(), "name is not valid"); return new MinecraftChannelIdentifier(namespace, name); } private  MinecraftChannelIdentifier(String namespace, String name); static MinecraftChannelIdentifier forDefaultNamespace(String name); static MinecraftChannelIdentifier create(String namespace, String name); String getNamespace(); String getName(); @Override String toString(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override String getId();  }