package com.broadleafdemo.metadata.customer.support;
import com.broadleafcommerce.metadata.dsl.core.extension.fields.SelectOption;
import java.util.List;
public enum PreferredCommunicationMethodOptionEnum implements SelectOption.SelectOptionEnum {
PHONE("custom.customer.preferredCommunicationMethod.phone", "primary"),
TEXT("custom.customer.preferredCommunicationMethod.text", "primary"),
EMAIL("custom.customer.preferredCommunicationMethod.email", "primary");
PreferredCommunicationMethodOptionEnum(String label, String color) {
this.label = label;
this.color = color;
}
/**
* This is displayed to the user and can be a message property key to support localized
* translations.
*/
private String label;
/**
* Options can be differentiated by color as well. This should reference a color that the Admin
* client understands such as {@code primary}, {@code gray}, {@code green}, etc. It defaults to
* {@code default}, which means the default text color.
*/
private String color;
@Override
public String label() {
return label;
}
@Override
public String color() {
return color;
}
/**
* Factory method to generate a set of {@link SelectOption} from this enumeration. This will be
* referenced in the metadata DSL for the related field to let the Admin know what values a
* user can choose from.
*
* @return the set of options
*/
public static List<SelectOption> toOptions() {
return SelectOption.fromEnums(values());
}
}