Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support expandable enums #974

Merged
merged 1 commit into from
Jul 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ public class HardwareProfile {
* 'Standard_G4', 'Standard_G5', 'Standard_GS1', 'Standard_GS2',
* 'Standard_GS3', 'Standard_GS4', 'Standard_GS5'.
*/
private String vmSize;
private VirtualMachineSizeTypes vmSize;

/**
* Get the vmSize value.
*
* @return the vmSize value
*/
public String vmSize() {
public VirtualMachineSizeTypes vmSize() {
return this.vmSize;
}

Expand All @@ -50,7 +50,7 @@ public String vmSize() {
* @param vmSize the vmSize value to set
* @return the HardwareProfile object itself.
*/
public HardwareProfile withVmSize(String vmSize) {
public HardwareProfile withVmSize(VirtualMachineSizeTypes vmSize) {
this.vmSize = vmSize;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public interface VirtualMachine extends
/**
* @return the virtual machine size
*/
String size();
VirtualMachineSizeTypes size();

/**
* @return the operating system of this virtual machine
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -492,13 +492,13 @@ public VirtualMachineImpl withPassword(String password) {

@Override
public VirtualMachineImpl withSize(String sizeName) {
this.inner().hardwareProfile().withVmSize(sizeName);
this.inner().hardwareProfile().withVmSize(new VirtualMachineSizeTypes(sizeName));
return this;
}

@Override
public VirtualMachineImpl withSize(VirtualMachineSizeTypes size) {
this.inner().hardwareProfile().withVmSize(size.toString());
this.inner().hardwareProfile().withVmSize(size);
return this;
}

Expand Down Expand Up @@ -699,7 +699,7 @@ public String computerName() {
}

@Override
public String size() {
public VirtualMachineSizeTypes size() {
return inner().hardwareProfile().vmSize();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,52 @@

package com.microsoft.azure.management.network;

import com.fasterxml.jackson.annotation.JsonValue;

/**
* Defines values for ApplicationGatewayCookieBasedAffinity.
*/
public final class ApplicationGatewayCookieBasedAffinity {
/** Static value Enabled for ApplicationGatewayCookieBasedAffinity. */
public static final String ENABLED = "Enabled";
public static final ApplicationGatewayCookieBasedAffinity ENABLED = new ApplicationGatewayCookieBasedAffinity("Enabled");

/** Static value Disabled for ApplicationGatewayCookieBasedAffinity. */
public static final String DISABLED = "Disabled";
public static final ApplicationGatewayCookieBasedAffinity DISABLED = new ApplicationGatewayCookieBasedAffinity("Disabled");

private String value;

/**
* Creates a custom value for ApplicationGatewayCookieBasedAffinity.
* @param value the custom value
*/
public ApplicationGatewayCookieBasedAffinity(String value) {
this.value = value;
}

@JsonValue
@Override
public String toString() {
return value;
}

@Override
public int hashCode() {
return value.hashCode();
}

private ApplicationGatewayCookieBasedAffinity() {
@Override
public boolean equals(Object obj) {
if (!(obj instanceof ApplicationGatewayCookieBasedAffinity)) {
return false;
}
if (obj == this) {
return true;
}
ApplicationGatewayCookieBasedAffinity rhs = (ApplicationGatewayCookieBasedAffinity) obj;
if (value == null) {
return rhs.value == null;
} else {
return value.equals(rhs.value);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,58 @@

package com.microsoft.azure.management.network;

import com.fasterxml.jackson.annotation.JsonValue;

/**
* Defines values for ApplicationGatewayOperationalState.
*/
public final class ApplicationGatewayOperationalState {
/** Static value Stopped for ApplicationGatewayOperationalState. */
public static final String STOPPED = "Stopped";
public static final ApplicationGatewayOperationalState STOPPED = new ApplicationGatewayOperationalState("Stopped");

/** Static value Starting for ApplicationGatewayOperationalState. */
public static final String STARTING = "Starting";
public static final ApplicationGatewayOperationalState STARTING = new ApplicationGatewayOperationalState("Starting");

/** Static value Running for ApplicationGatewayOperationalState. */
public static final String RUNNING = "Running";
public static final ApplicationGatewayOperationalState RUNNING = new ApplicationGatewayOperationalState("Running");

/** Static value Stopping for ApplicationGatewayOperationalState. */
public static final String STOPPING = "Stopping";
public static final ApplicationGatewayOperationalState STOPPING = new ApplicationGatewayOperationalState("Stopping");

private String value;

/**
* Creates a custom value for ApplicationGatewayOperationalState.
* @param value the custom value
*/
public ApplicationGatewayOperationalState(String value) {
this.value = value;
}

@JsonValue
@Override
public String toString() {
return value;
}

@Override
public int hashCode() {
return value.hashCode();
}

private ApplicationGatewayOperationalState() {
@Override
public boolean equals(Object obj) {
if (!(obj instanceof ApplicationGatewayOperationalState)) {
return false;
}
if (obj == this) {
return true;
}
ApplicationGatewayOperationalState rhs = (ApplicationGatewayOperationalState) obj;
if (value == null) {
return rhs.value == null;
} else {
return value.equals(rhs.value);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,52 @@

package com.microsoft.azure.management.network;

import com.fasterxml.jackson.annotation.JsonValue;

/**
* Defines values for ApplicationGatewayProtocol.
*/
public final class ApplicationGatewayProtocol {
/** Static value Http for ApplicationGatewayProtocol. */
public static final String HTTP = "Http";
public static final ApplicationGatewayProtocol HTTP = new ApplicationGatewayProtocol("Http");

/** Static value Https for ApplicationGatewayProtocol. */
public static final String HTTPS = "Https";
public static final ApplicationGatewayProtocol HTTPS = new ApplicationGatewayProtocol("Https");

private String value;

/**
* Creates a custom value for ApplicationGatewayProtocol.
* @param value the custom value
*/
public ApplicationGatewayProtocol(String value) {
this.value = value;
}

@JsonValue
@Override
public String toString() {
return value;
}

@Override
public int hashCode() {
return value.hashCode();
}

private ApplicationGatewayProtocol() {
@Override
public boolean equals(Object obj) {
if (!(obj instanceof ApplicationGatewayProtocol)) {
return false;
}
if (obj == this) {
return true;
}
ApplicationGatewayProtocol rhs = (ApplicationGatewayProtocol) obj;
if (value == null) {
return rhs.value == null;
} else {
return value.equals(rhs.value);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,52 @@

package com.microsoft.azure.management.network;

import com.fasterxml.jackson.annotation.JsonValue;

/**
* Defines values for ApplicationGatewayRequestRoutingRuleType.
*/
public final class ApplicationGatewayRequestRoutingRuleType {
/** Static value Basic for ApplicationGatewayRequestRoutingRuleType. */
public static final String BASIC = "Basic";
public static final ApplicationGatewayRequestRoutingRuleType BASIC = new ApplicationGatewayRequestRoutingRuleType("Basic");

/** Static value PathBasedRouting for ApplicationGatewayRequestRoutingRuleType. */
public static final String PATH_BASED_ROUTING = "PathBasedRouting";
public static final ApplicationGatewayRequestRoutingRuleType PATH_BASED_ROUTING = new ApplicationGatewayRequestRoutingRuleType("PathBasedRouting");

private String value;

/**
* Creates a custom value for ApplicationGatewayRequestRoutingRuleType.
* @param value the custom value
*/
public ApplicationGatewayRequestRoutingRuleType(String value) {
this.value = value;
}

@JsonValue
@Override
public String toString() {
return value;
}

@Override
public int hashCode() {
return value.hashCode();
}

private ApplicationGatewayRequestRoutingRuleType() {
@Override
public boolean equals(Object obj) {
if (!(obj instanceof ApplicationGatewayRequestRoutingRuleType)) {
return false;
}
if (obj == this) {
return true;
}
ApplicationGatewayRequestRoutingRuleType rhs = (ApplicationGatewayRequestRoutingRuleType) obj;
if (value == null) {
return rhs.value == null;
} else {
return value.equals(rhs.value);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ public class ApplicationGatewaySku {
* Gets or sets name of application gateway SKU. Possible values include:
* 'Standard_Small', 'Standard_Medium', 'Standard_Large'.
*/
private String name;
private ApplicationGatewaySkuName name;

/**
* Gets or sets tier of application gateway. Possible values include:
* 'Standard'.
*/
private String tier;
private ApplicationGatewayTier tier;

/**
* Gets or sets capacity (instance count) of application gateway.
Expand All @@ -35,7 +35,7 @@ public class ApplicationGatewaySku {
*
* @return the name value
*/
public String name() {
public ApplicationGatewaySkuName name() {
return this.name;
}

Expand All @@ -45,7 +45,7 @@ public String name() {
* @param name the name value to set
* @return the ApplicationGatewaySku object itself.
*/
public ApplicationGatewaySku withName(String name) {
public ApplicationGatewaySku withName(ApplicationGatewaySkuName name) {
this.name = name;
return this;
}
Expand All @@ -55,7 +55,7 @@ public ApplicationGatewaySku withName(String name) {
*
* @return the tier value
*/
public String tier() {
public ApplicationGatewayTier tier() {
return this.tier;
}

Expand All @@ -65,7 +65,7 @@ public String tier() {
* @param tier the tier value to set
* @return the ApplicationGatewaySku object itself.
*/
public ApplicationGatewaySku withTier(String tier) {
public ApplicationGatewaySku withTier(ApplicationGatewayTier tier) {
this.tier = tier;
return this;
}
Expand Down
Loading