public Long getLongOrNull(String key) throws IllegalStateException {
		Type type = stateMap.get(key);
		if (type == null) {
			return null;
		}
		switch (type) {
			case NULL:
				return null;
			case LONG:
				Object obj = get(key);
				if (obj instanceof Integer) {
					return (long) (Integer) obj;
				} else if (obj instanceof Long) {
					return (Long) obj;
				} else if (obj instanceof Byte) {
					return (long) (Byte) obj;
				} else if (obj instanceof Short) {
					return (long) (Short) obj;
				} else {
					throw new IllegalStateException("unexpected class. class="
							+ obj.getClass().getCanonicalName());
				}
			default:
				throw new IllegalStateException("unexpected token. token=" + type);
		}
	}
public Long getLongOrNull ( String key ) throws IllegalStateException { Type type = stateMap . get ( key ) ; if ( type == null ) { return null ; } switch ( type ) { case NULL : return null ; case LONG : Object obj = get ( key ) ; if ( obj instanceof Integer ) { return ( long ) ( Integer ) obj ; } else if ( obj instanceof Long ) { return ( Long ) obj ; } else if ( obj instanceof Byte ) { return ( long ) ( Byte ) obj ; } else if ( obj instanceof Short ) { return ( long ) ( Short ) obj ; } else { throw new IllegalStateException ( "unexpected class. class=" + obj . getClass ( ) . getCanonicalName ( ) ) ; } default : throw new IllegalStateException ( "unexpected token. token=" + type ) ; } }
Retrieves the corresponding value of the given key as integer.<br>
If it is neither {@code null} nor a {@link Long}, {@link IllegalStateException} will be thrown.
@param key
@return The value
@throws IllegalStateException The given index points neither {@code null} nor a {@link Long}.
@author vvakame