public void setStatement(String key, String value) {
    if (value != null && !checkCSSStatement(key, value)) {
      throw new InvalidCSS("Invalid CSS statement.");
    }
    for (Pair<String, String> pair : statements) {
      if (pair.getFirst().equals(key)) {
        if (value != null) {
          pair.setSecond(value);
        } else {
          statements.remove(pair);
        }
        return;
      }
    }
    if (value != null) {
      statements.add(new Pair<>(key, value));
    }
  }
public void setStatement ( String key , String value ) { if ( value != null && ! checkCSSStatement ( key , value ) ) { throw new InvalidCSS ( "Invalid CSS statement." ) ; } for ( Pair < String , String > pair : statements ) { if ( pair . getFirst ( ) . equals ( key ) ) { if ( value != null ) { pair . setSecond ( value ) ; } else { statements . remove ( pair ) ; } return ; } } if ( value != null ) { statements . add ( new Pair < > ( key , value ) ) ; } }
Set a CSS statement.

@param key Statement key.
@param value Value or null (to unset)