@Test public void testInvalidServiceNames() { String[] invalidNames = new String[] {"Foo$Bar", "%", "a@b", "!", null, ""}; for (String name : invalidNames) { try { new ServiceEndPointBuilder().withServiceName(name); fail(name + " was allowed"); } catch (AssertionError e) { throw e; } catch (IllegalArgumentException e) { } catch (Throwable t) { fail(name + " threw " + t.getMessage()); } } }
public ServiceEndPointBuilder withServiceName(String serviceName) { Preconditions.checkArgument(getCheckExpression(serviceName)); _serviceName = serviceName; return this; }
ServiceEndPointBuilder { public ServiceEndPointBuilder withServiceName(String serviceName) { Preconditions.checkArgument(getCheckExpression(serviceName)); _serviceName = serviceName; return this; } }
ServiceEndPointBuilder { public ServiceEndPointBuilder withServiceName(String serviceName) { Preconditions.checkArgument(getCheckExpression(serviceName)); _serviceName = serviceName; return this; }  }
ServiceEndPointBuilder { public ServiceEndPointBuilder withServiceName(String serviceName) { Preconditions.checkArgument(getCheckExpression(serviceName)); _serviceName = serviceName; return this; }  ServiceEndPointBuilder withServiceName(String serviceName); ServiceEndPointBuilder withId(String id); ServiceEndPointBuilder withPayload(String payload); ServiceEndPoint build(); }
ServiceEndPointBuilder { public ServiceEndPointBuilder withServiceName(String serviceName) { Preconditions.checkArgument(getCheckExpression(serviceName)); _serviceName = serviceName; return this; }  ServiceEndPointBuilder withServiceName(String serviceName); ServiceEndPointBuilder withId(String id); ServiceEndPointBuilder withPayload(String payload); ServiceEndPoint build();  }