com.arm.mbed.cloud.sdk.accountmanagement.model.AccountStatus Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mbed-cloud-sdk Show documentation
Show all versions of mbed-cloud-sdk Show documentation
The Pelion Cloud SDK (formerly known as Mbed Cloud SDK) provides a simplified interface to the Pelion Cloud APIs by exposing functionality using conventions and paradigms familiar to Java developers.
/**
*
*/
package com.arm.mbed.cloud.sdk.accountmanagement.model;
import com.arm.mbed.cloud.sdk.annotations.Preamble;
import com.arm.mbed.cloud.sdk.common.SdkEnum;
@Preamble(description = "The status of the account")
public enum AccountStatus implements SdkEnum {
ENROLLING, ACTIVE, SUSPENDED, RESTRICTED;
/**
* States if it is the default status.
*
* @see SdkEnum#isDefault()
*/
@Override
public boolean isDefault() {
return this == getDefault();
}
/**
* Gets default value.
*
* @return default value.
*/
public static AccountStatus getDefault() {
return AccountStatus.SUSPENDED;
}
/**
* Gets string representation.
*
* @see SdkEnum#getString()
*/
@Override
public String getString() {
return toString();
}
/**
* Merges two items.
*
* @see SdkEnum#merge(SdkEnum, SdkEnum)
*/
@Override
public T merge(T obj1, T obj2) {
if (obj1 == null) {
return obj2;
}
if (obj2 == null) {
return obj1;
}
if (obj1.isDefault()) {
return obj2;
}
if (obj2.isDefault()) {
return obj1;
}
return obj2;
}
}