@Test public void testInstanciateWithApiOrSpacedogBackendId() { assertEquals(SpaceBackend.production, SpaceBackend.production.fromBackendId("api")); assertEquals(SpaceBackend.production, SpaceBackend.production.fromBackendId("spacedog")); }
public SpaceBackend fromBackendId(String backendId) { if (!isMulti()) throw Exceptions.illegalArgument( "backend [%s] is not instanciable", this); if (SPACEDOG.equalsIgnoreCase(backendId) || API.equalsIgnoreCase(backendId)) return this; SpaceBackend backend = new SpaceBackend(); backend.hostPrefix = hostPrefix; backend.id = backendId; backend.hostSuffix = hostSuffix; backend.port = port; backend.ssl = ssl; return backend; }
SpaceBackend { public SpaceBackend fromBackendId(String backendId) { if (!isMulti()) throw Exceptions.illegalArgument( "backend [%s] is not instanciable", this); if (SPACEDOG.equalsIgnoreCase(backendId) || API.equalsIgnoreCase(backendId)) return this; SpaceBackend backend = new SpaceBackend(); backend.hostPrefix = hostPrefix; backend.id = backendId; backend.hostSuffix = hostSuffix; backend.port = port; backend.ssl = ssl; return backend; } }
SpaceBackend { public SpaceBackend fromBackendId(String backendId) { if (!isMulti()) throw Exceptions.illegalArgument( "backend [%s] is not instanciable", this); if (SPACEDOG.equalsIgnoreCase(backendId) || API.equalsIgnoreCase(backendId)) return this; SpaceBackend backend = new SpaceBackend(); backend.hostPrefix = hostPrefix; backend.id = backendId; backend.hostSuffix = hostSuffix; backend.port = port; backend.ssl = ssl; return backend; } private  SpaceBackend(); }
SpaceBackend { public SpaceBackend fromBackendId(String backendId) { if (!isMulti()) throw Exceptions.illegalArgument( "backend [%s] is not instanciable", this); if (SPACEDOG.equalsIgnoreCase(backendId) || API.equalsIgnoreCase(backendId)) return this; SpaceBackend backend = new SpaceBackend(); backend.hostPrefix = hostPrefix; backend.id = backendId; backend.hostSuffix = hostSuffix; backend.port = port; backend.ssl = ssl; return backend; } private  SpaceBackend(); String scheme(); String id(); String host(); int port(); boolean ssl(); boolean isMulti(); String name(); SpaceBackend name(String name); @Override String toString(); @Override boolean equals(Object object); StringBuilder urlBuilder(); String url(); String url(String path); static SpaceBackend fromUrl(String url); static SpaceBackend fromDefaults(String name); static SpaceBackend valueOf(String string); Optional<SpaceBackend> fromRequest(String requestHostAndPort); SpaceBackend fromBackendId(String backendId); static boolean isValid(String backendId); static void checkIsValid(String backendId); }
SpaceBackend { public SpaceBackend fromBackendId(String backendId) { if (!isMulti()) throw Exceptions.illegalArgument( "backend [%s] is not instanciable", this); if (SPACEDOG.equalsIgnoreCase(backendId) || API.equalsIgnoreCase(backendId)) return this; SpaceBackend backend = new SpaceBackend(); backend.hostPrefix = hostPrefix; backend.id = backendId; backend.hostSuffix = hostSuffix; backend.port = port; backend.ssl = ssl; return backend; } private  SpaceBackend(); String scheme(); String id(); String host(); int port(); boolean ssl(); boolean isMulti(); String name(); SpaceBackend name(String name); @Override String toString(); @Override boolean equals(Object object); StringBuilder urlBuilder(); String url(); String url(String path); static SpaceBackend fromUrl(String url); static SpaceBackend fromDefaults(String name); static SpaceBackend valueOf(String string); Optional<SpaceBackend> fromRequest(String requestHostAndPort); SpaceBackend fromBackendId(String backendId); static boolean isValid(String backendId); static void checkIsValid(String backendId); static final String API; static final String SPACEDOG; static SpaceBackend local; static SpaceBackend wwwLocal; static SpaceBackend staging; static SpaceBackend wwwStaging; static SpaceBackend production; static SpaceBackend wwwProduction; }