All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mel.maven.camel-salesforce-maven-plugin.2.12.0.source-code.sobject-picklist.vm Maven / Gradle / Ivy

There is a newer version: 4.8.1
Show newest version
## sobject-picklist.vm
/*
 * Salesforce DTO generated by camel-salesforce-maven-plugin
 * Generated on: $generatedDate
 */
package $packageName;

import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonValue;

#set ( $enumName = $utility.enumTypeName($field.Name) )
/**
 * Salesforce Enumeration DTO for picklist $field.Name
 */
public enum $enumName {
## find the last entry
#set ( $lastEntry = $utility.getLastEntry($field) )

#foreach ( $entry in $field.PicklistValues)
#set ( $value = $entry.Value )
#if ( $entry == $lastEntry )
#set ( $delim = ";" )
#else
#set ( $delim = ",")
#end
    // $value
    $utility.getEnumConstant($value)("$value")$delim
#end

    final String value;

    private $enumName(String value) {
        this.value = value;
    }

    @JsonValue
    public String value() {
        return this.value;
    }

    @JsonCreator
    public static $enumName fromValue(String value) {
#set ( $allValues = ".values()" )
        for ($enumName e : $enumName$allValues) {
            if (e.value.equals(value)) {
                return e;
            }
        }
        throw new IllegalArgumentException(value);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy