/** * {@inheritDoc} */ @Override public NetworkSection build() { return new NetworkSection(info, networks); }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((href == null) ? 0 : href.hashCode()); result = prime * result + ((type == null) ? 0 : type.hashCode()); return result; }
public Builder fromNetworkSection(NetworkSection in) { return networks(in.getNetworks()).info(in.getInfo()); }
/** * {@inheritDoc} */ @Override public Builder toBuilder() { return builder().fromNetworkSection(this); }
public void test() { InputStream is = getClass().getResourceAsStream("/networksection.xml"); Injector injector = Guice.createInjector(new SaxParserModule()); Factory factory = injector.getInstance(ParseSax.Factory.class); NetworkSection result = factory.create(injector.getInstance(NetworkSectionHandler.class)).parse(is); assertEquals(result.toString(), NetworkSection.builder().info("List of logical networks used in the package") .network( Network.builder().name("red").description("The network the Red service is available on") .build()).network( Network.builder().name("blue").description("The network the Blue service is available on") .build()) .build().toString() ); } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; VCloudNetworkSection other = (VCloudNetworkSection) obj; if (href == null) { if (other.href != null) return false; } else if (!href.equals(other.href)) return false; if (type == null) { if (other.type != null) return false; } else if (!type.equals(other.type)) return false; return true; }
public Builder fromNetworkSection(NetworkSection in) { return networks(in.getNetworks()).info(in.getInfo()); }
/** * {@inheritDoc} */ @Override public Builder toBuilder() { return builder().fromNetworkSection(this); }
public void test() { InputStream is = getClass().getResourceAsStream("/networksection.xml"); Injector injector = Guice.createInjector(new SaxParserModule()); Factory factory = injector.getInstance(ParseSax.Factory.class); NetworkSection result = factory.create(injector.getInstance(NetworkSectionHandler.class)).parse(is); assertEquals(result.toString(), NetworkSection.builder().info("List of logical networks used in the package") .network( Network.builder().name("red").description("The network the Red service is available on") .build()).network( Network.builder().name("blue").description("The network the Blue service is available on") .build()) .build().toString() ); } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; VCloudNetworkSection other = (VCloudNetworkSection) obj; if (href == null) { if (other.href != null) return false; } else if (!href.equals(other.href)) return false; if (type == null) { if (other.type != null) return false; } else if (!type.equals(other.type)) return false; return true; }
public Builder fromNetworkSection(NetworkSection in) { return networks(in.getNetworks()).info(in.getInfo()); }
/** * {@inheritDoc} */ @Override public Builder toBuilder() { return builder().fromNetworkSection(this); }
/** * {@inheritDoc} */ @Override public NetworkSection build() { return new NetworkSection(info, networks); }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((href == null) ? 0 : href.hashCode()); result = prime * result + ((type == null) ? 0 : type.hashCode()); return result; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; VCloudNetworkSection other = (VCloudNetworkSection) obj; if (href == null) { if (other.href != null) return false; } else if (!href.equals(other.href)) return false; if (type == null) { if (other.type != null) return false; } else if (!type.equals(other.type)) return false; return true; }
public Builder fromNetworkSection(NetworkSection in) { return networks(in.getNetworks()).info(in.getInfo()); }
/** * {@inheritDoc} */ @Override public Builder toBuilder() { return builder().fromNetworkSection(this); }
/** * {@inheritDoc} */ @Override public NetworkSection build() { return new NetworkSection(info, networks); }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((href == null) ? 0 : href.hashCode()); result = prime * result + ((type == null) ? 0 : type.hashCode()); return result; }
public VCloudNetworkSection getResult() { NetworkSection system = networkSectionHandler.getResult(); return new VCloudNetworkSection(net.getType(), net.getHref(), system.getInfo(), system.getNetworks()); }