@Test public void test_serialization() throws IOException, ClassNotFoundException { assertEquals(cluster1, cluster2); assertSame(cluster1.getStripe("stripe-1").get(), cluster1.getStripe("stripe-1").get().getServerByName("server-1").get().getStripe()); assertSame(cluster1, cluster1.getStripe("stripe-1").get().getServerByName("server-1").get().getStripe().getCluster()); Cluster c1_copy = copy(cluster1); Cluster c2_copy = copy(cluster2); assertEquals(cluster1, c1_copy); assertEquals(cluster1, c2_copy); assertSame(c1_copy.getStripe("stripe-1").get(), c1_copy.getStripe("stripe-1").get().getServerByName("server-1").get().getStripe()); assertSame(c1_copy, c1_copy.getStripe("stripe-1").get().getServerByName("server-1").get().getStripe().getCluster()); }
public Optional<Stripe> getStripe(Context context) { return getStripe(context.get(Stripe.KEY)); }
Cluster implements Contextual { public Optional<Stripe> getStripe(Context context) { return getStripe(context.get(Stripe.KEY)); } }
Cluster implements Contextual { public Optional<Stripe> getStripe(Context context) { return getStripe(context.get(Stripe.KEY)); } private  Cluster(); }
Cluster implements Contextual { public Optional<Stripe> getStripe(Context context) { return getStripe(context.get(Stripe.KEY)); } private  Cluster(); boolean isEmpty(); Stream<Client> clientStream(); Stream<Stripe> stripeStream(); Map<String, Client> getClients(); int getClientCount(); Map<String, Stripe> getStripes(); int getStripeCount(); Stripe getSingleStripe(); boolean addClient(Client client); Optional<Client> getClient(Context context); Optional<Client> getClient(ClientIdentifier clientIdentifier); Optional<Client> getClient(String id); Optional<Client> removeClient(String id); boolean addStripe(Stripe stripe); Optional<Stripe> getStripe(Context context); Optional<Stripe> getStripe(String id); Optional<Stripe> removeStripe(String id); Optional<ServerEntity> getActiveServerEntity(Context context); Optional<ServerEntity> getServerEntity(Context context); Optional<Server> getServer(Context context); List<? extends Node> getNodes(Context context); String getPath(Context context); Stream<ServerEntity> serverEntityStream(); Stream<ServerEntity> activeServerEntityStream(); Stream<Server> serverStream(); @Override Context getContext(); @Override void setContext(Context context); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @SuppressWarnings("rawtypes") Map<String, Object> toMap(); static Cluster create(); }
Cluster implements Contextual { public Optional<Stripe> getStripe(Context context) { return getStripe(context.get(Stripe.KEY)); } private  Cluster(); boolean isEmpty(); Stream<Client> clientStream(); Stream<Stripe> stripeStream(); Map<String, Client> getClients(); int getClientCount(); Map<String, Stripe> getStripes(); int getStripeCount(); Stripe getSingleStripe(); boolean addClient(Client client); Optional<Client> getClient(Context context); Optional<Client> getClient(ClientIdentifier clientIdentifier); Optional<Client> getClient(String id); Optional<Client> removeClient(String id); boolean addStripe(Stripe stripe); Optional<Stripe> getStripe(Context context); Optional<Stripe> getStripe(String id); Optional<Stripe> removeStripe(String id); Optional<ServerEntity> getActiveServerEntity(Context context); Optional<ServerEntity> getServerEntity(Context context); Optional<Server> getServer(Context context); List<? extends Node> getNodes(Context context); String getPath(Context context); Stream<ServerEntity> serverEntityStream(); Stream<ServerEntity> activeServerEntityStream(); Stream<Server> serverStream(); @Override Context getContext(); @Override void setContext(Context context); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @SuppressWarnings("rawtypes") Map<String, Object> toMap(); static Cluster create();  }