signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Validators { /** * Determine if the input parameter is a Email . if yes , the check passes . * @ param msg error message after verification failed * @ return Validation */ public static Validation < String > isEmail ( String msg ) { } }
return notEmpty ( ) . and ( SimpleValidation . from ( PatternKit :: isEmail , msg ) ) ;
public class DeleteMountTargetRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteMountTargetRequest deleteMountTargetRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteMountTargetRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteMountTargetRequest . getMountTargetId ( ) , MOUNTTARGETID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request...
public class PhoneNumberUtil { /** * format phone number in E123 national format with cursor position handling . * @ param pphoneNumberData phone number to format with cursor position * @ return formated phone number as String with new cursor position */ public final ValueWithPos < String > formatE123NationalWithPo...
if ( pphoneNumberData == null ) { return null ; } int cursor = pphoneNumberData . getPos ( ) ; final StringBuilder resultNumber = new StringBuilder ( ) ; if ( isPhoneNumberNotEmpty ( pphoneNumberData . getValue ( ) ) ) { PhoneCountryData phoneCountryData = null ; for ( final PhoneCountryCodeData country : CreatePhoneCo...
public class MonotonicLaxImmutableMapBuilder { /** * See { @ link ImmutableMap . Builder # orderEntriesByValue ( Comparator ) } */ @ Override public LaxImmutableMapBuilder < K , V > orderEntriesByValue ( Comparator < ? super V > valueComparator ) { } }
innerBuilder . orderEntriesByValue ( valueComparator ) ; return this ;
public class VecUtils { /** * Create a new { @ link Vec } of categorical values from string { @ link Vec } . * FIXME : implement in more efficient way with Brandon ' s primitives for BufferedString manipulation * @ param vec a string { @ link Vec } * @ return a categorical { @ link Vec } */ public static Vec stri...
final String [ ] vecDomain = new CollectStringVecDomain ( ) . domain ( vec ) ; MRTask task = new MRTask ( ) { transient private java . util . HashMap < String , Integer > lookupTable ; @ Override protected void setupLocal ( ) { lookupTable = new java . util . HashMap < > ( vecDomain . length ) ; for ( int i = 0 ; i < v...
public class RTMPHandshake { /** * RTMPE type 8 uses XTEA on the regular signature http : / / en . wikipedia . org / wiki / XTEA * @ param array array to get signature * @ param offset offset to start from * @ param keyid ID of XTEA key */ public final static void getXteaSignature ( byte [ ] array , int offset , ...
int num_rounds = 32 ; int v0 , v1 , sum = 0 , delta = 0x9E3779B9 ; int [ ] k = XTEA_KEYS [ keyid ] ; v0 = ByteBuffer . wrap ( array , offset , 4 ) . getInt ( ) ; v1 = ByteBuffer . wrap ( array , offset + 4 , 4 ) . getInt ( ) ; for ( int i = 0 ; i < num_rounds ; i ++ ) { v0 += ( ( ( v1 << 4 ) ^ ( v1 >> 5 ) ) + v1 ) ^ ( ...
public class StringExpression { /** * Create a { @ code this . toUpperCase ( ) } expression * < p > Get the upper case form < / p > * @ return this . toUpperCase ( ) * @ see java . lang . String # toUpperCase ( ) */ public StringExpression upper ( ) { } }
if ( upper == null ) { upper = Expressions . stringOperation ( Ops . UPPER , mixin ) ; } return upper ;
public class ManagedClustersInner { /** * Gets upgrade profile for a managed cluster . * Gets the details of the upgrade profile for a managed cluster with a specified resource group and name . * @ param resourceGroupName The name of the resource group . * @ param resourceName The name of the managed cluster reso...
return ServiceFuture . fromResponse ( getUpgradeProfileWithServiceResponseAsync ( resourceGroupName , resourceName ) , serviceCallback ) ;
public class RequestParameterBuilder { /** * Adds a request parameter to the URL . This is a convenient method for primitive , plain data types . Parameter ' s value will not be converted to JSON * notation when adding . It will be only encoded according to the acquired encoding . Note : null values will not be added...
String encodedValue = encode ( value ) ; if ( encodedValue == null ) { return this ; } if ( added || originalUrl . contains ( "?" ) ) { buffer . append ( "&" ) ; } else { buffer . append ( "?" ) ; } buffer . append ( name ) ; buffer . append ( "=" ) ; buffer . append ( encodedValue ) ; // set a flag that at least one r...
public class Assert { /** * Asserts that the condition is { @ literal false } . * The assertion holds if and only if the value is equal to { @ literal false } . * @ param condition { @ link Boolean } value being evaluated . * @ param message { @ link Supplier } containing the message used in the { @ link IllegalA...
if ( isNotFalse ( condition ) ) { throw new IllegalArgumentException ( message . get ( ) ) ; }
public class PolynomialApproximation { /** * Returns the function value of the polynomial approximation * at the specified k . * @ param k the value for which the polynomial approximation should be returned * @ return the function value of the polynomial approximation * at the specified k */ public double getVa...
double result = 0. ; double log_k = FastMath . log ( k ) , acc = 1. ; for ( int p = 0 ; p < b . length ; p ++ ) { result += b [ p ] * acc ; acc *= log_k ; } return result ;
public class DefaultGroovyMethods { /** * Convenience method to dynamically create a new instance of this * class . Calls the default constructor . * @ param c a class * @ return a new instance of this class * @ since 1.0 */ @ SuppressWarnings ( "unchecked" ) public static < T > T newInstance ( Class < T > c ) ...
return ( T ) InvokerHelper . invokeConstructorOf ( c , null ) ;
public class CmisConnector { /** * Defines node type for the repository info . * @ param typeManager JCR node type manager . * @ throws RepositoryException */ @ SuppressWarnings ( "unchecked" ) private void registerRepositoryInfoType ( NodeTypeManager typeManager ) throws RepositoryException { } }
// create node type template NodeTypeTemplate type = typeManager . createNodeTypeTemplate ( ) ; // convert CMIS type ' s attributes to node type template we have just created type . setName ( "cmis:repository" ) ; type . setAbstract ( false ) ; type . setMixin ( false ) ; type . setOrderableChildNodes ( true ) ; type ....
public class Iterate { /** * Add all elements from the source Iterable to the target collection , return the target collection . */ public static < T , R extends Collection < T > > R addAllTo ( Iterable < ? extends T > iterable , R targetCollection ) { } }
Iterate . addAllIterable ( iterable , targetCollection ) ; return targetCollection ;
public class InstanceIdentityProvider { /** * Shortcut to { @ link KeyPair # getPublic ( ) } . * @ return the public key . { @ code null } if { @ link # getKeyPair ( ) } is { @ code null } . */ @ SuppressWarnings ( "unchecked" ) @ CheckForNull protected PUB getPublicKey ( ) { } }
KeyPair keyPair = getKeyPair ( ) ; return keyPair == null ? null : ( PUB ) keyPair . getPublic ( ) ;
public class MetadataService { /** * Updates a { @ link ProjectRole } for the { @ link Token } of the specified { @ code appId } . */ public CompletableFuture < Revision > updateTokenRole ( Author author , String projectName , Token token , ProjectRole role ) { } }
requireNonNull ( author , "author" ) ; requireNonNull ( projectName , "projectName" ) ; requireNonNull ( token , "token" ) ; requireNonNull ( role , "role" ) ; final TokenRegistration registration = new TokenRegistration ( token . appId ( ) , role , UserAndTimestamp . of ( author ) ) ; final JsonPointer path = JsonPoin...
public class EbeanQueryChannelService { /** * Return a ExpressionList specifying propertyName equals value . * @ param expressionList the ExpressionList to add contains expression * @ param propertyName the property name of entity bean . * @ param value equals value * @ param < T > the type of entity . * @ re...
Assert . notNull ( expressionList , "expressionList must not null" ) ; Assert . hasText ( propertyName , "propertyName must not null" ) ; if ( value != null ) { return expressionList . eq ( propertyName , value ) ; } return expressionList ;
public class CodeableConceptDt { /** * Gets the value ( s ) for < b > coding < / b > ( ) . * creating it if it does * not exist . Will not return < code > null < / code > . * < b > Definition : < / b > * A reference to a code defined by a terminology system */ public java . util . List < CodingDt > getCoding ( ...
if ( myCoding == null ) { myCoding = new java . util . ArrayList < CodingDt > ( ) ; } return myCoding ;
public class PrivacyListManager { /** * Answer a privacy containing the list structure without { @ link PrivacyItem } . * @ return a Privacy with the list names . * @ throws XMPPErrorException * @ throws NoResponseException * @ throws NotConnectedException * @ throws InterruptedException */ private Privacy ge...
// The request of the list is an empty privacy message Privacy request = new Privacy ( ) ; // Send the package to the server and get the answer return getRequest ( request ) ;
public class AuditData { /** * < pre > * Detailed information about CreateVersion call . * < / pre > * < code > . google . appengine . v1 . CreateVersionMethod create _ version = 2 ; < / code > */ public com . google . appengine . v1 . CreateVersionMethod getCreateVersion ( ) { } }
if ( methodCase_ == 2 ) { return ( com . google . appengine . v1 . CreateVersionMethod ) method_ ; } return com . google . appengine . v1 . CreateVersionMethod . getDefaultInstance ( ) ;
public class GraphEntityMapper { /** * Fetches Non - proxy nodes from index hits */ private Node getNonProxyNode ( IndexHits < Node > nodesFound ) { } }
Node node = null ; if ( nodesFound . hasNext ( ) ) { node = nodesFound . next ( ) ; } else { return null ; } try { Object proxyNodeProperty = node . getProperty ( PROXY_NODE_TYPE_KEY ) ; } catch ( NotFoundException e ) { return node ; } catch ( IllegalStateException e ) { return node ; } return getNonProxyNode ( nodesF...
public class Debug { public void doGet ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { } }
Page page = new Page ( ) ; page . title ( getServletInfo ( ) ) ; page . attribute ( "text" , "#000000" ) ; page . attribute ( Page . BGCOLOR , "#FFFFFF" ) ; page . attribute ( "link" , "#606CC0" ) ; page . attribute ( "vlink" , "#606CC0" ) ; page . attribute ( "alink" , "#606CC0" ) ; Log l = LogFactory . getLog ( Debug...
public class ProcessGroovyMethods { /** * Overloads the left shift operator ( & lt ; & lt ; ) to provide an append mechanism * to pipe data to a Process . * @ param self a Process instance * @ param value a value to append * @ return a Writer * @ throws java . io . IOException if an IOException occurs . * @...
return IOGroovyMethods . leftShift ( self . getOutputStream ( ) , value ) ;
public class ServerCacheControl { /** * Parses the specified { @ code " cache - control " } header values into a { @ link ServerCacheControl } . * Note that any unknown directives will be ignored . * @ return the { @ link ServerCacheControl } decoded from the specified header values . */ public static ServerCacheCo...
requireNonNull ( directives , "directives" ) ; final ServerCacheControlBuilder builder = new ServerCacheControlBuilder ( ) ; for ( String d : directives ) { parseCacheControl ( d , ( name , value ) -> { final BiConsumer < ServerCacheControlBuilder , String > action = DIRECTIVES . get ( name ) ; if ( action != null ) { ...
public class SecurityPhaseListener { /** * Get the default phases at which restrictions should be applied , by looking for a @ RestrictAtPhase on a matching * @ param viewId * @ return default phases for a view * @ ViewPattern , falling back on global defaults if none are found */ public PhaseIdType [ ] getDefaul...
PhaseIdType [ ] defaultPhases = null ; RestrictAtPhase restrictAtPhase = viewConfigStore . getAnnotationData ( viewId , RestrictAtPhase . class ) ; if ( restrictAtPhase != null ) { defaultPhases = restrictAtPhase . value ( ) ; } if ( defaultPhases == null ) { defaultPhases = RestrictAtPhaseDefault . DEFAULT_PHASES ; } ...
public class CmsPushButton { /** * Tells the button to use a minimal width . < p > * @ param useMinWidth < code > true < / code > to use a minimal width */ public void setUseMinWidth ( boolean useMinWidth ) { } }
if ( useMinWidth != m_useMinWidth ) { if ( useMinWidth ) { addStyleName ( I_CmsLayoutBundle . INSTANCE . buttonCss ( ) . cmsMinWidth ( ) ) ; } else { removeStyleName ( I_CmsLayoutBundle . INSTANCE . buttonCss ( ) . cmsMinWidth ( ) ) ; } m_useMinWidth = useMinWidth ; }
public class RestClientUtil { /** * 创建索引文档 , 根据elasticsearch . xml中指定的日期时间格式 , 生成对应时间段的索引表名称 * @ param indexName * @ param bean * @ return * @ throws ElasticSearchException */ public String addDateDocument ( String indexName , Object bean ) throws ElasticSearchException { } }
return addDateDocument ( indexName , _doc , bean ) ;
public class AbstractSimon { /** * Replaces one of the children for a new one ( unknown to concrete ) . Used only internally . * @ param simon original Simon ( unknown ) * @ param newSimon new Simon */ void replaceChild ( Simon simon , AbstractSimon newSimon ) { } }
children . remove ( simon ) ; if ( newSimon != null ) { children . add ( newSimon ) ; newSimon . setParent ( this ) ; }
public class EmbeddedChannel { /** * Writes one message to the inbound of this { @ link Channel } and does not flush it . This * method is conceptually equivalent to { @ link # write ( Object , ChannelPromise ) } . * @ see # writeOneOutbound ( Object , ChannelPromise ) */ public ChannelFuture writeOneInbound ( Obje...
if ( checkOpen ( true ) ) { pipeline ( ) . fireChannelRead ( msg ) ; } return checkException ( promise ) ;
public class AbstractEJBRuntime { /** * Bind the remote interfaces for all beans known to the container . * Intended to be used to restore EJB bindings when the ORB is restarted . */ protected void bindAllRemoteInterfacesToContextRoot ( ) { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "bindAllRemoteInterfacesToContextRoot" ) ; Map < EJBModuleMetaDataImpl , NameSpaceBinder < ? > > binders = new HashMap < EJBModuleMetaDataImpl , NameSpaceBinder < ? > > ( ) ; // Start with ...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcFlowInstrumentType ( ) { } }
if ( ifcFlowInstrumentTypeEClass == null ) { ifcFlowInstrumentTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 281 ) ; } return ifcFlowInstrumentTypeEClass ;
public class NewRelicManager { /** * Called after setting configuration properties . * @ param cache The provider cache */ public void initialize ( NewRelicCache cache ) { } }
String apiKey = cache . getApiKey ( ) ; if ( apiKey == null ) throw new IllegalArgumentException ( "null API key" ) ; logger . info ( "Initialising the clients" ) ; initialized = false ; if ( cache . isAlertsEnabled ( ) ) { apiClient = NewRelicApi . builder ( ) . apiKey ( apiKey ) . build ( ) ; infraApiClient = NewReli...
public class AiMaterial { /** * This method is used by JNI , do not call or modify . * @ param type the type * @ param number the number */ @ SuppressWarnings ( "unused" ) private void setTextureNumber ( int type , int number ) { } }
m_numTextures . put ( AiTextureType . fromRawValue ( type ) , number ) ;
public class AbstractThemeWidget { @ Override public void onVisibleChange ( LayerShownEvent event ) { } }
if ( ! themeChange && getActiveViewConfig ( ) != null && ! event . isScaleChange ( ) ) { activateViewConfig ( null ) ; }
public class AreaSizesD { /** * Construct an area at the origin that has the same size as { @ code size } . * @ param size The area size * @ return An area at the origin */ public static AreaD area ( final AreaSizeD size ) { } }
Objects . requireNonNull ( size , "Size" ) ; return AreaD . of ( 0.0 , size . sizeX ( ) , 0.0 , size . sizeY ( ) ) ;
public class OpenALStreamPlayer { /** * Start this stream playing * @ param loop True if the stream should loop * @ throws IOException Indicates a failure to read from the stream */ public void play ( boolean loop ) throws IOException { } }
this . loop = loop ; initStreams ( ) ; done = false ; AL10 . alSourceStop ( source ) ; removeBuffers ( ) ; startPlayback ( ) ;
public class GEARImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . GEAR__DATA : setDATA ( ( byte [ ] ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class LocalUniqueIDGeneratorFactory { /** * Return the UniqueIDGenerator instance for this specific generator - ID , cluster - ID combination . If one was * already created , that is returned . * @ param generatorId Generator ID to use ( 0 ≤ n ≤ 255 ) . * @ param clusterId Cluster ID to use ( 0 ≤ n ≤ 15 ) ...
assertParameterWithinBounds ( "generatorId" , 0 , Blueprint . MAX_GENERATOR_ID , generatorId ) ; assertParameterWithinBounds ( "clusterId" , 0 , Blueprint . MAX_CLUSTER_ID , clusterId ) ; String generatorAndCluster = String . format ( "%d_%d" , generatorId , clusterId ) ; if ( ! instances . containsKey ( generatorAndCl...
public class Streams { /** * Reverse a Stream * < pre > * { @ code * assertThat ( Streams . reverse ( Stream . of ( 1,2,3 ) ) . collect ( CyclopsCollectors . toList ( ) ) * , equalTo ( Arrays . asList ( 3,2,1 ) ) ) ; * < / pre > * @ param stream Stream to reverse * @ return Reversed stream */ public stati...
return ReactiveSeq . of ( 1 ) . flatMap ( i -> reversedStream ( stream . collect ( java . util . stream . Collectors . toList ( ) ) ) ) ;
public class UserStorageMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UserStorage userStorage , ProtocolMarshaller protocolMarshaller ) { } }
if ( userStorage == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( userStorage . getCapacity ( ) , CAPACITY_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e...
public class TagImpl { /** * For documentation comment with embedded @ link tags , return the array of * TagImpls consisting of SeeTagImpl ( s ) and text containing TagImpl ( s ) . * Within a comment string " This is an example of inline tags for a * documentation comment { @ link Doc { @ link Doc commentlabel } ...
if ( inlineTags == null ) { inlineTags = Comment . getInlineTags ( holder , text ) ; } return inlineTags ;
public class EJSContainer { /** * Remove the bean with the given bean home name from * this container . < p > */ private void uninstallBean ( BeanMetaData bmd , boolean terminate ) throws ContainerException { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; // d532639.2 J2EEName beanHomeName = bmd . j2eeName ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "uninstallBean : " + beanHomeName ) ; // 89188 // If the BeanMetaData is not in the internal store , then we only need to // remove the...
public class CharArrayList { /** * Copies element of this type - specific list into the given array using optimized system calls . * @ param from the start index ( inclusive ) . * @ param a the destination array . * @ param offset the offset into the destination array where to store the first element copied . *...
CharArrays . ensureOffsetLength ( a , offset , length ) ; System . arraycopy ( this . a , from , a , offset , length ) ;
public class FileSystemView { /** * Snapshots the entries of the working directory of this view . */ public ImmutableSortedSet < Name > snapshotWorkingDirectoryEntries ( ) { } }
store . readLock ( ) . lock ( ) ; try { ImmutableSortedSet < Name > names = workingDirectory . snapshot ( ) ; workingDirectory . updateAccessTime ( ) ; return names ; } finally { store . readLock ( ) . unlock ( ) ; }
public class Hour { /** * Converts a given string into an instance of this class . * @ param str * String to convert . * @ return New instance . */ @ Nullable public static Hour valueOf ( @ Nullable final String str ) { } }
if ( str == null ) { return null ; } return new Hour ( str ) ;
public class EditShape { /** * Append a Geometry to the given geometry of the Edit _ shape */ void appendGeometry ( int dstGeometry , Geometry srcGeometry ) { } }
Geometry . Type gt = srcGeometry . getType ( ) ; if ( Geometry . isMultiPath ( gt . value ( ) ) ) { appendMultiPath_ ( dstGeometry , ( MultiPath ) srcGeometry ) ; return ; } else if ( gt . value ( ) == Geometry . GeometryType . MultiPoint ) { appendMultiPoint_ ( dstGeometry , ( MultiPoint ) srcGeometry ) ; return ; } t...
public class CircuitBreakerAspect { /** * the default Java types handling for the circuit breaker AOP */ private Object defaultHandling ( ProceedingJoinPoint proceedingJoinPoint , io . github . resilience4j . circuitbreaker . CircuitBreaker circuitBreaker ) throws Throwable { } }
return circuitBreaker . executeCheckedSupplier ( proceedingJoinPoint :: proceed ) ;
public class Server { /** * Map key ( host + / + context path ) and global scope name * @ param hostName * Host name * @ param contextPath * Context path * @ param globalName * Global scope name * @ return true if mapping was added , false if already exist */ public boolean addMapping ( String hostName , ...
log . info ( "Add mapping global: {} host: {} context: {}" , new Object [ ] { globalName , hostName , contextPath } ) ; final String key = getKey ( hostName , contextPath ) ; log . debug ( "Add mapping: {} => {}" , key , globalName ) ; return ( mapping . putIfAbsent ( key , globalName ) == null ) ;
public class FedoraAPIMImpl { /** * ( non - Javadoc ) * @ see * org . fcrepo . server . management . FedoraAPIMMTOM # getDatastreamHistory ( java * . lang . String pid , ) String dsID ) * */ @ Override public List < org . fcrepo . server . types . gen . Datastream > getDatastreamHistory ( String pid , String dsID...
assertInitialized ( ) ; try { MessageContext ctx = context . getMessageContext ( ) ; org . fcrepo . server . storage . types . Datastream [ ] intDatastreams = m_management . getDatastreamHistory ( ReadOnlyContext . getSoapContext ( ctx ) , pid , dsID ) ; return getGenDatastreams ( intDatastreams ) ; } catch ( Throwable...
public class UpdateDataRetentionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateDataRetentionRequest updateDataRetentionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateDataRetentionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateDataRetentionRequest . getStreamName ( ) , STREAMNAME_BINDING ) ; protocolMarshaller . marshall ( updateDataRetentionRequest . getStreamARN ( ) , STREAM...
public class JsonReader { /** * Assigns { @ code nextToken } based on the value of { @ code nextValue } . */ private JsonToken decodeLiteral ( ) throws IOException { } }
if ( valuePos == - 1 ) { // it was too long to fit in the buffer so it can only be a string return JsonToken . STRING ; } else if ( valueLength == 4 && ( 'n' == buffer [ valuePos ] || 'N' == buffer [ valuePos ] ) && ( 'u' == buffer [ valuePos + 1 ] || 'U' == buffer [ valuePos + 1 ] ) && ( 'l' == buffer [ valuePos + 2 ]...
public class ApiOvhOrder { /** * Get prices and contracts information * REST : GET / order / cdn / webstorage / { serviceName } / traffic * @ param bandwidth [ required ] Traffic in TB that will be added to the cdn . webstorage service * @ param serviceName [ required ] The internal name of your CDN Static offer ...
String qPath = "/order/cdn/webstorage/{serviceName}/traffic" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "bandwidth" , bandwidth ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhOrder . class ) ;
public class PropertyCatalogCheck { /** * Assuming that the currently analyzed file is located below the current working directory , this method returns a * new array of exactly < code > pNumSubdirs < / code > elements containing the simple names of the directories on the * path to the currently analyzed file , sta...
String [ ] result = new String [ pNumSubdirs ] ; Arrays . fill ( result , null ) ; final File thisFile = Util . canonize ( getApiFixer ( ) . getCurrentFileName ( ) ) ; if ( thisFile . getPath ( ) . startsWith ( baseDir . getPath ( ) ) ) { final String relPath = thisFile . getPath ( ) . substring ( baseDir . getPath ( )...
public class Trie2Writable { /** * Produce an optimized , read - only Trie2_32 from this writable Trie . */ public Trie2_32 toTrie2_32 ( ) { } }
Trie2_32 frozenTrie = new Trie2_32 ( ) ; freeze ( frozenTrie , ValueWidth . BITS_32 ) ; return frozenTrie ;
public class AbstractRole { /** * Updates the term and leader . */ protected boolean updateTermAndLeader ( long term , MemberId leader ) { } }
// If the request indicates a term that is greater than the current term or no leader has been // set for the current term , update leader and term . if ( term > raft . getTerm ( ) || ( term == raft . getTerm ( ) && raft . getLeader ( ) == null && leader != null ) ) { raft . setTerm ( term ) ; raft . setLeader ( leader...
public class GetInstance { /** * Return a List of all the available Services that implement any of * the specified algorithms . See getServices ( String , String ) for detals . */ public static List < Service > getServices ( List < ServiceId > ids ) { } }
ProviderList list = Providers . getProviderList ( ) ; return list . getServices ( ids ) ;
public class MuxServer { /** * Close the mux */ public void close ( ) throws IOException { } }
isClosed = true ; OutputStream os = this . os ; this . os = null ; InputStream is = this . is ; this . is = null ; if ( os != null ) os . close ( ) ; if ( is != null ) is . close ( ) ;
public class RouteTablesInner { /** * Updates a route table tags . * @ param resourceGroupName The name of the resource group . * @ param routeTableName The name of the route table . * @ param tags Resource tags . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . ...
return ServiceFuture . fromResponse ( beginUpdateTagsWithServiceResponseAsync ( resourceGroupName , routeTableName , tags ) , serviceCallback ) ;
public class DeviceImpl { /** * Command State * @ return the state * @ throws DevFailed */ @ Command ( name = STATE_NAME , outTypeDesc = "Device state" ) public DevState executeStateCmd ( ) throws DevFailed { } }
MDC . setContextMap ( contextMap ) ; xlogger . entry ( ) ; xlogger . exit ( ) ; return getState ( ) ;
public class FormulaWriter { /** * Writes a given formula to a file . * @ param fileName the file name of the file * @ param formula the formula to write * @ param splitAndMultiline indicates whether - if the formula is an conjunction - the single operands should be * written to different lines without a conjoi...
write ( new File ( fileName ) , formula , splitAndMultiline , formula . factory ( ) . stringRepresentation ( ) ) ;
public class ResourceBundlesHandlerImpl { /** * Returns the bundle iterator * @ param debugMode * the flag indicating if we are in debug mode or not * @ param commentCallbackHandler * the comment callback handler * @ param variants * the variant map * @ return the bundle iterator */ private ResourceBundle...
ResourceBundlePathsIterator bundlesIterator ; if ( debugMode . equals ( DebugMode . DEBUG ) ) { bundlesIterator = new DebugModePathsIteratorImpl ( bundles , commentCallbackHandler , variants ) ; } else if ( debugMode . equals ( DebugMode . FORCE_NON_DEBUG_IN_IE ) ) { bundlesIterator = new IECssDebugPathsIteratorImpl ( ...
public class GatewayServlet { /** * Generic handler for all types of http actions / verbs . * @ param req * @ param resp * @ param action */ protected void doAction ( final HttpServletRequest req , final HttpServletResponse resp , String action ) { } }
// Read the request . ApiRequest srequest ; try { srequest = readRequest ( req ) ; srequest . setType ( action ) ; } catch ( Exception e ) { writeError ( null , resp , e ) ; return ; } final CountDownLatch latch = new CountDownLatch ( 1 ) ; final ApiRequest finalRequest = srequest ; // Now execute the request via the a...
public class DecadeSpellingFilter { /** * Gets the Roman notation for numbers . * @ param num the integer to convert * @ return the String using the number . */ private String getRomanNumber ( int num ) { } }
String roman = "" ; // The roman numeral . int N = num ; // N represents the part of num that still has // to be converted to Roman numeral representation . for ( int i = 0 ; i < numbers . length ; i ++ ) { while ( N >= numbers [ i ] ) { roman += letters [ i ] ; N -= numbers [ i ] ; } } return roman ;
public class DefaultFileIO { /** * Read a XML document and return a projection to it . * @ param projectionInterface * @ return a new projection pointing to the content of the file . * @ throws IOException */ @ Override public < T > T read ( final Class < T > projectionInterface ) throws IOException { } }
try { Document document = projector . config ( ) . createDocumentBuilder ( ) . parse ( file ) ; return projector . projectDOMNode ( document , projectionInterface ) ; } catch ( SAXException e ) { throw new XBDocumentParsingException ( e ) ; }
public class AbstractGreenPepperMacro { /** * < p > getPageTitle . < / p > * @ param parameters a { @ link java . util . Map } object . * @ param renderContext a { @ link com . atlassian . renderer . RenderContext } object . * @ param spaceKey a { @ link java . lang . String } object . * @ return a { @ link jav...
return getPage ( parameters , renderContext , spaceKey ) . getTitle ( ) . trim ( ) ;
public class WSJdbcDataSource { /** * Locate the underlying JDBC driver ' s implementation of the specified interface . * @ param interfaceClass the interface . * @ return the underlying JDBC driver ' s implementation of the specified interface , * or NULL if none is found . * @ throws SQLException if an error ...
Object jdbcImplObject = getJDBCImplObject ( ) ; if ( jdbcImplObject == null ) { return null ; } Object impl = WSJdbcTracer . getImpl ( jdbcImplObject ) ; return interfaceClass . isInstance ( impl ) ? ( T ) impl : null ;
public class DescribeVpcPeeringAuthorizationsResult { /** * Collection of objects that describe all valid VPC peering operations for the current AWS account . * @ param vpcPeeringAuthorizations * Collection of objects that describe all valid VPC peering operations for the current AWS account . */ public void setVpc...
if ( vpcPeeringAuthorizations == null ) { this . vpcPeeringAuthorizations = null ; return ; } this . vpcPeeringAuthorizations = new java . util . ArrayList < VpcPeeringAuthorization > ( vpcPeeringAuthorizations ) ;
public class AnalysisContext { /** * Load an interprocedural property database . * @ param < DatabaseType > * actual type of the database * @ param < KeyType > * type of key ( e . g . , method or field ) * @ param < Property > * type of properties stored in the database * @ param database * the empty da...
try { File dbFile = new File ( getDatabaseInputDir ( ) , fileName ) ; if ( DEBUG ) { System . out . println ( "Loading " + description + " from " + dbFile . getPath ( ) + "..." ) ; } database . readFromFile ( dbFile . getPath ( ) ) ; return database ; } catch ( IOException e ) { getLookupFailureCallback ( ) . logError ...
public class SibRaEngineComponent { /** * ( non - Javadoc ) * @ see com . ibm . ws . sib . admin . JsEngineComponent # initialize ( com . ibm . ws . sib . admin . JsMessagingEngine ) */ public void initialize ( final JsMessagingEngine engine ) { } }
final String methodName = "initialize" ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , engine ) ; } final Set listeners ; _messagingEngine = engine ; synchronized ( MESSAGING_ENGINES ) { // Do we already have a set of initialized MEs on this bus ? Set messagingEngines = ( Set ) MESSAGI...
public class JsFacade { /** * Dialogs */ @ UsedByApp public void bindDialogs ( JsDisplayListCallback < JsDialog > callback ) { } }
if ( callback == null ) { return ; } messenger . getSharedDialogList ( ) . subscribe ( callback , false ) ;
public class AzureClient { /** * Polls from the ' Azure - AsyncOperation ' header and updates the polling * state with the polling response . * @ param pollingState the polling state for the current operation . * @ param < T > the return type of the caller . */ private < T > Observable < PollingState < T > > upda...
return pollAsync ( pollingState . azureAsyncOperationHeaderLink ( ) , pollingState . loggingContext ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < PollingState < T > > > ( ) { @ Override public Observable < PollingState < T > > call ( Response < ResponseBody > response ) { final AzureAsyncOperat...
public class JsMsgObject { /** * Encode the message into a single DataSlice . * The DataSlice will be used by the Comms component to transmit the message * over the wire . * This method may only be used for a single - part message . * @ param conn - the CommsConnection over which this encoded message will be se...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "encodeSinglePartMessage" ) ; // We must only use this method if the message does not have a payload part if ( payloadPart != null ) { MessageEncodeFailedException mefe = new MessageEncodeFailedException ( "Invalid ca...
public class AnimaQuery { /** * Build a select statement . * @ param addOrderBy add the order by clause . * @ return select sql */ private String buildSelectSQL ( boolean addOrderBy ) { } }
SQLParams sqlParams = SQLParams . builder ( ) . modelClass ( this . modelClass ) . selectColumns ( this . selectColumns ) . tableName ( this . tableName ) . pkName ( this . primaryKeyColumn ) . conditionSQL ( this . conditionSQL ) . excludedColumns ( this . excludedColumns ) . isSQLLimit ( isSQLLimit ) . build ( ) ; if...
public class BaseJavaFileManager { /** * { @ inheritDoc } */ @ Override public JavaFileObject getJavaFileForOutput ( final Location location , final String qualifiedName , final Kind kind , final FileObject outputFile ) { } }
return this . compiledJavaFileObject ;
public class MediaDefault { /** * Create media from file . * @ param prefix The prefix path . * @ param prefixLength The prefix length . * @ param file The file to created as media . * @ return The created media . */ private Media create ( String prefix , int prefixLength , File file ) { } }
final String currentPath = file . getPath ( ) ; final String [ ] systemPath = SLASH . split ( currentPath . substring ( currentPath . indexOf ( prefix ) + prefixLength ) . replace ( File . separator , Constant . SLASH ) ) ; final Media media ; if ( loader . isPresent ( ) ) { media = new MediaDefault ( separator , loade...
public class OutputGate { public void initializeChannels ( GateDeploymentDescriptor descriptor ) { } }
int numChannels = descriptor . getNumberOfChannelDescriptors ( ) ; this . channels = new OutputChannel [ numChannels ] ; setChannelType ( descriptor . getChannelType ( ) ) ; for ( int i = 0 ; i < numChannels ; i ++ ) { ChannelDeploymentDescriptor channelDescriptor = descriptor . getChannelDescriptor ( i ) ; ChannelID i...
public class BaseNDArrayFactory { /** * Random normal using the given rng * @ param rows the number of rows in the matrix * @ param columns the number of columns in the matrix * @ param r the random generator to use * @ return */ @ Override public INDArray randn ( long rows , long columns , org . nd4j . linalg ...
return randn ( new long [ ] { rows , columns } , r ) ;
public class DocumentFormats { /** * write , read , and delete the document */ public static void writeReadDeleteDocument ( DatabaseClient client , String filename , String format ) throws IOException { } }
// create a manager for documents of any format GenericDocumentManager docMgr = client . newDocumentManager ( ) ; InputStream docStream = Util . openStream ( "data" + File . separator + filename ) ; if ( docStream == null ) throw new IOException ( "Could not read document example" ) ; // create an identifier for the do...
public class RandomDateUtils { /** * Returns a random { @ link Instant } that is after the given { @ link Instant } . * @ param after the value that returned { @ link Instant } must be after * @ return the random { @ link Instant } * @ throws IllegalArgumentException if after is null or if after is equal to or af...
checkArgument ( after != null , "After must be non-null" ) ; checkArgument ( after . isBefore ( MAX_INSTANT ) , "Cannot produce date after %s" , MAX_INSTANT ) ; return randomInstant ( after . plus ( 1 , MILLIS ) , MAX_INSTANT ) ;
public class UCharacterUtility { /** * Determines if codepoint is a non character * @ param ch codepoint * @ return true if codepoint is a non character false otherwise */ public static boolean isNonCharacter ( int ch ) { } }
if ( ( ch & NON_CHARACTER_SUFFIX_MIN_3_0_ ) == NON_CHARACTER_SUFFIX_MIN_3_0_ ) { return true ; } return ch >= NON_CHARACTER_MIN_3_1_ && ch <= NON_CHARACTER_MAX_3_1_ ;
public class NodeSet { /** * Tests whether the selector string matches the item , in three possible ways : first , if the selector looks like : * " / . . . / " then it the outer ' / ' chars are removed and it is treated as a regular expression * only * and * PatternSyntaxExceptions are not caught . Otherwise , it i...
// see if inputSelector is wrapped in ' / ' chars String testregex = inputSelector ; if ( testregex . length ( ) >= 2 && testregex . indexOf ( '/' ) == 0 && testregex . lastIndexOf ( '/' ) == testregex . length ( ) - 1 ) { testregex = inputSelector . substring ( 1 , inputSelector . length ( ) - 1 ) ; return item . matc...
public class IMatrix { /** * Multiplikation from two matrices */ public IMatrix mul ( IMatrix b ) { } }
IMatrix result = new IMatrix ( rows , columns ) ; mul ( b , result ) ; return result ;
public class BlockBasedDataStore { /** * ( non - Javadoc ) * @ see net . timewalker . ffmq4 . storage . data . impl . AbstractBlockBasedDataStore # writeAllocationBlock ( int ) */ @ Override protected void writeAllocationBlock ( int blockIndex ) throws DataStoreException { } }
byte [ ] allocationBlock = serializeAllocationBlock ( blockIndex ) ; try { allocationTableRandomAccessFile . seek ( AT_HEADER_SIZE + blockIndex * AT_BLOCK_SIZE ) ; allocationTableRandomAccessFile . write ( allocationBlock ) ; } catch ( IOException e ) { throw new DataStoreException ( "Cannot write to allocation table f...
public class SQLParserEngine { /** * Parse SQL to abstract syntax tree . * @ return abstract syntax tree of SQL */ public SQLAST parse ( ) { } }
ParseTree parseTree = SQLParserFactory . newInstance ( databaseType , sql ) . execute ( ) . getChild ( 0 ) ; if ( parseTree instanceof ErrorNode ) { throw new SQLParsingUnsupportedException ( String . format ( "Unsupported SQL of `%s`" , sql ) ) ; } Optional < SQLStatementRule > sqlStatementRule = parsingRuleRegistry ....
public class GeometryUtils { /** * Calculate the surface tangent for the three supplied vertices and UV coordinates and store the result in < code > dest < / code > . * @ param v1 * XYZ of first vertex * @ param uv1 * UV of first vertex * @ param v2 * XYZ of second vertex * @ param uv2 * UV of second ve...
float DeltaV1 = uv2 . y ( ) - uv1 . y ( ) ; float DeltaV2 = uv3 . y ( ) - uv1 . y ( ) ; float f = 1.0f / ( ( uv2 . x ( ) - uv1 . x ( ) ) * DeltaV2 - ( uv3 . x ( ) - uv1 . x ( ) ) * DeltaV1 ) ; dest . x = f * ( DeltaV2 * ( v2 . x ( ) - v1 . x ( ) ) - DeltaV1 * ( v3 . x ( ) - v1 . x ( ) ) ) ; dest . y = f * ( DeltaV2 * (...
public class NodeUtil { /** * Records a mapping of names to vars of everything reachable in a function . Should only be called * with a function scope . Does not enter new control flow areas aka embedded functions . * @ param nameVarMap an empty map that gets populated with the keys being variable names and * val...
checkState ( nameVarMap . isEmpty ( ) ) ; checkState ( orderedVars . isEmpty ( ) ) ; checkState ( scope . isFunctionScope ( ) , scope ) ; ScopedCallback finder = new ScopedCallback ( ) { @ Override public void enterScope ( NodeTraversal t ) { Scope currentScope = t . getScope ( ) ; for ( Var v : currentScope . getVarIt...
public class CreateDeploymentGroupRequest { /** * The target Amazon ECS services in the deployment group . This applies only to deployment groups that use the * Amazon ECS compute platform . A target Amazon ECS service is specified as an Amazon ECS cluster and service name * pair using the format < code > & lt ; cl...
if ( ecsServices == null ) { ecsServices = new com . amazonaws . internal . SdkInternalList < ECSService > ( ) ; } return ecsServices ;
public class SpotFleetRequestConfigData { /** * The launch template and overrides . If you specify < code > LaunchTemplateConfigs < / code > , you can ' t specify * < code > LaunchSpecifications < / code > . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # s...
if ( this . launchTemplateConfigs == null ) { setLaunchTemplateConfigs ( new com . amazonaws . internal . SdkInternalList < LaunchTemplateConfig > ( launchTemplateConfigs . length ) ) ; } for ( LaunchTemplateConfig ele : launchTemplateConfigs ) { this . launchTemplateConfigs . add ( ele ) ; } return this ;
public class AcidicGroupCountDescriptor { /** * { @ inheritDoc } */ @ Override public Object getParameterType ( String name ) { } }
Object object = null ; if ( name . equals ( "checkAromaticity" ) ) object = true ; return ( object ) ;
public class PasswordPolicyService { /** * Returns the age of the given user ' s password , in days . The age of a * user ' s password is the amount of time elapsed since the password was last * changed or reset . * @ param user * The user to calculate the password age of . * @ return * The age of the given...
// If no password was set , then no time has elapsed PasswordRecordModel passwordRecord = user . getPasswordRecord ( ) ; if ( passwordRecord == null ) return 0 ; // Pull both current time and the time the password was last reset long currentTime = System . currentTimeMillis ( ) ; long lastResetTime = passwordRecord . g...
public class DogmaApi { /** * Get dynamic item information Returns info about a dynamic item resulting * from mutation with a mutaplasmid . - - - This route expires daily at 11:05 * @ param itemId * item _ id integer ( required ) * @ param typeId * type _ id integer ( required ) * @ param datasource * The...
com . squareup . okhttp . Call call = getDogmaDynamicItemsTypeIdItemIdValidateBeforeCall ( itemId , typeId , datasource , ifNoneMatch , null ) ; Type localVarReturnType = new TypeToken < DogmaDynamicItemsResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class RobotMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Robot robot , ProtocolMarshaller protocolMarshaller ) { } }
if ( robot == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( robot . getArn ( ) , ARN_BINDING ) ; protocolMarshaller . marshall ( robot . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( robot . getFleetArn ( ) , FLEETARN_BIND...
public class VcfWriter { /** * Write VCF column header with the specified print writer . * @ param samples zero or more VCF samples , must not be null * @ param writer print writer to write VCF with , must not be null */ public static void writeColumnHeader ( final List < VcfSample > samples , final PrintWriter wri...
checkNotNull ( samples ) ; checkNotNull ( writer ) ; StringBuilder sb = new StringBuilder ( "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO" ) ; if ( ! samples . isEmpty ( ) ) { sb . append ( "\tFORMAT" ) ; } for ( VcfSample sample : samples ) { sb . append ( "\t" ) ; sb . append ( sample . getId ( ) ) ; } writer . prin...
public class SettingsBean { /** * helper methods used in Spring xml files with SpEL */ public String getMailServerIp ( ) { } }
Settings settings = getSettings ( ) ; if ( settings . getMailServer ( ) == null ) { return "127.0.0.1" ; } return settings . getMailServer ( ) . getIp ( ) ;
public class Types { /** * Resolve the given base type and its members . * @ param type * the base type to resolve * @ param typeParameters * the type parameters * @ return * resolve type instance */ @ NonNull public static ResolvedTypeWithMembers resolveMembers ( @ NonNull Type type , @ NonNull Type ... ty...
ResolvedType rt = typeResolver . resolve ( type , typeParameters ) ; return memberResolver . resolve ( rt , null , null ) ;
public class TimeSpan { /** * Returns { @ code true } if the end date occurs after the start date during * the period of time represented by this time span . */ public boolean insideRange ( long startDate , long endDate ) { } }
Calendar c1 = Calendar . getInstance ( ) ; Calendar c2 = Calendar . getInstance ( ) ; c1 . setTimeInMillis ( startDate ) ; c2 . setTimeInMillis ( endDate ) ; return isInRange ( c1 , c2 ) ;
public class Postcard { /** * Inserts an int value into the mapping of this Bundle , replacing * any existing value for the given key . * @ param key a String , or null * @ param value an int * @ return current */ public Postcard withInt ( @ Nullable String key , int value ) { } }
mBundle . putInt ( key , value ) ; return this ;
public class Messages { /** * Wait for a specific message . * Returns as soon as an message matching the specified search criteria is found . * @ param server The identifier of the server hosting the message . * @ param criteria The search criteria to use in order to find a match . * @ throws MailosaurException...
HashMap < String , String > query = new HashMap < String , String > ( ) ; query . put ( "server" , server ) ; return client . request ( "POST" , "api/messages/await" , criteria , query ) . parseAs ( Message . class ) ;
public class QrHelperFunctions_DSCC { /** * Performs a rank - 1 update operation on the submatrix specified by V with the multiply on the right . < br > * < br > * C = ( I - & gamma ; * v * v < sup > T < / sup > ) * A < br > * The order that matrix multiplies are performed has been carefully selected * to minim...
if ( V . numRows != A . numRows ) throw new IllegalArgumentException ( "Number of rows in V and A must match" ) ; C . nz_length = 0 ; C . numRows = V . numRows ; C . numCols = 0 ; for ( int i = 0 ; i < A . numCols ; i ++ ) { double tau = CommonOps_DSCC . dotInnerColumns ( V , colV , A , i , gw , gx ) ; ImplCommonOps_DS...
public class LocalSymbolTable { /** * NOT SYNCHRONIZED ! Call within constructor or from synch ' d method . */ int putSymbol ( String symbolName ) { } }
if ( isReadOnly ) { throw new ReadOnlyValueException ( SymbolTable . class ) ; } if ( mySymbolsCount == mySymbolNames . length ) { int newlen = mySymbolsCount * 2 ; if ( newlen < DEFAULT_CAPACITY ) { newlen = DEFAULT_CAPACITY ; } String [ ] temp = new String [ newlen ] ; System . arraycopy ( mySymbolNames , 0 , temp , ...