public String get ( String key ) throws EtcdClientException { Preconditions . checkNotNull ( key , "key can't be null" ) ; URI uri = buildUriWithKeyAndParams ( key , null ) ; HttpGet httpGet = new HttpGet ( uri ) ; EtcdResult result = syncExecute ( httpGet , new int [ ] { 200 , 404 } , 100 ) ; if ( result . isError ( ) ) { if ( result . errorCode == 100 ) { return null ; } } return result . node != null ? result . node . value : null ; }
Get the value of a key .