public <T> JsonValidationContext addState(T state, Class<? extends T> stateClass) throws IllegalArgumentException {

		// only accept one state of each class
		if (this.states.containsKey(state.getClass())) {
			throw new IllegalArgumentException("A state object is already registered for class " + state.getClass().getName());
		}

		this.states.put(state.getClass(), state);

		return this;
	}
public < T > JsonValidationContext addState ( T state , Class < ? extends T > stateClass ) throws IllegalArgumentException { if ( this . states . containsKey ( state . getClass ( ) ) ) { throw new IllegalArgumentException ( "A state object is already registered for class " + state . getClass ( ) . getName ( ) ) ; } this . states . put ( state . getClass ( ) , state ) ; return this ; }
Adds the specified state object to this validation context. It can be retrieved by passing
the identifying class to {@link #getState(java.lang.Class)}.

@param <T> the type of state
@param state the state object to register
@param stateClass the class identifying the state
@return this context
@throws IllegalArgumentException if a state is already registered for that class