public ConfigOption < T > withDeprecatedKeys ( String ... deprecatedKeys ) { final Stream < FallbackKey > newDeprecatedKeys = Arrays . stream ( deprecatedKeys ) . map ( FallbackKey :: createDeprecatedKey ) ; final Stream < FallbackKey > currentAlternativeKeys = Arrays . stream ( this . fallbackKeys ) ; // put deprecated keys last so that they are de-prioritized final FallbackKey [ ] mergedAlternativeKeys = Stream . concat ( currentAlternativeKeys , newDeprecatedKeys ) . toArray ( FallbackKey [ ] :: new ) ; return new ConfigOption <> ( key , description , defaultValue , mergedAlternativeKeys ) ; }
Creates a new config option using this option s key and default value and adding the given deprecated keys .