/** * Creates a custom value for ExpressRouteCircuitSkuType. * @param sku the SKU */ public ExpressRouteCircuitSkuType(ExpressRouteCircuitSku sku) { // Store Sku copy since original user provided sku can be modified // by the user. // this.sku = createCopy(sku); this.value = this.sku.name(); VALUES_BY_NAME.put(this.value.toLowerCase(), this); }
/** * Creates a custom value for ExpressRouteCircuitSkuType. * @param sku the SKU */ public ExpressRouteCircuitSkuType(ExpressRouteCircuitSku sku) { // Store Sku copy since original user provided sku can be modified // by the user. // this.sku = createCopy(sku); this.value = this.sku.name(); VALUES_BY_NAME.put(this.value.toLowerCase(), this); }
/** * Searches for an SKU type and creates a new Express Route circuit SKU type instance if not found among the existing ones. * * @param sku an Express Route circuit SKU * @return the parsed or created Express Route circuit SKU type */ public static ExpressRouteCircuitSkuType fromSku(ExpressRouteCircuitSku sku) { if (sku == null) { return null; } String nameToLookFor = sku.name(); ExpressRouteCircuitSkuType result = VALUES_BY_NAME.get(nameToLookFor.toLowerCase()); if (result != null) { return result; } else { return new ExpressRouteCircuitSkuType(sku); } }
/** * Searches for an SKU type and creates a new Express Route circuit SKU type instance if not found among the existing ones. * * @param sku an Express Route circuit SKU * @return the parsed or created Express Route circuit SKU type */ public static ExpressRouteCircuitSkuType fromSku(ExpressRouteCircuitSku sku) { if (sku == null) { return null; } String nameToLookFor = sku.name(); ExpressRouteCircuitSkuType result = VALUES_BY_NAME.get(nameToLookFor.toLowerCase()); if (result != null) { return result; } else { return new ExpressRouteCircuitSkuType(sku); } }
/** * Creates a copy of the given sku. * * @param sku the sku to create copy of * @return the copy */ private static ExpressRouteCircuitSku createCopy(ExpressRouteCircuitSku sku) { return new ExpressRouteCircuitSku() .withName(sku.name()) .withTier(sku.tier()) .withFamily(sku.family()); } }
/** * Creates a copy of the given sku. * * @param sku the sku to create copy of * @return the copy */ private static ExpressRouteCircuitSku createCopy(ExpressRouteCircuitSku sku) { return new ExpressRouteCircuitSku() .withName(sku.name()) .withTier(sku.tier()) .withFamily(sku.family()); } }