signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ZonedDateTime { /** * Returns a copy of this date - time with the specified amount subtracted . * This returns a { @ code ZonedDateTime } , based on this one , with the specified amount subtracted . * The amount is typically { @ link Period } or { @ link Duration } but may be * any other type impleme...
if ( amountToSubtract instanceof Period ) { Period periodToSubtract = ( Period ) amountToSubtract ; return resolveLocal ( dateTime . minus ( periodToSubtract ) ) ; } Objects . requireNonNull ( amountToSubtract , "amountToSubtract" ) ; return ( ZonedDateTime ) amountToSubtract . subtractFrom ( this ) ;
public class Security { /** * Returns true if the given provider satisfies * the selection criterion key : value . */ private static boolean isCriterionSatisfied ( Provider prov , String serviceName , String algName , String attrName , String filterValue ) { } }
String key = serviceName + '.' + algName ; if ( attrName != null ) { key += ' ' + attrName ; } // Check whether the provider has a property // whose key is the same as the given key . String propValue = getProviderProperty ( key , prov ) ; if ( propValue == null ) { // Check whether we have an alias instead // of a sta...
public class BigtableAdmin { /** * { @ inheritDoc } */ @ Override public void snapshot ( SnapshotDescription snapshot ) throws IOException , SnapshotCreationException , IllegalArgumentException { } }
Objects . requireNonNull ( snapshot ) ; snapshot ( snapshot . getName ( ) , snapshot . getTableName ( ) ) ;
public class XIfExpressionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public NotificationChain basicSetElse ( XExpression newElse , NotificationChain msgs ) { } }
XExpression oldElse = else_ ; else_ = newElse ; if ( eNotificationRequired ( ) ) { ENotificationImpl notification = new ENotificationImpl ( this , Notification . SET , XbasePackage . XIF_EXPRESSION__ELSE , oldElse , newElse ) ; if ( msgs == null ) msgs = notification ; else msgs . add ( notification ) ; } return msgs ;
public class VortexAggregateFuture { /** * Gets the inputs on Tasklet aggregation completion . */ private List < TInput > getInputs ( final List < Integer > taskletIds ) { } }
final List < TInput > inputList = new ArrayList < > ( taskletIds . size ( ) ) ; for ( final int taskletId : taskletIds ) { inputList . add ( taskletIdInputMap . get ( taskletId ) ) ; } return inputList ;
public class SessionBuilder { /** * Adds a custom filter to include / exclude nodes for a particular execution profile . This assumes * that you ' re also using a dedicated load balancing policy for that profile . * < p > The predicate ' s { @ link Predicate # test ( Object ) test ( ) } method will be invoked each ...
this . nodeFilters . put ( profileName , nodeFilter ) ; return self ;
public class aaagroup_auditnslogpolicy_binding { /** * Use this API to fetch filtered set of aaagroup _ auditnslogpolicy _ binding resources . * filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */ public static aaagroup_auditnslogpolicy_binding [ ] get_filtered ( nitro_service servic...
aaagroup_auditnslogpolicy_binding obj = new aaagroup_auditnslogpolicy_binding ( ) ; obj . set_groupname ( groupname ) ; options option = new options ( ) ; option . set_filter ( filter ) ; aaagroup_auditnslogpolicy_binding [ ] response = ( aaagroup_auditnslogpolicy_binding [ ] ) obj . getfiltered ( service , option ) ; ...
public class Response { /** * Get response data as stream . * @ return the response data as a stream */ public InputStream getStream ( ) { } }
if ( stream != null ) { return stream ; } try { return new ByteArrayInputStream ( content . getBytes ( "utf-8" ) ) ; } catch ( final UnsupportedEncodingException e ) { throw new ApiException ( "UTF-8 encoding not supported" , e ) ; }
public class DocWorkUnit { /** * Get the CommandLineProgramGroup object from the CommandLineProgramProperties of this work unit . * @ return CommandLineProgramGroup if the feature has one , otherwise null . */ public CommandLineProgramGroup getCommandLineProgramGroup ( ) { } }
if ( commandLineProperties != null ) { try { return commandLineProperties . programGroup ( ) . newInstance ( ) ; } catch ( IllegalAccessException | InstantiationException e ) { logger . warn ( String . format ( "Can't instantiate program group class to retrieve summary for group %s for class %s" , commandLineProperties...
public class JUnit38ClassRunner { /** * Get the annotations associated with given TestCase . * @ param test the TestCase . */ private static Annotation [ ] getAnnotations ( TestCase test ) { } }
try { Method m = test . getClass ( ) . getMethod ( test . getName ( ) ) ; return m . getDeclaredAnnotations ( ) ; } catch ( SecurityException e ) { } catch ( NoSuchMethodException e ) { } return new Annotation [ 0 ] ;
public class Utils { /** * Appends to a given StringBuilder the given indents depending on the indent level . * @ param sb StringBuilder to write in . * @ param indent The number ( level ) of indents . */ private static final void indent ( final StringBuilder sb , final int indent ) { } }
for ( int i = 0 ; i < indent ; i ++ ) { sb . append ( LOG_OUT_INDENT ) ; }
public class Insert { /** * Add all tables of the type to the expressions , because for the type an * insert must be made for all tables ! ! ! */ private void addTables ( ) { } }
for ( final SQLTable table : getType ( ) . getTables ( ) ) { if ( ! getTable2values ( ) . containsKey ( table ) ) { getTable2values ( ) . put ( table , new ArrayList < Value > ( ) ) ; } }
public class XStreamFactory { /** * Create XStream for query and report load / save . * @ return XStream */ public static XStream createXStream ( ) { } }
XStream xstream = new XStream ( new DomDriver ( "UTF-8" ) ) ; xstream . setMode ( XStream . NO_REFERENCES ) ; xstream . registerConverter ( new FontConverter ( ) ) ; xstream . alias ( "report" , Report . class ) ; xstream . alias ( "chart" , Chart . class ) ; xstream . useAttributeFor ( Report . class , "version" ) ; x...
public class ThriftConnectionPool { /** * 检查连接分区的连接数量 < br > * 如果连接数量不足则向事件队列中添加新的创建连接信号 * @ param connectionPartition * 需要检测的连接分区 */ protected void maybeSignalForMoreConnections ( ThriftConnectionPartition < T > connectionPartition ) { } }
if ( ! connectionPartition . isUnableToCreateMoreTransactions ( ) && ! this . poolShuttingDown && connectionPartition . getAvailableConnections ( ) * 100 / connectionPartition . getMaxConnections ( ) <= this . poolAvailabilityThreshold ) { connectionPartition . getPoolWatchThreadSignalQueue ( ) . offer ( new Object ( )...
public class DevicesInner { /** * Gets the network settings of the specified data box edge / gateway device . * @ param deviceName The device name . * @ param resourceGroupName The resource group name . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown...
return getNetworkSettingsWithServiceResponseAsync ( deviceName , resourceGroupName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class AttributeLocalizedContentUrl { /** * Get Resource Url for UpdateLocalizedContents * @ param attributeFQN Fully qualified name for an attribute . * @ return String Resource Url */ public static MozuUrl updateLocalizedContentsUrl ( String attributeFQN ) { } }
UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/attributedefinition/attributes/{attributeFQN}/LocalizedContent" ) ; formatter . formatUrl ( "attributeFQN" , attributeFQN ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ;
public class MonitoringBaseAspect { protected Object doProfiling ( ProceedingJoinPoint pjp , String aProducerId , String aSubsystem , String aCategory ) throws Throwable { } }
// check if kill switch is active , return if so . if ( moskitoConfiguration . getKillSwitch ( ) . disableMetricCollection ( ) ) return pjp . proceed ( ) ; // check if this a synthetic method like a switch or lambda method . if ( ( ( MethodSignature ) pjp . getSignature ( ) ) . getMethod ( ) . isSynthetic ( ) ) return ...
public class SimpleSipServlet { /** * { @ inheritDoc } */ protected void doResponse ( SipServletResponse response ) throws ServletException , IOException { } }
if ( logger . isInfoEnabled ( ) ) { logger . info ( "SimpleProxyServlet: Got response:\n" + response ) ; } if ( SipServletResponse . SC_OK == response . getStatus ( ) && "BYE" . equalsIgnoreCase ( response . getMethod ( ) ) ) { SipApplicationSession sipApplicationSession = response . getApplicationSession ( false ) ; i...
public class SOM { /** * Returns the cluster labels for each neuron . If the neurons have * not been clustered , throws an Illegal State Exception . */ public int [ ] [ ] getClusterLabel ( ) { } }
if ( y == null ) { throw new IllegalStateException ( "Neuron cluster labels are not available. Call partition() first." ) ; } int [ ] [ ] clusterLabels = new int [ height ] [ width ] ; for ( int i = 0 , l = 0 ; i < height ; i ++ ) { for ( int j = 0 ; j < width ; j ++ ) { clusterLabels [ i ] [ j ] = y [ i * width + j ] ...
public class LogServiceImpl { /** * ( non - Javadoc ) * @ see org . osgi . service . log . LogService # log ( org . osgi . framework . ServiceReference , int , java . lang . String , * java . lang . Throwable ) */ public void log ( ServiceReference sr , int level , String message , Throwable exception ) { } }
switch ( level ) { case LOG_DEBUG : if ( delegate . isDebugEnabled ( ) ) { delegate . debug ( createMessage ( sr , message ) , exception ) ; } break ; case LOG_ERROR : if ( delegate . isErrorEnabled ( ) ) { delegate . error ( createMessage ( sr , message ) , exception ) ; } break ; case LOG_INFO : if ( delegate . isInf...
public class FctBnProcessors { /** * < p > Lazy get PrcAbout . < / p > * @ param pAddParam additional param * @ return requested PrcAbout * @ throws Exception - an exception */ protected final PrcAbout < RS > lazyGetPrcAbout ( final Map < String , Object > pAddParam ) throws Exception { } }
@ SuppressWarnings ( "unchecked" ) PrcAbout < RS > proc = ( PrcAbout < RS > ) this . processorsMap . get ( PrcAbout . class . getSimpleName ( ) ) ; if ( proc == null ) { proc = new PrcAbout < RS > ( ) ; proc . setSrvOrm ( getSrvOrm ( ) ) ; // assigning fully initialized object : this . processorsMap . put ( PrcAbout . ...
public class CommerceDiscountPersistenceImpl { /** * Returns an ordered range of all the commerce discounts where expirationDate & lt ; & # 63 ; and status = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / co...
return findByLtE_S ( expirationDate , status , start , end , orderByComparator , true ) ;
public class TelURLImpl { /** * { @ inheritDoc } */ public void setPhoneNumber ( String number , String phoneContext ) { } }
setPhoneNumber ( number ) ; try { telUrl . setPhoneContext ( phoneContext ) ; } catch ( ParseException ex ) { logger . error ( "Error setting phone number " + number ) ; throw new java . lang . IllegalArgumentException ( "phone number " + number + " is invalid" , ex ) ; }
public class PollCachingESRegistry { /** * Checks the ES store to see if the ' dataVersion ' entry has been updated with a newer * version # . If it has , then we need to invalidate our cache . */ protected void checkCacheVersion ( ) { } }
// Be very aggressive in invalidating the cache . boolean invalidate = true ; try { Get get = new Get . Builder ( getDefaultIndexName ( ) , "instance" ) . type ( "dataVersion" ) . build ( ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ JestResult result = getClient ( ) . execute ( get ) ; if ( result . isSucceeded ( ) )...
public class MethodServices { /** * Get the method on origin class without proxies * @ param cls * @ param methodName * @ param parameterTypes * @ throws NoSuchMethodException * @ return */ public Method getNonProxiedMethod ( Class cls , String methodName , Class < ? > ... parameterTypes ) throws NoSuchMethod...
return cls . getMethod ( methodName , parameterTypes ) ;
public class Strings { /** * Split string using given pairs separator and every pair using pair component separator . Return the list of pair * instances , possible empty if string value is empty . Returns null if string value is null . * Returned pair components are trimmed for spaces . This means that spaces arou...
if ( string == null ) { return null ; } string = string . trim ( ) ; final int length = string . length ( ) ; final List < Pair > list = new ArrayList < Pair > ( ) ; int beginIndex = 0 ; int endIndex = 0 ; while ( endIndex < length ) { if ( string . charAt ( endIndex ) == pairsSeparator ) { if ( endIndex > beginIndex )...
public class ConfigTreeBuilder { /** * Analyze configuration class structure to extract all classes in hierarchy with all custom * interfaces ( ignoring , for example Serializable or something like this ) . * @ param roots all collected types so far * @ param type type to analyze * @ return all collected types ...
roots . add ( type ) ; if ( type == Configuration . class ) { return roots ; } for ( Class iface : type . getInterfaces ( ) ) { if ( isInStopPackage ( iface ) ) { continue ; } roots . add ( iface ) ; } return resolveRootTypes ( roots , type . getSuperclass ( ) ) ;
public class FileGetFromComputeNodeHeaders { /** * Set the time at which the resource was last modified . * @ param lastModified the lastModified value to set * @ return the FileGetFromComputeNodeHeaders object itself . */ public FileGetFromComputeNodeHeaders withLastModified ( DateTime lastModified ) { } }
if ( lastModified == null ) { this . lastModified = null ; } else { this . lastModified = new DateTimeRfc1123 ( lastModified ) ; } return this ;
public class KeyGenerator { /** * Generates a secret key . * @ return the new key */ public final SecretKey generateKey ( ) { } }
if ( serviceIterator == null ) { return spi . engineGenerateKey ( ) ; } RuntimeException failure = null ; KeyGeneratorSpi mySpi = spi ; do { try { return mySpi . engineGenerateKey ( ) ; } catch ( RuntimeException e ) { if ( failure == null ) { failure = e ; } mySpi = nextSpi ( mySpi , true ) ; } } while ( mySpi != null...
public class ParseLocalTime { /** * { @ inheritDoc } */ @ Override protected LocalTime parse ( final String string , final DateTimeFormatter formatter ) { } }
return LocalTime . parse ( string , formatter ) ;
public class MethodHandle { /** * Creates a method handle representation of the given method for an explicit special method invocation of an otherwise virtual method . * @ param method The method ro represent . * @ param type The type on which the method is to be invoked on as a special method invocation . * @ re...
return ofSpecial ( new MethodDescription . ForLoadedMethod ( method ) , TypeDescription . ForLoadedType . of ( type ) ) ;
public class MetricMonitorService { /** * Gets the monitor id for this metric * @ param identity The metric identity * @ return The monitor id ( optional ) * @ throws IOException * @ throws HttpException */ private int getMetricInfo ( final MetricIdentity identity , final AppIdentity appIdentity ) throws IOExce...
Preconditions . checkNotNull ( identity ) ; Preconditions . checkNotNull ( appIdentity ) ; // build the json objects JsonGetMetricInfoRequest . Builder requestBuilder = JsonGetMetricInfoRequest . newBuilder ( ) ; requestBuilder . category ( identity . getCategory ( ) ) ; requestBuilder . metricName ( identity . getName...
public class MapConfig { /** * Enable de - serialized value caching when evaluating predicates . It has no effect when { @ link InMemoryFormat } * is { @ link InMemoryFormat # OBJECT } or when { @ link com . hazelcast . nio . serialization . Portable } serialization is used . * @ param optimizeQueries { @ code true...
validateSetOptimizeQueriesOption ( optimizeQueries ) ; if ( optimizeQueries ) { this . cacheDeserializedValues = CacheDeserializedValues . ALWAYS ; } // this is used to remember the method has been called explicitly this . optimizeQueryExplicitlyInvoked = true ; return this ;
public class CommerceNotificationTemplatePersistenceImpl { /** * Returns the commerce notification templates before and after the current commerce notification template in the ordered set where groupId = & # 63 ; and enabled = & # 63 ; . * @ param commerceNotificationTemplateId the primary key of the current commerce...
CommerceNotificationTemplate commerceNotificationTemplate = findByPrimaryKey ( commerceNotificationTemplateId ) ; Session session = null ; try { session = openSession ( ) ; CommerceNotificationTemplate [ ] array = new CommerceNotificationTemplateImpl [ 3 ] ; array [ 0 ] = getByG_E_PrevAndNext ( session , commerceNotifi...
public class CheckSignatureAdapter { /** * method signatures */ @ Override public SignatureVisitor visitParameterType ( ) { } }
if ( type != METHOD_SIGNATURE || ( state & ( EMPTY | FORMAL | BOUND | PARAM ) ) == 0 ) { throw new IllegalArgumentException ( ) ; } state = PARAM ; SignatureVisitor v = sv == null ? null : sv . visitParameterType ( ) ; return new CheckSignatureAdapter ( TYPE_SIGNATURE , v ) ;
public class A_CmsSerialDateValue { /** * Set dates where the event should not take place , even if they are part of the series . * @ param dates dates to set . */ public final void setExceptions ( SortedSet < Date > dates ) { } }
m_exceptions . clear ( ) ; if ( null != dates ) { m_exceptions . addAll ( dates ) ; }
public class ImageImpl { /** * Notifies this image that its implementation bitmap failed to load . * This can be called from any thread . */ public synchronized void fail ( Throwable error ) { } }
if ( pixelWidth == 0 ) pixelWidth = 50 ; if ( pixelHeight == 0 ) pixelHeight = 50 ; setBitmap ( createErrorBitmap ( pixelWidth , pixelHeight ) ) ; ( ( RPromise < Image > ) state ) . fail ( error ) ; // state is a deferred promise
public class CmsPreferences { /** * Gets the site select options . < p > * @ return the site select options */ public SelectOptions getSiteSelectOptions ( ) { } }
return getSiteSelectOptionsStatic ( getCms ( ) , CmsWorkplace . getStartSiteRoot ( getCms ( ) , m_userSettings ) , getSettings ( ) . getUserSettings ( ) . getLocale ( ) ) ;
public class DynamicConfigManager { /** * < p > Method to dynamically refresh the configuration of all destinations * currently known about on this messaging engine . This includes localised * destinations , as if its only the destination definition thats changed , * the admin code does not notify message process...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "refreshDestinations" ) ; DestinationTypeFilter filter = new DestinationTypeFilter ( ) ; // this filter should only let through Active , CleanupPending and CleanupDefered filter . VISIBLE = Boolean . TRUE ; filter . CORRUPT ...
public class EncryptedPrivateKeyReader { /** * Reads from the given { @ link File } that contains the password protected { @ link KeyPair } and * returns it * @ param encryptedPrivateKeyFile * the file that contains the password protected { @ link KeyPair } * @ param password * the password * @ return the k...
PEMParser pemParser = new PEMParser ( new FileReader ( encryptedPrivateKeyFile ) ) ; Object pemObject = pemParser . readObject ( ) ; pemParser . close ( ) ; JcaPEMKeyConverter keyConverter = new JcaPEMKeyConverter ( ) . setProvider ( SecurityProvider . BC . name ( ) ) ; KeyPair keyPair ; if ( pemObject instanceof PEMEn...
public class ValidDBInstanceModificationsMessage { /** * Valid storage options for your DB instance . * @ return Valid storage options for your DB instance . */ public java . util . List < ValidStorageOptions > getStorage ( ) { } }
if ( storage == null ) { storage = new com . amazonaws . internal . SdkInternalList < ValidStorageOptions > ( ) ; } return storage ;
public class SearchArtistsRequest { /** * Search for artists . * @ return An { @ link Artist } paging . * @ throws IOException In case of networking issues . * @ throws SpotifyWebApiException The Web API returned an error further specified in this exception ' s root cause . */ @ SuppressWarnings ( "unchecked" ) p...
return new Artist . JsonUtil ( ) . createModelObjectPaging ( getJson ( ) , "artists" ) ;
public class Collectors { /** * Use occurrences to save the count of largest objects if { @ code areAllLargestSame = true } ( e . g . { @ code Number / String / . . . } ) and return a list by repeat the largest object { @ code n } times . * @ param areAllLargestSame * @ return * @ see Collectors # maxAll ( Compar...
return maxAll ( Integer . MAX_VALUE , areAllLargestSame ) ;
public class MessageDigest { /** * Returns a MessageDigest object that implements the specified digest * algorithm . * < p > This method traverses the list of registered security Providers , * starting with the most preferred Provider . * A new MessageDigest object encapsulating the * MessageDigestSpi impleme...
try { MessageDigest md ; Object [ ] objs = Security . getImpl ( algorithm , "MessageDigest" , ( String ) null ) ; if ( objs [ 0 ] instanceof MessageDigest ) { md = ( MessageDigest ) objs [ 0 ] ; } else { md = new Delegate ( ( MessageDigestSpi ) objs [ 0 ] , algorithm ) ; } md . provider = ( Provider ) objs [ 1 ] ; /* A...
public class DataBinder { /** * Puts a new string value into this binder , but using an alternative value if the given one is null . */ public String put ( String name , String value , String alternative ) { } }
return put ( name , value != null ? value : alternative ) ;
public class VulnerableSoftwareBuilder { /** * Adds a base CPE object to build a vulnerable software object from . * @ param cpe the base CPE * @ return a reference to the builder */ public VulnerableSoftwareBuilder cpe ( Cpe cpe ) { } }
this . part ( cpe . getPart ( ) ) . wfVendor ( cpe . getWellFormedVendor ( ) ) . wfProduct ( cpe . getWellFormedProduct ( ) ) . wfVersion ( cpe . getWellFormedVersion ( ) ) . wfUpdate ( cpe . getWellFormedUpdate ( ) ) . wfEdition ( cpe . getWellFormedEdition ( ) ) . wfLanguage ( cpe . getWellFormedLanguage ( ) ) . wfSw...
public class Model { /** * < p > withUpdater . < / p > * @ param sql a { @ link java . lang . String } object . * @ return a { @ link ameba . db . model . Updater } object . * @ since 0.1.6e * @ param < M > a M object . */ public static < M extends Model > Updater < M > withUpdater ( String sql ) { } }
return withUpdater ( DataSourceManager . getDefaultDataSourceName ( ) , sql ) ;
public class Stopwatch { /** * Stops the stopwatch . Future reads will return the fixed duration that had * elapsed up to this point . * @ return this { @ code Stopwatch } instance * @ throws IllegalStateException if the stopwatch is already stopped . */ public Stopwatch stop ( ) { } }
long tick = System . nanoTime ( ) ; isRunning = false ; elapsedNanos += tick - startTick ; return this ;
public class NumberValidateRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( NumberValidateRequest numberValidateRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( numberValidateRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( numberValidateRequest . getIsoCountryCode ( ) , ISOCOUNTRYCODE_BINDING ) ; protocolMarshaller . marshall ( numberValidateRequest . getPhoneNumber ( ) , PHONENUMBER...
public class KeyVaultClientBaseImpl { /** * Updates the policy for a certificate . * Set specified members in the certificate policy . Leave others as null . This operation requires the certificates / update permission . * @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net ....
return updateCertificatePolicyWithServiceResponseAsync ( vaultBaseUrl , certificateName , certificatePolicy ) . map ( new Func1 < ServiceResponse < CertificatePolicy > , CertificatePolicy > ( ) { @ Override public CertificatePolicy call ( ServiceResponse < CertificatePolicy > response ) { return response . body ( ) ; }...
public class Pattern { /** * Appends a new group pattern to the existing one . The new pattern enforces strict * temporal contiguity . This means that the whole pattern sequence matches only * if an event which matches this pattern directly follows the preceding matching * event . Thus , there cannot be any event...
return new GroupPattern < > ( this , group , ConsumingStrategy . STRICT , afterMatchSkipStrategy ) ;
public class OQueryDataProvider { /** * Set value for named parameter * @ param paramName name of the parameter to set * @ param value { @ link IModel } for the parameter value * @ return this { @ link OQueryDataProvider } */ public OQueryDataProvider < K > setParameter ( String paramName , IModel < ? > value ) {...
model . setParameter ( paramName , value ) ; return this ;
public class JobChange { /** * Processes the specified JobChange data file obtained from Webphone . Each line is * read and processed and any fallout is written to the specified fallout file . * If fallout file already exists it is deleted and a new one is created . A * comparison of the supervisor id in the job ...
BufferedWriter writer = null ; try { env . info ( ) . log ( "Reading file: " + fileName ) ; FileInputStream fstream = new FileInputStream ( fileName ) ; BufferedReader br = new BufferedReader ( new InputStreamReader ( fstream ) ) ; String strLine ; while ( ( strLine = br . readLine ( ) ) != null ) { processLine ( strLi...
public class ClassSelector { /** * Exclude properties from the result map . */ public ClassSelector except ( String ... propertyNames ) { } }
if ( ArrayUtils . isEmpty ( propertyNames ) ) { return this ; } boolean updated = false ; for ( String propertyToRemove : propertyNames ) { if ( removePropertySelector ( propertyToRemove ) ) { updated = true ; } } if ( updated ) { compositeSelector = new CompositeSelector ( this . propertySelectors ) ; } return this ;
public class EMRepository { /** * Retrieves EM * @ param sessionToken * @ return */ public EntityManager getEM ( String sessionToken ) { } }
if ( emMap == null ) { return null ; } else { return emMap . get ( sessionToken ) ; }
public class SearchBuilder { /** * Figures out the tolerance for a search . For example , if the user is searching for < code > 4.00 < / code > , this method * returns < code > 0.005 < / code > because we shold actually match values which are * < code > 4 ( + / - ) 0.005 < / code > according to the FHIR specs . */ ...
if ( cmpValue == ParamPrefixEnum . APPROXIMATE ) { return theValue . multiply ( new BigDecimal ( 0.1 ) ) ; } else { String plainString = theValue . toPlainString ( ) ; int dotIdx = plainString . indexOf ( '.' ) ; if ( dotIdx == - 1 ) { return new BigDecimal ( 0.5 ) ; } int precision = plainString . length ( ) - ( dotId...
public class N { /** * Distinct by the value mapped from < code > keyMapper < / code > . * Mostly it ' s designed for one - step operation to complete the operation in one step . * < code > java . util . stream . Stream < / code > is preferred for multiple phases operation . * @ param a * @ param keyMapper don ...
if ( N . isNullOrEmpty ( a ) ) { return new ArrayList < > ( ) ; } return distinctBy ( a , 0 , a . length , keyMapper ) ;
public class Contracts { /** * check if a string is not empty . * @ param pstring string to check * @ param pmessage error message to throw if test fails */ public static void assertNotEmpty ( final String pstring , final String pmessage ) { } }
if ( pstring == null || pstring . length ( ) == 0 ) { throw new IllegalArgumentException ( pmessage ) ; }
public class ContextItems { /** * Saves a date item object as a context item . * @ param itemName Item name * @ param date Date value */ public void setDate ( String itemName , Date date ) { } }
if ( date == null ) { setItem ( itemName , null ) ; } else { setItem ( itemName , DateUtil . toHL7 ( date ) ) ; }
public class ClassDescriptor { /** * return the FieldDescriptor for the Attribute referenced in the path < br > * the path may contain simple attribut names , functions and path expressions * using relationships < br > * ie : name , avg ( price ) , adress . street * @ param aPath the path to the attribute * @...
ArrayList desc = getAttributeDescriptorsForPath ( aPath , pathHints ) ; FieldDescriptor fld = null ; Object temp ; if ( ! desc . isEmpty ( ) ) { temp = desc . get ( desc . size ( ) - 1 ) ; if ( temp instanceof FieldDescriptor ) { fld = ( FieldDescriptor ) temp ; } } return fld ;
public class Postcard { /** * Set object value , the value will be convert to string by ' Fastjson ' * @ param key a String , or null * @ param value a Object , or null * @ return current */ public Postcard withObject ( @ Nullable String key , @ Nullable Object value ) { } }
serializationService = ARouter . getInstance ( ) . navigation ( SerializationService . class ) ; mBundle . putString ( key , serializationService . object2Json ( value ) ) ; return this ;
public class RingbufferContainer { /** * Convert the supplied argument into serialized format . * @ throws HazelcastSerializationException when serialization fails . */ private Data [ ] convertToData ( T [ ] items ) { } }
if ( items == null || items . length == 0 ) { return new Data [ 0 ] ; } if ( items [ 0 ] instanceof Data ) { return ( Data [ ] ) items ; } final Data [ ] ret = new Data [ items . length ] ; for ( int i = 0 ; i < items . length ; i ++ ) { ret [ i ] = convertToData ( items [ i ] ) ; } return ret ;
public class ValidationSession { /** * Add a setter listener to a field . * @ param object * @ param name * @ param listener */ public void addListener ( ValidationObject object , String name , SetterListener listener ) { } }
m_validationEngine . addListener ( object , name , this , listener ) ;
public class AbstractProgramController { /** * Force this controller into error state . * @ param t The */ protected final < V > void error ( Throwable t , SettableFuture < V > future ) { } }
state . set ( State . ERROR ) ; if ( future != null ) { future . setException ( t ) ; } caller . error ( t ) ;
public class JdbcQueue { /** * Queue a message , retry if deadlock . * Note : http : / / dev . mysql . com / doc / refman / 5.0 / en / innodb - deadlocks . html * InnoDB uses automatic row - level locking . You can get deadlocks even in * the case of transactions that just insert or delete a single row . That is ...
try { Date now = new Date ( ) ; msg . setNumRequeues ( 0 ) . setQueueTimestamp ( now ) . setTimestamp ( now ) ; return putToQueueStorage ( conn , msg ) ; } catch ( DuplicatedValueException dve ) { LOGGER . warn ( dve . getMessage ( ) , dve ) ; return true ; } catch ( DaoException de ) { if ( de . getCause ( ) instanceo...
public class ExtendedTetrahedral { /** * Helper method to locate two terminal atoms in a container for a given * focus . * @ param container structure representation * @ param focus cumulated atom * @ return the terminal atoms ( unordered ) */ public static IAtom [ ] findTerminalAtoms ( IAtomContainer container...
List < IBond > focusBonds = container . getConnectedBondsList ( focus ) ; if ( focusBonds . size ( ) != 2 ) throw new IllegalArgumentException ( "focus must have exactly 2 neighbors" ) ; IAtom leftPrev = focus ; IAtom rightPrev = focus ; IAtom left = focusBonds . get ( 0 ) . getOther ( focus ) ; IAtom right = focusBond...
public class AbstractConnection { /** * Send an exit signal to a remote process . * @ param dest * the Erlang PID of the remote process . * @ param reason * an Erlang term describing the exit reason . * @ exception java . io . IOException * if the connection is not active or a communication error * occurs...
sendExit ( exit2Tag , from , dest , reason ) ;
public class SchemaAnalyzer { /** * - - - - - private static methods - - - - - */ private static String getCombinedType ( final String startNodeType , final String relationshipType , final String endNodeType ) { } }
return startNodeType . concat ( relationshipType ) . concat ( endNodeType ) ;
public class InstallUtil { /** * Save a specific version as the last execute version . * @ param version The version to save . */ static void saveLastExecVersion ( @ Nonnull String version ) { } }
File lastExecVersionFile = getLastExecVersionFile ( ) ; try { FileUtils . write ( lastExecVersionFile , version ) ; } catch ( IOException e ) { LOGGER . log ( SEVERE , "Failed to save " + lastExecVersionFile . getAbsolutePath ( ) , e ) ; }
public class ListStringCreativeTemplateVariable { /** * Sets the choices value for this ListStringCreativeTemplateVariable . * @ param choices * The values within the list users need to select from . */ public void setChoices ( com . google . api . ads . admanager . axis . v201808 . ListStringCreativeTemplateVariable...
this . choices = choices ;
public class DiSH { /** * Computes the hierarchical clusters according to the cluster order . * @ param database the database holding the objects * @ param clusterOrder the cluster order */ private Clustering < SubspaceModel > computeClusters ( Relation < V > database , DiSHClusterOrder clusterOrder ) { } }
final int dimensionality = RelationUtil . dimensionality ( database ) ; // extract clusters Object2ObjectOpenCustomHashMap < long [ ] , List < ArrayModifiableDBIDs > > clustersMap = extractClusters ( database , clusterOrder ) ; logClusterSizes ( "Step 1: extract clusters" , dimensionality , clustersMap ) ; // check if ...
public class VodClient { /** * get media statistic info . * The caller < i > must < / i > authenticate with a valid BCE Access Key / Private Key pair . * @ param startTime , query media start time , default : 2016-04-30T16:00:00Z * @ param endTime , query media end time , default : now * @ param aggregate , if ...
GetMediaStatisticRequest request = new GetMediaStatisticRequest ( ) . withMediaId ( mediaId ) . withStartTime ( startTime ) . withEndTime ( endTime ) . withAggregate ( aggregate ) ; return getMediaStatistic ( request ) ;
public class Util { /** * Unite two sorted lists and write the result to the provided output array * @ param set1 first array * @ param offset1 offset of first array * @ param length1 length of first array * @ param set2 second array * @ param offset2 offset of second array * @ param length2 length of secon...
if ( 0 == length2 ) { System . arraycopy ( set1 , offset1 , buffer , 0 , length1 ) ; return length1 ; } if ( 0 == length1 ) { System . arraycopy ( set2 , offset2 , buffer , 0 , length2 ) ; return length2 ; } int pos = 0 ; int k1 = offset1 , k2 = offset2 ; short s1 = set1 [ k1 ] ; short s2 = set2 [ k2 ] ; while ( true )...
public class PipelineTimeline { private void notifyListeners ( List < PipelineTimelineEntry > newEntries ) { } }
Map < CaseInsensitiveString , PipelineTimelineEntry > pipelineToOldestEntry = new HashMap < > ( ) ; for ( PipelineTimelineEntry challenger : newEntries ) { CaseInsensitiveString pipelineName = new CaseInsensitiveString ( challenger . getPipelineName ( ) ) ; PipelineTimelineEntry champion = pipelineToOldestEntry . get (...
public class URLEncodedUtils { /** * Adds all parameters within the Scanner to the list of * < code > parameters < / code > , as encoded by < code > encoding < / code > . For * example , a scanner containing the string < code > a = 1 & b = 2 & c = 3 < / code > would * add the { @ link NameValuePair NameValuePairs...
scanner . useDelimiter ( PARAMETER_SEPARATOR ) ; while ( scanner . hasNext ( ) ) { String name = null ; String value = null ; String token = scanner . next ( ) ; int i = token . indexOf ( NAME_VALUE_SEPARATOR ) ; if ( i != - 1 ) { name = decodeFormFields ( token . substring ( 0 , i ) . trim ( ) , charset ) ; value = de...
public class MolecularFormulaManipulator { /** * Returns a set of nodes excluding all the hydrogens . * @ param formula The IMolecularFormula * @ return The heavyElements value into a List * @ cdk . keyword hydrogen , removal */ public static List < IElement > getHeavyElements ( IMolecularFormula formula ) { } }
List < IElement > newEle = new ArrayList < IElement > ( ) ; for ( IElement element : elements ( formula ) ) { if ( ! element . getSymbol ( ) . equals ( "H" ) ) { newEle . add ( element ) ; } } return newEle ;
public class DefaultGroovyMethods { /** * Provides an easy way to append multiple Map . Entry values to a Map . * @ param self a Map * @ param entries a Collection of Map . Entry items to be added to the Map . * @ return the same map , after the items have been added to it . * @ since 1.6.1 */ public static < K...
for ( Map . Entry < ? extends K , ? extends V > entry : entries ) { self . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } return self ;
public class AmazonRekognitionClient { /** * Starts asynchronous detection of labels in a stored video . * Amazon Rekognition Video can detect labels in a video . Labels are instances of real - world entities . This includes * objects like flower , tree , and table ; events like wedding , graduation , and birthday ...
request = beforeClientExecution ( request ) ; return executeStartLabelDetection ( request ) ;
public class SharedFileHandler { /** * DoNewRecord Method . */ public void doNewRecord ( boolean bDisplayOption ) { } }
super . doNewRecord ( bDisplayOption ) ; BaseField fldTarget = null ; if ( typeFieldName != null ) fldTarget = this . getOwner ( ) . getField ( typeFieldName ) ; else fldTarget = this . getOwner ( ) . getField ( m_iTypeField ) ; boolean [ ] rgbEnabled = fldTarget . setEnableListeners ( false ) ; InitOnceFieldHandler li...
public class ExternalMergeSort { /** * Performs an external merge on the values in the iterator . * @ param values Iterator containing the data to sort . * @ return an iterator the iterates over the sorted result . * @ throws IOException if something fails when doing I / O . */ public CloseableIterator < T > merg...
ChunkSizeIterator < T > csi = new ChunkSizeIterator < T > ( values , config . chunkSize ) ; if ( csi . isMultipleChunks ( ) ) { List < File > sortedChunks = writeSortedChunks ( csi ) ; return mergeSortedChunks ( sortedChunks ) ; } else { if ( config . distinct ) { SortedSet < T > list = new TreeSet < T > ( comparator )...
public class AES { /** * 解密 */ public static byte [ ] decrypt ( byte [ ] data , byte [ ] key ) throws Exception { } }
// 恢复密钥生成器 SecretKey secretKey = new SecretKeySpec ( key , "AES" ) ; // Cipher完成解密 Cipher cipher = Cipher . getInstance ( "AES" ) ; // 根据密钥对cipher进行初始化 cipher . init ( Cipher . DECRYPT_MODE , secretKey ) ; byte [ ] plain = cipher . doFinal ( data ) ; return plain ;
public class H2DbConfig { /** * H2 console . * @ return / console / * */ @ Bean public ServletRegistrationBean h2servletRegistration ( ) { } }
ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean ( new WebServlet ( ) ) ; servletRegistrationBean . addUrlMappings ( "/h2/*" ) ; return servletRegistrationBean ;
public class DefaultDiskResourceService { /** * { @ inheritDoc } */ @ Override public StateRepository getStateRepositoryWithin ( PersistenceSpaceIdentifier < ? > identifier , String name ) throws CachePersistenceException { } }
PersistenceSpace persistenceSpace = getPersistenceSpace ( identifier ) ; if ( persistenceSpace == null ) { throw newCachePersistenceException ( identifier ) ; } FileBasedStateRepository stateRepository = new FileBasedStateRepository ( FileUtils . createSubDirectory ( persistenceSpace . identifier . persistentSpaceId . ...
public class SQLiteExecutor { /** * Insert one record into database . * To exclude the some properties or default value , invoke { @ code com . landawn . abacus . util . N # entity2Map ( Object , boolean , Collection , NamingPolicy ) } * < p > The target table is identified by the simple class name of the specified...
if ( ! N . isEntity ( entity . getClass ( ) ) ) { throw new IllegalArgumentException ( "The specified parameter must be an entity with getter/setter methods" ) ; } return insert ( getTableNameByEntity ( entity ) , entity ) ;
public class Producer { /** * Shuts down the producer . */ public void shutdown ( ) { } }
if ( _producer != null ) { _producer . close ( ) ; } _executorService . shutdown ( ) ; try { if ( ! _executorService . awaitTermination ( 10 , TimeUnit . SECONDS ) ) { _logger . warn ( "Shutdown of Kafka executor service timed out after 10 seconds." ) ; _executorService . shutdownNow ( ) ; } } catch ( InterruptedExcept...
public class MethodToMarshaller { /** * / * @ Override */ public T marshal ( S object ) { } }
try { final T result = ( T ) marshalHandle . invoke ( object ) ; return result ; } catch ( Throwable ex ) { if ( ex . getCause ( ) instanceof RuntimeException ) { throw ( RuntimeException ) ex . getCause ( ) ; } throw new BindingException ( ex . getMessage ( ) , ex . getCause ( ) ) ; }
public class AdalDeviceCodeAuthorizationGrant { /** * Converts the device code grant to a map of HTTP paramters . * @ return The map with HTTP parameters . */ @ Override public Map < String , List < String > > toParameters ( ) { } }
final Map < String , List < String > > outParams = new LinkedHashMap < > ( ) ; outParams . put ( "resource" , Collections . singletonList ( resource ) ) ; outParams . put ( "grant_type" , Collections . singletonList ( GRANT_TYPE ) ) ; outParams . put ( "code" , Collections . singletonList ( deviceCode . getDeviceCode (...
public class JavaType { /** * Note a gosu class can be BOTH parameterzied AND generic . For example , * class Bar < T > { * function blah ( ) : T { . . . } * class Foo < T extends CharSequence > extends Bar < T > { } * The class Bar < T > here is parameterized by the type var from Foo , yet it is * still a ge...
List < GenericTypeVariable > genTypeVars = new ArrayList < GenericTypeVariable > ( ) ; for ( IType typeParam : typeParams ) { if ( typeParam instanceof TypeVariableType ) { genTypeVars . add ( ( GenericTypeVariable ) ( ( TypeVariableType ) typeParam ) . getTypeVarDef ( ) . getTypeVar ( ) ) ; } } return genTypeVars . to...
public class AuditUtils { /** * Writes the data object as a JSON string . * @ param data */ private static String toJSON ( Object data ) { } }
try { return mapper . writeValueAsString ( data ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class AbstractExpressionGenerator { /** * Compute the simple name for the called feature . * @ param featureCall the feature call . * @ param logicalContainerProvider the provider of logicial container . * @ param featureNameProvider the provider of feature name . * @ param nullKeyword the null - equival...
String name = null ; final JvmIdentifiableElement calledFeature = featureCall . getFeature ( ) ; if ( calledFeature instanceof JvmConstructor ) { final JvmDeclaredType constructorContainer = ( ( JvmConstructor ) calledFeature ) . getDeclaringType ( ) ; final JvmIdentifiableElement logicalContainer = logicalContainerPro...
public class AnimaQuery { /** * Build a update statement . * @ param model model instance * @ param updateColumns update columns * @ param < S > * @ return update sql */ private < S extends Model > String buildUpdateSQL ( S model , Map < String , Object > updateColumns ) { } }
SQLParams sqlParams = SQLParams . builder ( ) . model ( model ) . modelClass ( this . modelClass ) . tableName ( this . tableName ) . pkName ( this . primaryKeyColumn ) . updateColumns ( updateColumns ) . conditionSQL ( this . conditionSQL ) . build ( ) ; return Anima . of ( ) . dialect ( ) . update ( sqlParams ) ;
public class ModelResourceStructure { /** * Find the beans for this beanType . * This can use URL query parameters such as order and maxrows to configure * the query . * @ param includeDeleted a boolean . * @ return a { @ link javax . ws . rs . core . Response } object . * @ throws java . lang . Exception if ...
matchedFind ( includeDeleted ) ; final Query < MODEL > query = server . find ( modelType ) ; if ( includeDeleted ) { query . setIncludeSoftDeletes ( ) ; } defaultFindOrderBy ( query ) ; final Ref < FutureRowCount > rowCount = Refs . emptyRef ( ) ; Object entity = executeTx ( t -> { configDefaultQuery ( query ) ; config...
public class Cached { /** * TODO utilize Segmented Caches , and fold " get " into " reads " */ @ SuppressWarnings ( "unchecked" ) public Result < List < DATA > > get ( TRANS trans , String key , Getter < DATA > getter ) { } }
List < DATA > ld = null ; Result < List < DATA > > rld = null ; int cacheIdx = cacheIdx ( key ) ; Map < String , Dated > map = ( ( Map < String , Dated > ) cache [ cacheIdx ] ) ; // Check for saved element in cache Dated cached = map . get ( key ) ; // Note : These Segment Timestamps are kept up to date with DB Date db...
public class TimeUnitUtility { /** * This method is used to parse a string representation of a time * unit , and return the appropriate constant value . * @ param units string representation of a time unit * @ param locale target locale * @ return numeric constant * @ throws MPXJException normally thrown when...
Map < String , Integer > map = LocaleData . getMap ( locale , LocaleData . TIME_UNITS_MAP ) ; Integer result = map . get ( units . toLowerCase ( ) ) ; if ( result == null ) { throw new MPXJException ( MPXJException . INVALID_TIME_UNIT + " " + units ) ; } return ( TimeUnit . getInstance ( result . intValue ( ) ) ) ;
public class PowerMock { /** * Suppress a specific method call . Use this for overloaded methods . * @ deprecated Use { @ link # suppress ( Method ) } instead . */ @ Deprecated public static synchronized void suppressMethod ( Class < ? > clazz , String methodName , Class < ? > [ ] parameterTypes ) { } }
SuppressCode . suppressMethod ( clazz , methodName , parameterTypes ) ;
public class AbstractAppender { /** * Builds an empty AppendEntries request . * Empty append requests are used as heartbeats to followers . */ protected AppendRequest buildAppendEmptyRequest ( RaftMemberContext member ) { } }
final RaftLogReader reader = member . getLogReader ( ) ; // Read the previous entry from the reader . // The reader can be null for RESERVE members . Indexed < RaftLogEntry > prevEntry = reader != null ? reader . getCurrentEntry ( ) : null ; DefaultRaftMember leader = raft . getLeader ( ) ; return AppendRequest . build...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link TopoPrimitiveArrayAssociationType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link TopoPrimitiveA...
return new JAXBElement < TopoPrimitiveArrayAssociationType > ( _TopoPrimitiveMembers_QNAME , TopoPrimitiveArrayAssociationType . class , null , value ) ;
public class Query { /** * Create a Query for the given Service and Domain . * @ param service service to search for * @ param domain domain to search on * @ return a new Query object */ @ SuppressWarnings ( "unused" ) public static Query createFor ( Service service , Domain domain ) { } }
return new Query ( service , domain , BROWSING_TIMEOUT ) ;
public class JcrSession { /** * Determine if the supplied string represents just the { @ link Node # getIdentifier ( ) node ' s identifier } or whether it is a * string representation of a NodeKey . If it is just the node ' s identifier , then the NodeKey is created by using the same * { @ link NodeKey # getSourceK...
// If this node is a random identifier , then we need to use it as a node key identifier . . . if ( NodeKey . isValidRandomIdentifier ( identifier ) ) { return rootKey . withId ( identifier ) ; } return new NodeKey ( identifier ) ;
public class CollectionUtils { /** * Move an object in List up * @ param list * @ param key * @ param keyMapper * @ return */ public static < T , K > boolean moveUp ( List < T > list , K key , Function < T , K > keyMapper , int n ) { } }
if ( list == null ) return false ; ArrayList < T > newList = new ArrayList < T > ( ) ; boolean changed = false ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { T item = list . get ( i ) ; if ( i > 0 && key . equals ( keyMapper . apply ( item ) ) ) { int posi = i - n ; if ( posi < 0 ) posi = 0 ; newList . add ( posi ,...