public static function get($state)
    {

        // check if the requested container state is available and create a new instance
        if (in_array($state, EnumState::getStates())) {
            return new EnumState($state);
        }

        // throw a exception if the requested runlevel is not available
        throw new InvalidStateException(
            sprintf(
                'Requested state %s is not available (choose on of: %s)',
                $state,
                implode(',', EnumState::getStates())
            )
        );
    }
public static function get($state)
    {

        // check if the requested container state is available and create a new instance
        if (in_array($state, EnumState::getStates())) {
            return new EnumState($state);
        }

        // throw a exception if the requested runlevel is not available
        throw new InvalidStateException(
            sprintf(
                'Requested state %s is not available (choose on of: %s)',
                $state,
                implode(',', EnumState::getStates())
            )
        );
    }
public static function get ( $ state ) { // check if the requested container state is available and create a new instance if ( in_array ( $ state , EnumState :: getStates ( ) ) ) { return new EnumState ( $ state ) ; } // throw a exception if the requested runlevel is not available throw new InvalidStateException ( sprintf ( 'Requested state %s is not available (choose on of: %s)' , $ state , implode ( ',' , EnumState :: getStates ( ) ) ) ) ; }
Factory method to create a new state instance.

@param integer $state The state to create an instance for

@return \AppserverIo\Appserver\Core\Utilities\EnumState The state key instance
@throws \AppserverIo\Appserver\Core\Utilities\InvalidStateException
Is thrown if the state is not available
Factory method to create a new state instance .