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

org.cloudfoundry.multiapps.controller.process.variables.EnumVariable Maven / Gradle / Ivy

There is a newer version: 1.183.0
Show newest version
package org.cloudfoundry.multiapps.controller.process.variables;

import org.flowable.common.engine.api.variable.VariableContainer;
import org.immutables.value.Value;

@Value.Immutable
public abstract class EnumVariable> implements Variable {

    public abstract Class getType();

    @Override
    public Serializer getSerializer() {
        return new Serializer() {

            @Override
            public Object serialize(T value) {
                return value.toString();
            }

            @Override
            public T deserialize(Object serializedValue) {
                return Enum.valueOf(getType(), (String) serializedValue);
            }

            @Override
            public T deserialize(Object serializedValue, VariableContainer container) {
                return deserialize(serializedValue);
            }

        };
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy