idx int64 0 41.2k | question stringlengths 83 4.15k | target stringlengths 5 715 |
|---|---|---|
26,000 | public LogStreamResponse getLogs ( Log . LogRequestBuilder logRequest ) { return connection . execute ( new Log ( logRequest ) , apiKey ) ; } | Get logs for an app by specifying additional parameters . |
26,001 | public boolean isMaintenanceModeEnabled ( String appName ) { App app = connection . execute ( new AppInfo ( appName ) , apiKey ) ; return app . isMaintenance ( ) ; } | Checks if maintenance mode is enabled for the given app |
26,002 | public void setMaintenanceMode ( String appName , boolean enable ) { connection . execute ( new AppUpdate ( appName , enable ) , apiKey ) ; } | Sets maintenance mode for the given app |
26,003 | public Build createBuild ( String appName , Build build ) { return connection . execute ( new BuildCreate ( appName , build ) , apiKey ) ; } | Creates a build |
26,004 | public Build getBuildInfo ( String appName , String buildId ) { return connection . execute ( new BuildInfo ( appName , buildId ) , apiKey ) ; } | Gets the info for a running build |
26,005 | public Range < Dyno > listDynos ( String appName ) { return connection . execute ( new DynoList ( appName ) , apiKey ) ; } | List app dynos for an app |
26,006 | public void restartDyno ( String appName , String dynoId ) { connection . execute ( new DynoRestart ( appName , dynoId ) , apiKey ) ; } | Restarts a single dyno |
26,007 | public Formation scale ( String appName , String processType , int quantity ) { return connection . execute ( new FormationUpdate ( appName , processType , quantity ) , apiKey ) ; } | Scales a process type |
26,008 | public List < Formation > listFormation ( String appName ) { return connection . execute ( new FormationList ( appName ) , apiKey ) ; } | Lists the formation info for an app |
26,009 | public List < BuildpackInstallation > listBuildpackInstallations ( String appName ) { return connection . execute ( new BuildpackInstallationList ( appName ) , apiKey ) ; } | Lists the buildpacks installed on an app |
26,010 | public void updateBuildpackInstallations ( String appName , List < String > buildpacks ) { connection . execute ( new BuildpackInstallationUpdate ( appName , buildpacks ) , apiKey ) ; } | Update the list of buildpacks installed on an app |
26,011 | static Artifact resolveConstrained ( MavenProject project , String gav , Pattern versionRegex , ArtifactResolver resolver ) throws VersionRangeResolutionException , ArtifactResolutionException { boolean latest = gav . endsWith ( ":LATEST" ) ; if ( latest || gav . endsWith ( ":RELEASE" ) ) { Artifact a = new DefaultArti... | Resolves the gav using the resolver . If the gav corresponds to the project artifact and is an unresolved version for a RELEASE or LATEST the gav is resolved such it a release not newer than the project version is found that optionally corresponds to the provided version regex if provided . |
26,012 | public static < X > ServiceTypeLoader < X > load ( Class < X > serviceType ) { return load ( serviceType , Thread . currentThread ( ) . getContextClassLoader ( ) ) ; } | Locates the services in the context classloader of the current thread . |
26,013 | public static String stringifyJavascriptObject ( Object object ) { StringBuilder bld = new StringBuilder ( ) ; stringify ( object , bld ) ; return bld . toString ( ) ; } | Converts the provided javascript object to JSON string . |
26,014 | @ SuppressWarnings ( "unchecked" ) protected < T extends JavaElement > ActiveElements < T > popIfActive ( ) { return ( ActiveElements < T > ) ( ! activations . isEmpty ( ) && activations . peek ( ) . depth == depth ? activations . pop ( ) : null ) ; } | Pops the top of the stack of active elements if the current position in the call stack corresponds to the one that pushed the active elements . |
26,015 | public static Builder builder ( Revapi revapi ) { List < String > knownExtensionIds = new ArrayList < > ( ) ; addExtensionIds ( revapi . getPipelineConfiguration ( ) . getApiAnalyzerTypes ( ) , knownExtensionIds ) ; addExtensionIds ( revapi . getPipelineConfiguration ( ) . getTransformTypes ( ) , knownExtensionIds ) ; ... | Returns a new analysis context builder that extracts the information about the available extensions from the provided Revapi instance . |
26,016 | public AnalysisContext copyWithConfiguration ( ModelNode configuration ) { return new AnalysisContext ( this . locale , configuration , this . oldApi , this . newApi , this . data ) ; } | This is generally only useful for extensions that delegate some of their functionality to other internal extensions of their own that they need to configure . |
26,017 | public static PipelineConfiguration . Builder parse ( ModelNode json ) { ModelNode analyzerIncludeNode = json . get ( "analyzers" ) . get ( "include" ) ; ModelNode analyzerExcludeNode = json . get ( "analyzers" ) . get ( "exclude" ) ; ModelNode filterIncludeNode = json . get ( "filters" ) . get ( "include" ) ; ModelNod... | Parses the configuration node and provides a pipeline configuration without any extensions marked for loading . The configuration node is supposed to conform to the pipeline configuration JSON schema . |
26,018 | private static void firstDotConstellation ( int [ ] dollarPositions , int [ ] dotPositions , int nestingLevel ) { int i = 0 ; int unassigned = dotPositions . length - nestingLevel ; for ( ; i < unassigned ; ++ i ) { dotPositions [ i ] = - 1 ; } for ( ; i < dotPositions . length ; ++ i ) { dotPositions [ i ] = dollarPos... | This will set the last nestingLevel elements in the dotPositions to the values present in the dollarPositions . The rest will be set to - 1 . |
26,019 | public static AnalysisResult fakeSuccess ( ) { return new AnalysisResult ( null , new Extensions ( Collections . emptyMap ( ) , Collections . emptyMap ( ) , Collections . emptyMap ( ) , Collections . emptyMap ( ) ) ) ; } | A factory method for users that need to report success without actually running any analysis . The returned result will be successful but will not contain the actual configurations of extensions . |
26,020 | static PlexusConfiguration convert ( ModelNode configuration , ModelNode jsonSchema , String extensionId , String id ) { ConversionContext ctx = new ConversionContext ( ) ; ctx . currentSchema = jsonSchema ; ctx . rootSchema = jsonSchema ; ctx . pushTag ( extensionId ) ; ctx . id = id ; return convert ( configuration ,... | visibility increased for testing |
26,021 | @ SuppressWarnings ( "unchecked" ) public < T extends Annotation > T getAnnotation ( Class < T > annotationType ) { for ( Annotation annotation : this . annotations ) { if ( annotation . annotationType ( ) . equals ( annotationType ) ) { return ( T ) annotation ; } } for ( Annotation metaAnn : this . annotations ) { T ... | Obtain the annotation associated with this type descriptor of the specified type . |
26,022 | public static String encodeScheme ( String scheme , String encoding ) throws UnsupportedEncodingException { return HierarchicalUriComponents . encodeUriComponent ( scheme , encoding , HierarchicalUriComponents . Type . SCHEME ) ; } | Encodes the given URI scheme with the given encoding . |
26,023 | public static String encodeAuthority ( String authority , String encoding ) throws UnsupportedEncodingException { return HierarchicalUriComponents . encodeUriComponent ( authority , encoding , HierarchicalUriComponents . Type . AUTHORITY ) ; } | Encodes the given URI authority with the given encoding . |
26,024 | public static String encodeUserInfo ( String userInfo , String encoding ) throws UnsupportedEncodingException { return HierarchicalUriComponents . encodeUriComponent ( userInfo , encoding , HierarchicalUriComponents . Type . USER_INFO ) ; } | Encodes the given URI user info with the given encoding . |
26,025 | public static String encodeHost ( String host , String encoding ) throws UnsupportedEncodingException { return HierarchicalUriComponents . encodeUriComponent ( host , encoding , HierarchicalUriComponents . Type . HOST_IPV4 ) ; } | Encodes the given URI host with the given encoding . |
26,026 | public static String encodePort ( String port , String encoding ) throws UnsupportedEncodingException { return HierarchicalUriComponents . encodeUriComponent ( port , encoding , HierarchicalUriComponents . Type . PORT ) ; } | Encodes the given URI port with the given encoding . |
26,027 | public static String encodePath ( String path , String encoding ) throws UnsupportedEncodingException { return HierarchicalUriComponents . encodeUriComponent ( path , encoding , HierarchicalUriComponents . Type . PATH ) ; } | Encodes the given URI path with the given encoding . |
26,028 | public static String encodePathSegment ( String segment , String encoding ) throws UnsupportedEncodingException { return HierarchicalUriComponents . encodeUriComponent ( segment , encoding , HierarchicalUriComponents . Type . PATH_SEGMENT ) ; } | Encodes the given URI path segment with the given encoding . |
26,029 | public static String encodeQuery ( String query , String encoding ) throws UnsupportedEncodingException { return HierarchicalUriComponents . encodeUriComponent ( query , encoding , HierarchicalUriComponents . Type . QUERY ) ; } | Encodes the given URI query with the given encoding . |
26,030 | public static String encodeQueryParam ( String queryParam , String encoding ) throws UnsupportedEncodingException { return HierarchicalUriComponents . encodeUriComponent ( queryParam , encoding , HierarchicalUriComponents . Type . QUERY_PARAM ) ; } | Encodes the given URI query parameter with the given encoding . |
26,031 | public static String encodeFragment ( String fragment , String encoding ) throws UnsupportedEncodingException { return HierarchicalUriComponents . encodeUriComponent ( fragment , encoding , HierarchicalUriComponents . Type . FRAGMENT ) ; } | Encodes the given URI fragment with the given encoding . |
26,032 | public void setReadTimeout ( int readTimeout ) { this . client = this . client . newBuilder ( ) . readTimeout ( readTimeout , TimeUnit . MILLISECONDS ) . build ( ) ; } | Sets the underlying read timeout in milliseconds . A value of 0 specifies an infinite timeout . |
26,033 | public void setWriteTimeout ( int writeTimeout ) { this . client = this . client . newBuilder ( ) . writeTimeout ( writeTimeout , TimeUnit . MILLISECONDS ) . build ( ) ; } | Sets the underlying write timeout in milliseconds . A value of 0 specifies an infinite timeout . |
26,034 | public void setConnectTimeout ( int connectTimeout ) { this . client = this . client . newBuilder ( ) . connectTimeout ( connectTimeout , TimeUnit . MILLISECONDS ) . build ( ) ; } | Sets the underlying connect timeout in milliseconds . A value of 0 specifies an infinite timeout . |
26,035 | public void addComparator ( Comparator < T > comparator , boolean ascending ) { this . comparators . add ( new InvertibleComparator < T > ( comparator , ascending ) ) ; } | Add a Comparator to the end of the chain using the provided sort order . |
26,036 | public static void copy ( String in , Writer out ) throws IOException { Assert . notNull ( in , "No input String specified" ) ; Assert . notNull ( out , "No Writer specified" ) ; try { out . write ( in ) ; } finally { try { out . close ( ) ; } catch ( IOException ex ) { } } } | Copy the contents of the given String to the given output Writer . Closes the writer when done . |
26,037 | public boolean matches ( String uri ) { if ( uri == null ) { return false ; } Matcher matcher = this . matchPattern . matcher ( uri ) ; return matcher . matches ( ) ; } | Indicate whether the given URI matches this template . |
26,038 | public boolean exists ( ) { try { return getFile ( ) . exists ( ) ; } catch ( IOException ex ) { try { InputStream is = getInputStream ( ) ; is . close ( ) ; return true ; } catch ( Throwable isEx ) { return false ; } } } | This implementation checks whether a File can be opened falling back to whether an InputStream can be opened . This will cover both directories and content resources . |
26,039 | static String expandUriComponent ( String source , UriTemplateVariables uriVariables ) { if ( source == null ) { return null ; } if ( source . indexOf ( '{' ) == - 1 ) { return source ; } Matcher matcher = NAMES_PATTERN . matcher ( source ) ; StringBuffer sb = new StringBuffer ( ) ; while ( matcher . find ( ) ) { Strin... | static expansion helpers |
26,040 | public static boolean isAssignable ( Type lhsType , Type rhsType ) { Assert . notNull ( lhsType , "Left-hand side type must not be null" ) ; Assert . notNull ( rhsType , "Right-hand side type must not be null" ) ; if ( lhsType . equals ( rhsType ) || lhsType . equals ( Object . class ) ) { return true ; } if ( lhsType ... | Check if the right - hand side type may be assigned to the left - hand side type following the Java generics rules . |
26,041 | static String encodeUriComponent ( String source , String encoding , Type type ) throws UnsupportedEncodingException { if ( source == null ) { return null ; } Assert . hasLength ( encoding , "Encoding must not be empty" ) ; byte [ ] bytes = encodeBytes ( source . getBytes ( encoding ) , type ) ; return new String ( byt... | Encodes the given source into an encoded String using the rules specified by the given component and with the given options . |
26,042 | protected HttpUriRequest createHttpRequest ( HttpMethod httpMethod , URI uri ) { switch ( httpMethod ) { case GET : return new HttpGet ( uri ) ; case DELETE : return new HttpDelete ( uri ) ; case HEAD : return new HttpHead ( uri ) ; case OPTIONS : return new HttpOptions ( uri ) ; case POST : return new HttpPost ( uri )... | Create a HttpComponents HttpUriRequest object for the given HTTP method and URI specification . |
26,043 | public static void registerConverters ( Set < ? > converters , ConverterRegistry registry ) { if ( converters != null ) { for ( Object converter : converters ) { if ( converter instanceof GenericConverter ) { registry . addConverter ( ( GenericConverter ) converter ) ; } else if ( converter instanceof Converter < ? , ?... | Register the given Converter objects with the given target ConverterRegistry . |
26,044 | public static < K , V > MultiValueMap < K , V > unmodifiableMultiValueMap ( MultiValueMap < ? extends K , ? extends V > map ) { Assert . notNull ( map , "'map' must not be null" ) ; Map < K , List < V > > result = new LinkedHashMap < K , List < V > > ( map . size ( ) ) ; for ( Map . Entry < ? extends K , ? extends List... | Returns an unmodifiable view of the specified multi - value map . |
26,045 | public static String copyToString ( InputStream in , Charset charset ) throws IOException { Assert . notNull ( in , "No InputStream specified" ) ; StringBuilder out = new StringBuilder ( ) ; InputStreamReader reader = new InputStreamReader ( in , charset ) ; char [ ] buffer = new char [ BUFFER_SIZE ] ; int bytesRead = ... | Copy the contents of the given InputStream into a String . Leaves the stream open when done . |
26,046 | public static void copy ( byte [ ] in , OutputStream out ) throws IOException { Assert . notNull ( in , "No input byte array specified" ) ; Assert . notNull ( out , "No OutputStream specified" ) ; out . write ( in ) ; } | Copy the contents of the given byte array to the given OutputStream . Leaves the stream open when done . |
26,047 | private int handleIOException ( IOException ex ) throws IOException { if ( AUTH_ERROR . equals ( ex . getMessage ( ) ) || AUTH_ERROR_JELLY_BEAN . equals ( ex . getMessage ( ) ) ) { return HttpStatus . UNAUTHORIZED . value ( ) ; } else if ( PROXY_AUTH_ERROR . equals ( ex . getMessage ( ) ) ) { return HttpStatus . PROXY_... | If credentials are incorrect or not provided for Basic Auth then Android may throw this exception when an HTTP 401 is received . A separate exception is thrown for proxy authentication errors . Checking for this response and returning the proper status . |
26,048 | public static TextEncryptor queryableText ( CharSequence password , CharSequence salt ) { return new HexEncodingTextEncryptor ( new AndroidAesBytesEncryptor ( password . toString ( ) , salt , AndroidKeyGenerators . shared ( 16 ) ) ) ; } | Creates an encryptor for queryable text strings that uses standard password - based encryption . Uses a shared or constant 16 byte initialization vector so encrypting the same data results in the same encryption result . This is done to allow encrypted data to be queried against . Encrypted text is hex - encoded . |
26,049 | public static UriComponentsBuilder fromPath ( String path ) { UriComponentsBuilder builder = new UriComponentsBuilder ( ) ; builder . path ( path ) ; return builder ; } | Returns a builder that is initialized with the given path . |
26,050 | public UriComponentsBuilder uri ( URI uri ) { Assert . notNull ( uri , "'uri' must not be null" ) ; this . scheme = uri . getScheme ( ) ; if ( uri . isOpaque ( ) ) { this . ssp = uri . getRawSchemeSpecificPart ( ) ; resetHierarchicalComponents ( ) ; } else { if ( uri . getRawUserInfo ( ) != null ) { this . userInfo = u... | Initialize all components of this URI builder with the components of the given URI . |
26,051 | public UriComponentsBuilder pathSegment ( String ... pathSegments ) throws IllegalArgumentException { Assert . notNull ( pathSegments , "'segments' must not be null" ) ; this . pathBuilder . addPathSegments ( pathSegments ) ; resetSchemeSpecificPart ( ) ; return this ; } | Append the given path segments to the existing path of this builder . Each given path segment may contain URI template variables . |
26,052 | public UriComponentsBuilder queryParams ( MultiValueMap < String , String > params ) { Assert . notNull ( params , "'params' must not be null" ) ; this . queryParams . putAll ( params ) ; return this ; } | Add the given query parameters . |
26,053 | public UriComponentsBuilder replaceQueryParam ( String name , Object ... values ) { Assert . notNull ( name , "'name' must not be null" ) ; this . queryParams . remove ( name ) ; if ( ! ObjectUtils . isEmpty ( values ) ) { queryParam ( name , values ) ; } resetSchemeSpecificPart ( ) ; return this ; } | Set the query parameter values overriding all existing query values for the same parameter . If no values are given the query parameter is removed . |
26,054 | private static void registerCommonClasses ( Class < ? > ... commonClasses ) { for ( Class < ? > clazz : commonClasses ) { commonClassCache . put ( clazz . getName ( ) , clazz ) ; } } | Register the given common classes with the ClassUtils cache . |
26,055 | public static ClassLoader overrideThreadContextClassLoader ( ClassLoader classLoaderToUse ) { Thread currentThread = Thread . currentThread ( ) ; ClassLoader threadContextClassLoader = currentThread . getContextClassLoader ( ) ; if ( classLoaderToUse != null && ! classLoaderToUse . equals ( threadContextClassLoader ) )... | Override the thread context ClassLoader with the environment s bean ClassLoader if necessary i . e . if the bean ClassLoader is not equivalent to the thread context ClassLoader already . |
26,056 | public static boolean isCacheSafe ( Class < ? > clazz , ClassLoader classLoader ) { Assert . notNull ( clazz , "Class must not be null" ) ; try { ClassLoader target = clazz . getClassLoader ( ) ; if ( target == null ) { return true ; } ClassLoader cur = classLoader ; if ( cur == target ) { return true ; } while ( cur !... | Check whether the given class is cache - safe in the given context i . e . whether it is loaded by the given ClassLoader or a parent of it . |
26,057 | public static String getShortName ( String className ) { Assert . hasLength ( className , "Class name must not be empty" ) ; int lastDotIndex = className . lastIndexOf ( PACKAGE_SEPARATOR ) ; int nameEndIndex = className . indexOf ( CGLIB_CLASS_SEPARATOR ) ; if ( nameEndIndex == - 1 ) { nameEndIndex = className . lengt... | Get the class name without the qualified package name . |
26,058 | public static Method getStaticMethod ( Class < ? > clazz , String methodName , Class < ? > ... args ) { Assert . notNull ( clazz , "Class must not be null" ) ; Assert . notNull ( methodName , "Method name must not be null" ) ; try { Method method = clazz . getMethod ( methodName , args ) ; return Modifier . isStatic ( ... | Return a public static method of a class . |
26,059 | public static boolean isPrimitiveArray ( Class < ? > clazz ) { Assert . notNull ( clazz , "Class must not be null" ) ; return ( clazz . isArray ( ) && clazz . getComponentType ( ) . isPrimitive ( ) ) ; } | Check if the given class represents an array of primitives i . e . boolean byte char short int long float or double . |
26,060 | public static boolean isPrimitiveWrapperArray ( Class < ? > clazz ) { Assert . notNull ( clazz , "Class must not be null" ) ; return ( clazz . isArray ( ) && isPrimitiveWrapper ( clazz . getComponentType ( ) ) ) ; } | Check if the given class represents an array of primitive wrappers i . e . Boolean Byte Character Short Integer Long Float or Double . |
26,061 | public static Class < ? > resolvePrimitiveIfNecessary ( Class < ? > clazz ) { Assert . notNull ( clazz , "Class must not be null" ) ; return ( clazz . isPrimitive ( ) && clazz != void . class ? primitiveTypeToWrapperMap . get ( clazz ) : clazz ) ; } | Resolve the given class if it is a primitive class returning the corresponding primitive wrapper type instead . |
26,062 | public static Class < ? > [ ] toClassArray ( Collection < Class < ? > > collection ) { if ( collection == null ) { return null ; } return collection . toArray ( new Class < ? > [ collection . size ( ) ] ) ; } | Copy the given Collection into a Class array . The Collection must contain Class elements only . |
26,063 | public static Class < ? > determineCommonAncestor ( Class < ? > clazz1 , Class < ? > clazz2 ) { if ( clazz1 == null ) { return clazz2 ; } if ( clazz2 == null ) { return clazz1 ; } if ( clazz1 . isAssignableFrom ( clazz2 ) ) { return clazz1 ; } if ( clazz2 . isAssignableFrom ( clazz1 ) ) { return clazz2 ; } Class < ? > ... | Determine the common ancestor of the given classes if any . |
26,064 | public static Class < ? > resolveReturnType ( Method method , Class < ? > clazz ) { Assert . notNull ( method , "Method must not be null" ) ; Type genericType = method . getGenericReturnType ( ) ; Assert . notNull ( clazz , "Class must not be null" ) ; Map < TypeVariable , Type > typeVariableMap = getTypeVariableMap ( ... | Determine the target type for the generic return type of the given method where formal type variables are declared on the given class . |
26,065 | public static Class < ? > resolveReturnTypeArgument ( Method method , Class < ? > genericIfc ) { Assert . notNull ( method , "method must not be null" ) ; Type returnType = method . getReturnType ( ) ; Type genericReturnType = method . getGenericReturnType ( ) ; if ( returnType . equals ( genericIfc ) ) { if ( genericR... | Resolve the single type argument of the given generic interface against the given target method which is assumed to return the given interface or an implementation of it . |
26,066 | public static Class < ? > resolveTypeArgument ( Class < ? > clazz , Class < ? > genericIfc ) { Class < ? > [ ] typeArgs = resolveTypeArguments ( clazz , genericIfc ) ; if ( typeArgs == null ) { return null ; } if ( typeArgs . length != 1 ) { throw new IllegalArgumentException ( "Expected 1 type argument on generic inte... | Resolve the single type argument of the given generic interface against the given target class which is assumed to implement the generic interface and possibly declare a concrete type for its type variable . |
26,067 | private static Class < ? > extractClass ( Class < ? > ownerClass , Type arg ) { if ( arg instanceof ParameterizedType ) { return extractClass ( ownerClass , ( ( ParameterizedType ) arg ) . getRawType ( ) ) ; } else if ( arg instanceof GenericArrayType ) { GenericArrayType gat = ( GenericArrayType ) arg ; Type gt = gat ... | Extract a Class from the given Type . |
26,068 | static Type getRawType ( Type genericType , Map < TypeVariable , Type > typeVariableMap ) { Type resolvedType = genericType ; if ( genericType instanceof TypeVariable ) { TypeVariable tv = ( TypeVariable ) genericType ; resolvedType = typeVariableMap . get ( tv ) ; if ( resolvedType == null ) { resolvedType = extractBo... | Determine the raw type for the given generic parameter type . |
26,069 | public static Class < ? > getMapValueFieldType ( Field mapField , int nestingLevel ) { return getGenericFieldType ( mapField , Map . class , 1 , null , nestingLevel ) ; } | Determine the generic value type of the given Map field . |
26,070 | private static Class < ? > getGenericReturnType ( Method method , Class < ? > source , int typeIndex , int nestingLevel ) { return extractType ( method . getGenericReturnType ( ) , source , typeIndex , null , null , nestingLevel , 1 ) ; } | Extract the generic return type from the given method . |
26,071 | private static Class < ? > extractTypeFromClass ( Class < ? > clazz , Class < ? > source , int typeIndex , Map < TypeVariable , Type > typeVariableMap , Map < Integer , Integer > typeIndexesPerLevel , int nestingLevel , int currentLevel ) { if ( clazz . getName ( ) . startsWith ( "java.util." ) ) { return null ; } if (... | Extract the generic type from the given Class object . |
26,072 | public boolean exists ( ) { try { InputStream inputStream = this . assetManager . open ( this . fileName ) ; if ( inputStream != null ) { return true ; } else { return false ; } } catch ( IOException e ) { return false ; } } | This implementation returns whether the underlying asset exists . |
26,073 | static void addHeaders ( HttpUriRequest httpRequest , HttpHeaders headers ) { for ( Map . Entry < String , List < String > > entry : headers . entrySet ( ) ) { String headerName = entry . getKey ( ) ; if ( HttpHeaders . COOKIE . equalsIgnoreCase ( headerName ) ) { String headerValue = StringUtils . collectionToDelimite... | Add the given headers to the given HTTP request . |
26,074 | public boolean canBypassConvert ( TypeDescriptor sourceType , TypeDescriptor targetType ) { Assert . notNull ( targetType , "The targetType to convert to cannot be null" ) ; if ( sourceType == null ) { return true ; } GenericConverter converter = getConverter ( sourceType , targetType ) ; return ( converter == NO_OP_CO... | Returns true if conversion between the sourceType and targetType can be bypassed . More precisely this method will return true if objects of sourceType can be converted to the targetType by returning the source object unchanged . |
26,075 | protected static int calculateShift ( int minimumValue , int maximumValue ) { int shift = 0 ; int value = 1 ; while ( value < minimumValue && value < maximumValue ) { value <<= 1 ; shift ++ ; } return shift ; } | Calculate a shift value that can be used to create a power - of - two value between the specified maximum and minimum values . |
26,076 | public MediaType copyQualityValue ( MediaType mediaType ) { if ( ! mediaType . parameters . containsKey ( PARAM_QUALITY_FACTOR ) ) { return this ; } Map < String , String > params = new LinkedHashMap < String , String > ( this . parameters ) ; params . put ( PARAM_QUALITY_FACTOR , mediaType . parameters . get ( PARAM_Q... | Return a replica of this instance with the quality value of the given MediaType . |
26,077 | public MediaType removeQualityValue ( ) { if ( ! this . parameters . containsKey ( PARAM_QUALITY_FACTOR ) ) { return this ; } Map < String , String > params = new LinkedHashMap < String , String > ( this . parameters ) ; params . remove ( PARAM_QUALITY_FACTOR ) ; return new MediaType ( this , params ) ; } | Return a replica of this instance with its quality value removed . |
26,078 | public String getFirst ( String headerName ) { List < String > headerValues = headers . get ( headerName ) ; return headerValues != null ? headerValues . get ( 0 ) : null ; } | Return the first header value for the given header name if any . |
26,079 | public void add ( String headerName , String headerValue ) { List < String > headerValues = headers . get ( headerName ) ; if ( headerValues == null ) { headerValues = new LinkedList < String > ( ) ; this . headers . put ( headerName , headerValues ) ; } headerValues . add ( headerValue ) ; } | Add the given single header value under the given name . |
26,080 | public void set ( String headerName , String headerValue ) { List < String > headerValues = new LinkedList < String > ( ) ; headerValues . add ( headerValue ) ; headers . put ( headerName , headerValues ) ; } | Set the given single header value under the given name . |
26,081 | private void setViewPagerScroller ( ) { try { Field scrollerField = ViewPager . class . getDeclaredField ( "mScroller" ) ; scrollerField . setAccessible ( true ) ; Field interpolatorField = ViewPager . class . getDeclaredField ( "sInterpolator" ) ; interpolatorField . setAccessible ( true ) ; scroller = new CustomDurat... | set ViewPager scroller to change animation duration when sliding |
26,082 | public void scrollOnce ( ) { PagerAdapter adapter = getAdapter ( ) ; int currentItem = getCurrentItem ( ) ; int totalCount ; if ( adapter == null || ( totalCount = adapter . getCount ( ) ) <= 1 ) { return ; } int nextItem = ( direction == LEFT ) ? -- currentItem : ++ currentItem ; if ( nextItem < 0 ) { if ( isCycle ) {... | scroll only once |
26,083 | public void setHomeAsUpIndicator ( Drawable indicator ) { if ( ! deviceSupportMultiPane ( ) ) { pulsante . setHomeAsUpIndicator ( indicator ) ; } else { actionBar . setHomeAsUpIndicator ( indicator ) ; } } | Set the HomeAsUpIndicator that is visible when user navigate to a fragment child |
26,084 | public MaterialSection getSectionByTitle ( String title ) { for ( MaterialSection section : sectionList ) { if ( section . getTitle ( ) . equals ( title ) ) { return section ; } } for ( MaterialSection section : bottomSectionList ) { if ( section . getTitle ( ) . equals ( title ) ) return section ; } return null ; } | Get a setted section knowing his title |
26,085 | public List < MaterialSection > getSectionList ( ) { List < MaterialSection > list = new LinkedList < > ( ) ; for ( MaterialSection section : sectionList ) list . add ( section ) ; for ( MaterialSection section : bottomSectionList ) list . add ( section ) ; return list ; } | Get the section list |
26,086 | public MaterialAccount getAccountAtCurrentPosition ( int position ) { if ( position < 0 || position >= accountManager . size ( ) ) throw new RuntimeException ( "Account Index Overflow" ) ; return findAccountNumber ( position ) ; } | Get the account knowing his position |
26,087 | public MaterialAccount getAccountByTitle ( String title ) { for ( MaterialAccount account : accountManager ) if ( currentAccount . getTitle ( ) . equals ( title ) ) return account ; return null ; } | Get the account knowing his title |
26,088 | @ SuppressLint ( "NewApi" ) public boolean onTouch ( View v , MotionEvent event ) { if ( touchable ) { if ( event . getAction ( ) == MotionEvent . ACTION_DOWN ) { view . setBackgroundColor ( colorPressed ) ; return true ; } if ( event . getAction ( ) == MotionEvent . ACTION_CANCEL ) { if ( isSelected ) view . setBackgr... | touch event without ripple support |
26,089 | public void setBackgroundColor ( int color ) { colorUnpressed = color ; if ( ! isSelected ( ) ) { if ( rippleAnimationSupport ( ) ) { ripple . setRippleBackground ( colorUnpressed ) ; } else { view . setBackgroundColor ( colorUnpressed ) ; } } } | alias of setColorUnpressed |
26,090 | public List < NodeInfo > getNodes ( ) { final URI uri = uriWithPath ( "./nodes/" ) ; return Arrays . asList ( this . rt . getForObject ( uri , NodeInfo [ ] . class ) ) ; } | Retrieves state and metrics information for all nodes in the cluster . |
26,091 | public NodeInfo getNode ( String name ) { final URI uri = uriWithPath ( "./nodes/" + encodePathSegment ( name ) ) ; return this . rt . getForObject ( uri , NodeInfo . class ) ; } | Retrieves state and metrics information for individual node . |
26,092 | public List < ConnectionInfo > getConnections ( ) { final URI uri = uriWithPath ( "./connections/" ) ; return Arrays . asList ( this . rt . getForObject ( uri , ConnectionInfo [ ] . class ) ) ; } | Retrieves state and metrics information for all client connections across the cluster . |
26,093 | public ConnectionInfo getConnection ( String name ) { final URI uri = uriWithPath ( "./connections/" + encodePathSegment ( name ) ) ; return this . rt . getForObject ( uri , ConnectionInfo . class ) ; } | Retrieves state and metrics information for individual client connection . |
26,094 | public List < ChannelInfo > getChannels ( ) { final URI uri = uriWithPath ( "./channels/" ) ; return Arrays . asList ( this . rt . getForObject ( uri , ChannelInfo [ ] . class ) ) ; } | Retrieves state and metrics information for all channels across the cluster . |
26,095 | public List < ChannelInfo > getChannels ( String connectionName ) { final URI uri = uriWithPath ( "./connections/" + encodePathSegment ( connectionName ) + "/channels/" ) ; return Arrays . asList ( this . rt . getForObject ( uri , ChannelInfo [ ] . class ) ) ; } | Retrieves state and metrics information for all channels on individual connection . |
26,096 | public ChannelInfo getChannel ( String name ) { final URI uri = uriWithPath ( "./channels/" + encodePathSegment ( name ) ) ; return this . rt . getForObject ( uri , ChannelInfo . class ) ; } | Retrieves state and metrics information for individual channel . |
26,097 | public List < BindingInfo > getQueueBindings ( String vhost , String queue ) { final URI uri = uriWithPath ( "./queues/" + encodePathSegment ( vhost ) + "/" + encodePathSegment ( queue ) + "/bindings" ) ; final BindingInfo [ ] result = this . rt . getForObject ( uri , BindingInfo [ ] . class ) ; return asListOrNull ( r... | Returns a list of bindings where provided queue is the destination . |
26,098 | public void declareShovel ( String vhost , ShovelInfo info ) { Map < String , Object > props = info . getDetails ( ) . getPublishProperties ( ) ; if ( props != null && props . isEmpty ( ) ) { throw new IllegalArgumentException ( "Shovel publish properties must be a non-empty map or null" ) ; } final URI uri = uriWithPa... | Declares a shovel . |
26,099 | public void deleteShovel ( String vhost , String shovelname ) { this . deleteIgnoring404 ( uriWithPath ( "./parameters/shovel/" + encodePathSegment ( vhost ) + "/" + encodePathSegment ( shovelname ) ) ) ; } | Deletes the specified shovel from specified virtual host . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.