@Override Network toPb() { Network networkPb = new Network().setAutoCreateSubnetworks(autoCreateSubnetworks); if (subnetworks != null) { networkPb.setSubnetworks(Lists.transform(subnetworks, SubnetworkId.TO_URL_FUNCTION)); } return networkPb; }
Network toPb() { Network networkPb = configuration.toPb(); if (generatedId != null) { networkPb.setId(new BigInteger(generatedId)); } if (creationTimestamp != null) { networkPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); } networkPb.setName(networkId.getNetwork()); networkPb.setDescription(description); networkPb.setSelfLink(networkId.getSelfLink()); return networkPb; }
@SuppressWarnings("unchecked") static SubnetNetworkConfiguration fromPb(Network networkPb) { List<SubnetworkId> subnetworks = null; if (networkPb.getSubnetworks() != null) { subnetworks = Lists.transform(networkPb.getSubnetworks(), SubnetworkId.FROM_URL_FUNCTION); } return new SubnetNetworkConfiguration(networkPb.getAutoCreateSubnetworks(), subnetworks); } }
@Override Network toPb() { return new Network().setIPv4Range(ipRange).setGatewayIPv4(gatewayAddress); }
@SuppressWarnings("unchecked") static StandardNetworkConfiguration fromPb(Network networkPb) { return new StandardNetworkConfiguration(networkPb.getIPv4Range(), networkPb.getGatewayIPv4()); } }
Network network = new Network() .setAutoCreateSubnetworks(true) .setName(networkName) .setDescription("Spinnaker network auto-created by Halyard");
BuilderImpl(Network networkPb) { if (networkPb.getId() != null) { this.generatedId = networkPb.getId().toString(); } if (networkPb.getCreationTimestamp() != null) { this.creationTimestamp = TIMESTAMP_FORMATTER.parseMillis(networkPb.getCreationTimestamp()); } this.networkId = NetworkId.fromUrl(networkPb.getSelfLink()); this.description = networkPb.getDescription(); this.configuration = NetworkConfiguration.fromPb(networkPb); }
@SuppressWarnings("unchecked") static <T extends NetworkConfiguration> T fromPb(Network networkPb) { if (networkPb.getIPv4Range() != null) { return (T) StandardNetworkConfiguration.fromPb(networkPb); } else { return (T) SubnetNetworkConfiguration.fromPb(networkPb); } } }
Network network = new Network() .setAutoCreateSubnetworks(true) .setName(networkName) .setDescription("Spinnaker network auto-created by Halyard");
@Override Network toPb() { return new Network().setIPv4Range(ipRange).setGatewayIPv4(gatewayAddress); }
BuilderImpl(Network networkPb) { if (networkPb.getId() != null) { this.generatedId = networkPb.getId().toString(); } if (networkPb.getCreationTimestamp() != null) { this.creationTimestamp = TIMESTAMP_FORMATTER.parseMillis(networkPb.getCreationTimestamp()); } this.networkId = NetworkId.fromUrl(networkPb.getSelfLink()); this.description = networkPb.getDescription(); this.configuration = NetworkConfiguration.fromPb(networkPb); }
@SuppressWarnings("unchecked") static StandardNetworkConfiguration fromPb(Network networkPb) { return new StandardNetworkConfiguration(networkPb.getIPv4Range(), networkPb.getGatewayIPv4()); } }
@SuppressWarnings("unchecked") static <T extends NetworkConfiguration> T fromPb(Network networkPb) { if (networkPb.getIPv4Range() != null) { return (T) StandardNetworkConfiguration.fromPb(networkPb); } else { return (T) SubnetNetworkConfiguration.fromPb(networkPb); } } }
Network toPb() { Network networkPb = configuration.toPb(); if (generatedId != null) { networkPb.setId(new BigInteger(generatedId)); } if (creationTimestamp != null) { networkPb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp)); } networkPb.setName(networkId.getNetwork()); networkPb.setDescription(description); networkPb.setSelfLink(networkId.getSelfLink()); return networkPb; }
@Override Network toPb() { Network networkPb = new Network().setAutoCreateSubnetworks(autoCreateSubnetworks); if (subnetworks != null) { networkPb.setSubnetworks(Lists.transform(subnetworks, SubnetworkId.TO_URL_FUNCTION)); } return networkPb; }
@SuppressWarnings("unchecked") static SubnetNetworkConfiguration fromPb(Network networkPb) { List<SubnetworkId> subnetworks = null; if (networkPb.getSubnetworks() != null) { subnetworks = Lists.transform(networkPb.getSubnetworks(), SubnetworkId.FROM_URL_FUNCTION); } return new SubnetNetworkConfiguration(networkPb.getAutoCreateSubnetworks(), subnetworks); } }