idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
149,900
public ItemRequest < Webhook > getById ( String webhook ) { String path = String . format ( "/webhooks/%s" , webhook ) ; return new ItemRequest < Webhook > ( this , Webhook . class , path , "GET" ) ; }
Returns the full record for the given webhook .
149,901
public ItemRequest < Webhook > deleteById ( String webhook ) { String path = String . format ( "/webhooks/%s" , webhook ) ; return new ItemRequest < Webhook > ( this , Webhook . class , path , "DELETE" ) ; }
This method permanently removes a webhook . Note that it may be possible to receive a request that was already in flight after deleting the webhook but no further requests will be issued .
149,902
public EventsRequest < Event > get ( String resource , String sync ) { return new EventsRequest < Event > ( this , Event . class , "/events" , "GET" ) . query ( "resource" , resource ) . query ( "sync" , sync ) ; }
Returns any events for the given resource ID since the last sync token
149,903
public CollectionRequest < ProjectMembership > findByProject ( String project ) { String path = String . format ( "/projects/%s/project_memberships" , project ) ; return new CollectionRequest < ProjectMembership > ( this , ProjectMembership . class , path , "GET" ) ; }
Returns the compact project membership records for the project .
149,904
public ItemRequest < ProjectMembership > findById ( String projectMembership ) { String path = String . format ( "/project_memberships/%s" , projectMembership ) ; return new ItemRequest < ProjectMembership > ( this , ProjectMembership . class , path , "GET" ) ; }
Returns the project membership record .
149,905
public CollectionRequest < Story > findByTask ( String task ) { String path = String . format ( "/tasks/%s/stories" , task ) ; return new CollectionRequest < Story > ( this , Story . class , path , "GET" ) ; }
Returns the compact records for all stories on the task .
149,906
public ItemRequest < Story > findById ( String story ) { String path = String . format ( "/stories/%s" , story ) ; return new ItemRequest < Story > ( this , Story . class , path , "GET" ) ; }
Returns the full record for a single story .
149,907
public ItemRequest < Story > update ( String story ) { String path = String . format ( "/stories/%s" , story ) ; return new ItemRequest < Story > ( this , Story . class , path , "PUT" ) ; }
Updates the story and returns the full record for the updated story . Only comment stories can have their text updated and only comment stories and attachment stories can be pinned . Only one of text and html_text can be specified .
149,908
public ItemRequest < Story > delete ( String story ) { String path = String . format ( "/stories/%s" , story ) ; return new ItemRequest < Story > ( this , Story . class , path , "DELETE" ) ; }
Deletes a story . A user can only delete stories they have created . Returns an empty data record .
149,909
public ItemRequest < Workspace > findById ( String workspace ) { String path = String . format ( "/workspaces/%s" , workspace ) ; return new ItemRequest < Workspace > ( this , Workspace . class , path , "GET" ) ; }
Returns the full workspace record for a single workspace .
149,910
public ItemRequest < Workspace > update ( String workspace ) { String path = String . format ( "/workspaces/%s" , workspace ) ; return new ItemRequest < Workspace > ( this , Workspace . class , path , "PUT" ) ; }
A specific existing workspace can be updated by making a PUT request on the URL for that workspace . Only the fields provided in the data block will be updated ; any unspecified fields will remain unchanged .
149,911
public ItemRequest < Workspace > addUser ( String workspace ) { String path = String . format ( "/workspaces/%s/addUser" , workspace ) ; return new ItemRequest < Workspace > ( this , Workspace . class , path , "POST" ) ; }
The user can be referenced by their globally unique user ID or their email address . Returns the full user record for the invited user .
149,912
public ItemRequest < Workspace > removeUser ( String workspace ) { String path = String . format ( "/workspaces/%s/removeUser" , workspace ) ; return new ItemRequest < Workspace > ( this , Workspace . class , path , "POST" ) ; }
The user making this call must be an admin in the workspace . Returns an empty data record .
149,913
public ItemRequest < Attachment > createOnTask ( String task , InputStream fileContent , String fileName , String fileType ) { MultipartContent . Part part = new MultipartContent . Part ( ) . setContent ( new InputStreamContent ( fileType , fileContent ) ) . setHeaders ( new HttpHeaders ( ) . set ( "Content-Disposition...
Upload a file and attach it to a task
149,914
public ItemRequest < OrganizationExport > findById ( String organizationExport ) { String path = String . format ( "/organization_exports/%s" , organizationExport ) ; return new ItemRequest < OrganizationExport > ( this , OrganizationExport . class , path , "GET" ) ; }
Returns details of a previously - requested Organization export .
149,915
public Request option ( String key , Object value ) { this . options . put ( key , value ) ; return this ; }
Sets a client option per - request
149,916
public Request header ( String key , String value ) { this . headers . put ( key , value ) ; return this ; }
Sets a header per - request
149,917
public ItemRequest < Attachment > findById ( String attachment ) { String path = String . format ( "/attachments/%s" , attachment ) ; return new ItemRequest < Attachment > ( this , Attachment . class , path , "GET" ) ; }
Returns the full record for a single attachment .
149,918
public CollectionRequest < Attachment > findByTask ( String task ) { String path = String . format ( "/tasks/%s/attachments" , task ) ; return new CollectionRequest < Attachment > ( this , Attachment . class , path , "GET" ) ; }
Returns the compact records for all attachments on the task .
149,919
public ItemRequest < Section > createInProject ( String project ) { String path = String . format ( "/projects/%s/sections" , project ) ; return new ItemRequest < Section > ( this , Section . class , path , "POST" ) ; }
Creates a new section in a project .
149,920
public CollectionRequest < Section > findByProject ( String project ) { String path = String . format ( "/projects/%s/sections" , project ) ; return new CollectionRequest < Section > ( this , Section . class , path , "GET" ) ; }
Returns the compact records for all sections in the specified project .
149,921
public ItemRequest < Section > findById ( String section ) { String path = String . format ( "/sections/%s" , section ) ; return new ItemRequest < Section > ( this , Section . class , path , "GET" ) ; }
Returns the complete record for a single section .
149,922
public ItemRequest < Section > delete ( String section ) { String path = String . format ( "/sections/%s" , section ) ; return new ItemRequest < Section > ( this , Section . class , path , "DELETE" ) ; }
A specific existing section can be deleted by making a DELETE request on the URL for that section .
149,923
public ItemRequest < Section > insertInProject ( String project ) { String path = String . format ( "/projects/%s/sections/insert" , project ) ; return new ItemRequest < Section > ( this , Section . class , path , "POST" ) ; }
Move sections relative to each other in a board view . One of before_section or after_section is required .
149,924
public ItemRequest < Team > findById ( String team ) { String path = String . format ( "/teams/%s" , team ) ; return new ItemRequest < Team > ( this , Team . class , path , "GET" ) ; }
Returns the full record for a single team .
149,925
public CollectionRequest < Team > findByOrganization ( String organization ) { String path = String . format ( "/organizations/%s/teams" , organization ) ; return new CollectionRequest < Team > ( this , Team . class , path , "GET" ) ; }
Returns the compact records for all teams in the organization visible to the authorized user .
149,926
public CollectionRequest < Team > findByUser ( String user ) { String path = String . format ( "/users/%s/teams" , user ) ; return new CollectionRequest < Team > ( this , Team . class , path , "GET" ) ; }
Returns the compact records for all teams to which user is assigned .
149,927
public CollectionRequest < Team > users ( String team ) { String path = String . format ( "/teams/%s/users" , team ) ; return new CollectionRequest < Team > ( this , Team . class , path , "GET" ) ; }
Returns the compact records for all users that are members of the team .
149,928
public ItemRequest < Team > addUser ( String team ) { String path = String . format ( "/teams/%s/addUser" , team ) ; return new ItemRequest < Team > ( this , Team . class , path , "POST" ) ; }
The user making this call must be a member of the team in order to add others . The user to add must exist in the same organization as the team in order to be added . The user to add can be referenced by their globally unique user ID or their email address . Returns the full user record for the added user .
149,929
public ItemRequest < Team > removeUser ( String team ) { String path = String . format ( "/teams/%s/removeUser" , team ) ; return new ItemRequest < Team > ( this , Team . class , path , "POST" ) ; }
The user to remove can be referenced by their globally unique user ID or their email address . Removes the user from the specified team . Returns an empty data record .
149,930
protected InternalHttpResponse sendInternalRequest ( HttpRequest request ) { InternalHttpResponder responder = new InternalHttpResponder ( ) ; httpResourceHandler . handle ( request , responder ) ; return responder . getResponse ( ) ; }
Send a request to another handler internal to the server getting back the response body and response code .
149,931
public SslHandler create ( ByteBufAllocator bufferAllocator ) { SSLEngine engine = sslContext . newEngine ( bufferAllocator ) ; engine . setNeedClientAuth ( needClientAuth ) ; engine . setUseClientMode ( false ) ; return new SslHandler ( engine ) ; }
Creates an SslHandler
149,932
private Set < HttpMethod > getHttpMethods ( Method method ) { Set < HttpMethod > httpMethods = new HashSet < > ( ) ; if ( method . isAnnotationPresent ( GET . class ) ) { httpMethods . add ( HttpMethod . GET ) ; } if ( method . isAnnotationPresent ( PUT . class ) ) { httpMethods . add ( HttpMethod . PUT ) ; } if ( meth...
Fetches the HttpMethod from annotations and returns String representation of HttpMethod . Return emptyString if not present .
149,933
public void handle ( HttpRequest request , HttpResponder responder ) { if ( urlRewriter != null ) { try { request . setUri ( URI . create ( request . uri ( ) ) . normalize ( ) . toString ( ) ) ; if ( ! urlRewriter . rewrite ( request , responder ) ) { return ; } } catch ( Throwable t ) { responder . sendString ( HttpRe...
Call the appropriate handler for handling the httprequest . 404 if path is not found . 405 if path is found but httpMethod does not match what s configured .
149,934
private PatternPathRouterWithGroups . RoutableDestination < HttpResourceModel > getMatchedDestination ( List < PatternPathRouterWithGroups . RoutableDestination < HttpResourceModel > > routableDestinations , HttpMethod targetHttpMethod , String requestUri ) { LOG . trace ( "Routable destinations for request {}: {}" , r...
Get HttpResourceModel which matches the HttpMethod of the request .
149,935
private long getWeightedMatchScore ( Iterable < String > requestUriParts , Iterable < String > destUriParts ) { long score = 0 ; for ( Iterator < String > rit = requestUriParts . iterator ( ) , dit = destUriParts . iterator ( ) ; rit . hasNext ( ) && dit . hasNext ( ) ; ) { String requestPart = rit . next ( ) ; String ...
Generate a weighted score based on position for matches of URI parts . The matches are weighted in descending order from left to right . Exact match is weighted higher than group match and group match is weighted higher than wildcard match .
149,936
private static Iterable < String > splitAndOmitEmpty ( final String str , final char splitChar ) { return new Iterable < String > ( ) { public Iterator < String > iterator ( ) { return new Iterator < String > ( ) { int startIdx = 0 ; String next = null ; public boolean hasNext ( ) { while ( next == null && startIdx < s...
Helper method to split a string by a given character with empty parts omitted .
149,937
private static Converter < List < String > , Object > createPrimitiveTypeConverter ( final Class < ? > resultClass ) { Object defaultValue = defaultValue ( resultClass ) ; if ( defaultValue == null ) { return null ; } return new BasicConverter ( defaultValue ) { protected Object convert ( String value ) throws Exceptio...
Creates a converter function that converts value into primitive type .
149,938
private static Converter < List < String > , Object > createStringConstructorConverter ( Class < ? > resultClass ) { try { final Constructor < ? > constructor = resultClass . getConstructor ( String . class ) ; return new BasicConverter ( defaultValue ( resultClass ) ) { protected Object convert ( String value ) throws...
Creates a converter function that converts value using a constructor that accepts a single String argument .
149,939
private static Object valueOf ( String value , Class < ? > cls ) { if ( cls == Boolean . TYPE ) { return Boolean . valueOf ( value ) ; } if ( cls == Character . TYPE ) { return value . length ( ) >= 1 ? value . charAt ( 0 ) : defaultValue ( char . class ) ; } if ( cls == Byte . TYPE ) { return Byte . valueOf ( value ) ...
Returns the value of the primitive type from the given string value .
149,940
private static Class < ? > getRawClass ( Type type ) { if ( type instanceof Class ) { return ( Class < ? > ) type ; } if ( type instanceof ParameterizedType ) { return getRawClass ( ( ( ParameterizedType ) type ) . getRawType ( ) ) ; } if ( type instanceof TypeVariable ) { return getRawClass ( ( ( TypeVariable ) type )...
Returns the raw class of the given type .
149,941
void invoke ( HttpRequest request ) throws Exception { bodyConsumer = null ; Object invokeResult ; try { args [ 0 ] = this . request = request ; invokeResult = method . invoke ( handler , args ) ; } catch ( InvocationTargetException e ) { exceptionHandler . handle ( e . getTargetException ( ) , request , responder ) ; ...
Calls the httpHandler method .
149,942
void sendError ( HttpResponseStatus status , Throwable ex ) { String msg ; if ( ex instanceof InvocationTargetException ) { msg = String . format ( "Exception Encountered while processing request : %s" , ex . getCause ( ) . getMessage ( ) ) ; } else { msg = String . format ( "Exception Encountered while processing requ...
Sends the error to responder .
149,943
public void add ( final String source , final T destination ) { String path = source . replaceAll ( "/+" , "/" ) ; path = ( path . endsWith ( "/" ) && path . length ( ) > 1 ) ? path . substring ( 0 , path . length ( ) - 1 ) : path ; String [ ] parts = path . split ( "/" , maxPathParts + 2 ) ; if ( parts . length - 1 > ...
Add a source and destination .
149,944
public List < RoutableDestination < T > > getDestinations ( String path ) { String cleanPath = ( path . endsWith ( "/" ) && path . length ( ) > 1 ) ? path . substring ( 0 , path . length ( ) - 1 ) : path ; List < RoutableDestination < T > > result = new ArrayList < > ( ) ; for ( ImmutablePair < Pattern , RouteDestinati...
Get a list of destinations and the values matching templated parameter for the given path . Returns an empty list when there are no destinations that are matched .
149,945
public synchronized void start ( ) throws Exception { if ( state == State . RUNNING ) { LOG . debug ( "Ignore start() call on HTTP service {} since it has already been started." , serviceName ) ; return ; } if ( state != State . NOT_STARTED ) { if ( state == State . STOPPED ) { throw new IllegalStateException ( "Cannot...
Starts the HTTP service .
149,946
public synchronized void stop ( long quietPeriod , long timeout , TimeUnit unit ) throws Exception { if ( state == State . STOPPED ) { LOG . debug ( "Ignore stop() call on HTTP service {} since it has already been stopped." , serviceName ) ; return ; } LOG . info ( "Stopping HTTP Service {}" , serviceName ) ; try { try...
Stops the HTTP service gracefully and release all resources .
149,947
private ServerBootstrap createBootstrap ( final ChannelGroup channelGroup ) throws Exception { EventLoopGroup bossGroup = new NioEventLoopGroup ( bossThreadPoolSize , createDaemonThreadFactory ( serviceName + "-boss-thread-%d" ) ) ; EventLoopGroup workerGroup = new NioEventLoopGroup ( workerThreadPoolSize , createDaemo...
Creates the server bootstrap .
149,948
public void channelRead ( ChannelHandlerContext ctx , Object msg ) throws Exception { try { if ( exceptionRaised . get ( ) ) { return ; } if ( ! ( msg instanceof HttpRequest ) ) { if ( methodInfo != null ) { ReferenceCountUtil . retain ( msg ) ; ctx . fireChannelRead ( msg ) ; } return ; } HttpRequest request = ( HttpR...
If the HttpRequest is valid and handled it will be sent upstream if it cannot be invoked the response will be written back immediately .
149,949
@ SuppressWarnings ( "unchecked" ) public HttpMethodInfo handle ( HttpRequest request , HttpResponder responder , Map < String , String > groupValues ) throws Exception { try { if ( httpMethods . contains ( request . method ( ) ) ) { Object [ ] args = new Object [ paramsInfo . size ( ) ] ; int idx = 0 ; for ( Map < Cla...
Handle http Request .
149,950
private List < Map < Class < ? extends Annotation > , ParameterInfo < ? > > > createParametersInfos ( Method method ) { if ( method . getParameterTypes ( ) . length <= 2 ) { return Collections . emptyList ( ) ; } List < Map < Class < ? extends Annotation > , ParameterInfo < ? > > > result = new ArrayList < > ( ) ; Type...
Gathers all parameters annotations for the given method starting from the third parameter .
149,951
public static < T > ServiceFuture < T > fromResponse ( final Observable < ServiceResponse < T > > observable ) { final ServiceFuture < T > serviceFuture = new ServiceFuture < > ( ) ; serviceFuture . subscription = observable . last ( ) . subscribe ( new Action1 < ServiceResponse < T > > ( ) { public void call ( Service...
Creates a ServiceCall from an observable object .
149,952
public static < T > ServiceFuture < T > fromResponse ( final Observable < ServiceResponse < T > > observable , final ServiceCallback < T > callback ) { final ServiceFuture < T > serviceFuture = new ServiceFuture < > ( ) ; serviceFuture . subscription = observable . last ( ) . subscribe ( new Action1 < ServiceResponse <...
Creates a ServiceCall from an observable object and a callback .
149,953
public static ServiceFuture < Void > fromBody ( final Completable completable , final ServiceCallback < Void > callback ) { final ServiceFuture < Void > serviceFuture = new ServiceFuture < > ( ) ; completable . subscribe ( new Action0 ( ) { Void value = null ; public void call ( ) { if ( callback != null ) { callback ....
Creates a ServiceFuture from an Completable object and a callback .
149,954
protected void cacheCollection ( ) { this . clear ( ) ; for ( FluentModelTImpl childResource : this . listChildResources ( ) ) { this . childCollection . put ( childResource . childResourceKey ( ) , childResource ) ; } }
Initializes the external child resource collection .
149,955
public void addDependencyGraph ( DAGraph < DataT , NodeT > dependencyGraph ) { this . rootNode . addDependency ( dependencyGraph . rootNode . key ( ) ) ; Map < String , NodeT > sourceNodeTable = dependencyGraph . nodeTable ; Map < String , NodeT > targetNodeTable = this . nodeTable ; this . merge ( sourceNodeTable , ta...
Mark root of this DAG depends on given DAG s root .
149,956
public void prepareForEnumeration ( ) { if ( isPreparer ( ) ) { for ( NodeT node : nodeTable . values ( ) ) { node . initialize ( ) ; if ( ! this . isRootNode ( node ) ) { node . setPreparer ( false ) ; } } initializeDependentKeys ( ) ; initializeQueue ( ) ; } }
Prepares this DAG for node enumeration using getNext method each call to getNext returns next node in the DAG with no dependencies .
149,957
public NodeT getNext ( ) { String nextItemKey = queue . poll ( ) ; if ( nextItemKey == null ) { return null ; } return nodeTable . get ( nextItemKey ) ; }
Gets next node in the DAG which has no dependency or all of it s dependencies are resolved and ready to be consumed .
149,958
public void reportCompletion ( NodeT completed ) { completed . setPreparer ( true ) ; String dependency = completed . key ( ) ; for ( String dependentKey : nodeTable . get ( dependency ) . dependentKeys ( ) ) { DAGNode < DataT , NodeT > dependent = nodeTable . get ( dependentKey ) ; dependent . lock ( ) . lock ( ) ; tr...
Reports that a node is resolved hence other nodes depends on it can consume it .
149,959
public void reportError ( NodeT faulted , Throwable throwable ) { faulted . setPreparer ( true ) ; String dependency = faulted . key ( ) ; for ( String dependentKey : nodeTable . get ( dependency ) . dependentKeys ( ) ) { DAGNode < DataT , NodeT > dependent = nodeTable . get ( dependentKey ) ; dependent . lock ( ) . lo...
Reports that a node is faulted .
149,960
private void initializeQueue ( ) { this . queue . clear ( ) ; for ( Map . Entry < String , NodeT > entry : nodeTable . entrySet ( ) ) { if ( ! entry . getValue ( ) . hasDependencies ( ) ) { this . queue . add ( entry . getKey ( ) ) ; } } if ( queue . isEmpty ( ) ) { throw new IllegalStateException ( "Detected circular ...
Initializes the queue that tracks the next set of nodes with no dependencies or whose dependencies are resolved .
149,961
private void merge ( Map < String , NodeT > source , Map < String , NodeT > target ) { for ( Map . Entry < String , NodeT > entry : source . entrySet ( ) ) { String key = entry . getKey ( ) ; if ( ! target . containsKey ( key ) ) { target . put ( key , entry . getValue ( ) ) ; } } }
Copies entries in the source map to target map .
149,962
private void bubbleUpNodeTable ( DAGraph < DataT , NodeT > from , LinkedList < String > path ) { if ( path . contains ( from . rootNode . key ( ) ) ) { path . push ( from . rootNode . key ( ) ) ; throw new IllegalStateException ( "Detected circular dependency: " + StringUtils . join ( path , " -> " ) ) ; } path . push ...
Propagates node table of given DAG to all of it ancestors .
149,963
public static IndexableTaskItem create ( final FunctionalTaskItem taskItem ) { return new IndexableTaskItem ( ) { protected Observable < Indexable > invokeTaskAsync ( TaskGroup . InvocationContext context ) { FunctionalTaskItem . Context fContext = new FunctionalTaskItem . Context ( this ) ; fContext . setInnerContext ...
Creates an IndexableTaskItem from provided FunctionalTaskItem .
149,964
@ SuppressWarnings ( "unchecked" ) protected String addeDependency ( Appliable < ? extends Indexable > appliable ) { TaskGroup . HasTaskGroup dependency = ( TaskGroup . HasTaskGroup ) appliable ; return this . addDependency ( dependency ) ; }
Add an appliable dependency for this task item .
149,965
public String addPostRunDependent ( FunctionalTaskItem dependent ) { Objects . requireNonNull ( dependent ) ; return this . taskGroup ( ) . addPostRunDependent ( dependent ) ; }
Add a post - run dependent task item for this task item .
149,966
@ SuppressWarnings ( "unchecked" ) protected String addPostRunDependent ( Creatable < ? extends Indexable > creatable ) { TaskGroup . HasTaskGroup dependency = ( TaskGroup . HasTaskGroup ) creatable ; return this . addPostRunDependent ( dependency ) ; }
Add a creatable post - run dependent for this task item .
149,967
@ SuppressWarnings ( "unchecked" ) protected String addPostRunDependent ( Appliable < ? extends Indexable > appliable ) { TaskGroup . HasTaskGroup dependency = ( TaskGroup . HasTaskGroup ) appliable ; return this . addPostRunDependent ( dependency ) ; }
Add an appliable post - run dependent for this task item .
149,968
@ SuppressWarnings ( "unchecked" ) protected < T extends Indexable > T taskResult ( String key ) { Indexable result = this . taskGroup . taskResult ( key ) ; if ( result == null ) { return null ; } else { T castedResult = ( T ) result ; return castedResult ; } }
Get result of one of the task that belongs to this task s task group .
149,969
public static Region create ( String name , String label ) { Region region = VALUES_BY_NAME . get ( name . toLowerCase ( ) ) ; if ( region != null ) { return region ; } else { return new Region ( name , label ) ; } }
Creates a region from a name and a label .
149,970
public static Region fromName ( String name ) { if ( name == null ) { return null ; } Region region = VALUES_BY_NAME . get ( name . toLowerCase ( ) . replace ( " " , "" ) ) ; if ( region != null ) { return region ; } else { return Region . create ( name . toLowerCase ( ) . replace ( " " , "" ) , name ) ; } }
Parses a name into a Region object and creates a new Region instance if not found among the existing ones .
149,971
protected FluentModelTImpl prepareForFutureCommitOrPostRun ( FluentModelTImpl childResource ) { if ( this . isPostRunMode ) { if ( ! childResource . taskGroup ( ) . dependsOn ( this . parentTaskGroup ) ) { this . parentTaskGroup . addPostRunDependentTaskGroup ( childResource . taskGroup ( ) ) ; } return childResource ;...
Mark the given child resource as the post run dependent of the parent of this collection .
149,972
protected FluentModelTImpl find ( String key ) { for ( Map . Entry < String , FluentModelTImpl > entry : this . childCollection . entrySet ( ) ) { if ( entry . getKey ( ) . equalsIgnoreCase ( key ) ) { return entry . getValue ( ) ; } } return null ; }
Finds a child resource with the given key .
149,973
public static < E > ServiceFuture < List < E > > fromPageResponse ( Observable < ServiceResponse < Page < E > > > first , final Func1 < String , Observable < ServiceResponse < Page < E > > > > next , final ListOperationCallback < E > callback ) { final AzureServiceFuture < List < E > > serviceCall = new AzureServiceFut...
Creates a ServiceCall from a paging operation .
149,974
public static < E , V > ServiceFuture < List < E > > fromHeaderPageResponse ( Observable < ServiceResponseWithHeaders < Page < E > , V > > first , final Func1 < String , Observable < ServiceResponseWithHeaders < Page < E > , V > > > next , final ListOperationCallback < E > callback ) { final AzureServiceFuture < List <...
Creates a ServiceCall from a paging operation that returns a header response .
149,975
private static JsonNode findNestedNode ( JsonNode jsonNode , String composedKey ) { String [ ] jsonNodeKeys = splitKeyByFlatteningDots ( composedKey ) ; for ( String jsonNodeKey : jsonNodeKeys ) { jsonNode = jsonNode . get ( unescapeEscapedDots ( jsonNodeKey ) ) ; if ( jsonNode == null ) { return null ; } } return json...
Given a json node find a nested node using given composed key .
149,976
private static JsonParser newJsonParserForNode ( JsonNode jsonNode ) throws IOException { JsonParser parser = new JsonFactory ( ) . createParser ( jsonNode . toString ( ) ) ; parser . nextToken ( ) ; return parser ; }
Create a JsonParser for a given json node .
149,977
protected String addDependency ( FunctionalTaskItem dependency ) { Objects . requireNonNull ( dependency ) ; return this . taskGroup ( ) . addDependency ( dependency ) ; }
Add a dependency task item for this model .
149,978
protected String addDependency ( TaskGroup . HasTaskGroup dependency ) { Objects . requireNonNull ( dependency ) ; this . taskGroup ( ) . addDependencyTaskGroup ( dependency . taskGroup ( ) ) ; return dependency . taskGroup ( ) . key ( ) ; }
Add a dependency task group for this model .
149,979
@ SuppressWarnings ( "unchecked" ) protected void addPostRunDependent ( Executable < ? extends Indexable > executable ) { TaskGroup . HasTaskGroup dependency = ( TaskGroup . HasTaskGroup ) executable ; this . addPostRunDependent ( dependency ) ; }
Add an executable post - run dependent for this model .
149,980
public void addNode ( NodeT node ) { node . setOwner ( this ) ; nodeTable . put ( node . key ( ) , node ) ; }
Adds a node to this graph .
149,981
protected String findPath ( String start , String end ) { if ( start . equals ( end ) ) { return start ; } else { return findPath ( start , parent . get ( end ) ) + " -> " + end ; } }
Find the path .
149,982
public Map < String , ImplT > convertToUnmodifiableMap ( List < InnerT > innerList ) { Map < String , ImplT > result = new HashMap < > ( ) ; for ( InnerT inner : innerList ) { result . put ( name ( inner ) , impl ( inner ) ) ; } return Collections . unmodifiableMap ( result ) ; }
Converts the passed list of inners to unmodifiable map of impls .
149,983
public static String createOdataFilterForTags ( String tagName , String tagValue ) { if ( tagName == null ) { return null ; } else if ( tagValue == null ) { return String . format ( "tagname eq '%s'" , tagName ) ; } else { return String . format ( "tagname eq '%s' and tagvalue eq '%s'" , tagName , tagValue ) ; } }
Creates an Odata filter string that can be used for filtering list results by tags .
149,984
public static Observable < byte [ ] > downloadFileAsync ( String url , Retrofit retrofit ) { FileService service = retrofit . create ( FileService . class ) ; Observable < ResponseBody > response = service . download ( url ) ; return response . map ( new Func1 < ResponseBody , byte [ ] > ( ) { public byte [ ] call ( Re...
Download a file asynchronously .
149,985
public static < OutT , InT > PagedList < OutT > toPagedList ( List < InT > list , final Func1 < InT , OutT > mapper ) { PageImpl < InT > page = new PageImpl < > ( ) ; page . setItems ( list ) ; page . setNextPageLink ( null ) ; PagedList < InT > pagedList = new PagedList < InT > ( page ) { public Page < InT > nextPage ...
Converts the given list of a type to paged list of a different type .
149,986
public static void addToListIfNotExists ( List < String > list , String value ) { boolean found = false ; for ( String item : list ) { if ( item . equalsIgnoreCase ( value ) ) { found = true ; break ; } } if ( ! found ) { list . add ( value ) ; } }
Adds a value to the list if does not already exists .
149,987
public static void removeFromList ( List < String > list , String value ) { int foundIndex = - 1 ; int i = 0 ; for ( String id : list ) { if ( id . equalsIgnoreCase ( value ) ) { foundIndex = i ; break ; } i ++ ; } if ( foundIndex != - 1 ) { list . remove ( foundIndex ) ; } }
Removes a value from the list .
149,988
public PagedList < V > convert ( final PagedList < U > uList ) { if ( uList == null || uList . isEmpty ( ) ) { return new PagedList < V > ( ) { public Page < V > nextPage ( String s ) throws RestException , IOException { return null ; } } ; } Page < U > uPage = uList . currentPage ( ) ; final PageImpl < V > vPage = new...
Converts the paged list .
149,989
public CustomHeadersInterceptor replaceHeader ( String name , String value ) { this . headers . put ( name , new ArrayList < String > ( ) ) ; this . headers . get ( name ) . add ( value ) ; return this ; }
Add a single header key - value pair . If one with the name already exists it gets replaced .
149,990
public CustomHeadersInterceptor addHeader ( String name , String value ) { if ( ! this . headers . containsKey ( name ) ) { this . headers . put ( name , new ArrayList < String > ( ) ) ; } this . headers . get ( name ) . add ( value ) ; return this ; }
Add a single header key - value pair . If one with the name already exists both stay in the header map .
149,991
public CustomHeadersInterceptor addHeaderMap ( Map < String , String > headers ) { for ( Map . Entry < String , String > header : headers . entrySet ( ) ) { this . headers . put ( header . getKey ( ) , Collections . singletonList ( header . getValue ( ) ) ) ; } return this ; }
Add all headers in a header map .
149,992
public CustomHeadersInterceptor addHeaderMultimap ( Map < String , List < String > > headers ) { this . headers . putAll ( headers ) ; return this ; }
Add all headers in a header multimap .
149,993
public static < T > Observable < T > map ( Observable < ? > fromObservable , final T toValue ) { if ( fromObservable != null ) { return fromObservable . subscribeOn ( Schedulers . io ( ) ) . map ( new RXMapper < T > ( toValue ) ) ; } else { return Observable . empty ( ) ; } }
Shortcut for mapping the output of an arbitrary observable to one returning an instance of a specific type using the IO scheduler .
149,994
public static Observable < Void > mapToVoid ( Observable < ? > fromObservable ) { if ( fromObservable != null ) { return fromObservable . subscribeOn ( Schedulers . io ( ) ) . map ( new RXMapper < Void > ( ) ) ; } else { return Observable . empty ( ) ; } }
Shortcut for mapping an arbitrary observable to void using the IO scheduler .
149,995
@ SuppressWarnings ( "unchecked" ) public final FluentModelImplT withTag ( String key , String value ) { if ( this . inner ( ) . getTags ( ) == null ) { this . inner ( ) . withTags ( new HashMap < String , String > ( ) ) ; } this . inner ( ) . getTags ( ) . put ( key , value ) ; return ( FluentModelImplT ) this ; }
Adds a tag to the resource .
149,996
@ SuppressWarnings ( "unchecked" ) public final FluentModelImplT withoutTag ( String key ) { if ( this . inner ( ) . getTags ( ) != null ) { this . inner ( ) . getTags ( ) . remove ( key ) ; } return ( FluentModelImplT ) this ; }
Removes a tag from the resource .
149,997
public void load ( List < E > result ) { ++ pageCount ; if ( this . result == null || this . result . isEmpty ( ) ) { this . result = result ; } else { this . result . addAll ( result ) ; } }
This method is called by the client to load the most recent list of resources . This method should only be called by the service client .
149,998
public < T > Observable < T > delayedEmitAsync ( T event , int milliseconds ) { return Observable . just ( event ) . delay ( milliseconds , TimeUnit . MILLISECONDS , Schedulers . immediate ( ) ) ; }
Creates an observable that emits the given item after the specified time in milliseconds .
149,999
public static String [ ] randomResourceNames ( String prefix , int maxLen , int count ) { String [ ] names = new String [ count ] ; ResourceNamer resourceNamer = SdkContext . getResourceNamerFactory ( ) . createResourceNamer ( "" ) ; for ( int i = 0 ; i < count ; i ++ ) { names [ i ] = resourceNamer . randomName ( pref...
Generates the specified number of random resource names with the same prefix .