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

org.khasanof.state.configurer.StateConfigurerImpl Maven / Gradle / Ivy

The newest version!
package org.khasanof.state.configurer;

import org.springframework.util.Assert;

import java.util.EnumSet;

/**
 * @author Nurislom
 * @see org.khasanof.state.configurer
 * @since 10/7/2023 9:12 PM
 */
public class StateConfigurerImpl implements StateConfigurer, StateConfigReader {

    private Enum initial;
    private EnumSet states;

    @Override
    public StateConfigurer initial(Enum initial) {
        Assert.notNull(initial, "initial state must not be null!");
        this.initial = initial;
        return this;
    }

    @Override
    public StateConfigurer states(EnumSet states) {
        Assert.notNull(states, "states must not be null!");
        this.states = states;
        return this;
    }

    @Override
    public Enum getInitial() {
        return this.initial;
    }

    @Override
    public EnumSet getStates() {
        return this.states;
    }

    @Override
    public Class getStateType() {
        return this.initial.getClass();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy