signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class IotHubResourcesInner { /** * Get the statistics from an IoT hub . * Get the statistics from an IoT hub . * @ param resourceGroupName The name of the resource group that contains the IoT hub . * @ param resourceName The name of the IoT hub . * @ throws IllegalArgumentException thrown if parameters f...
return getStatsWithServiceResponseAsync ( resourceGroupName , resourceName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class KeyVaultCredentials { /** * Extracts the challenge off the authentication header . * @ param authenticateHeader * the authentication header containing all the challenges . * @ param authChallengePrefix * the authentication challenge name . * @ return a challenge map . */ private static Map < Stri...
if ( ! isValidChallenge ( authenticateHeader , authChallengePrefix ) ) { return null ; } authenticateHeader = authenticateHeader . toLowerCase ( ) . replace ( authChallengePrefix . toLowerCase ( ) , "" ) ; String [ ] challenges = authenticateHeader . split ( ", " ) ; Map < String , String > challengeMap = new HashMap <...
public class PropertiesReader { /** * Loads properties from a properties file on the classpath . */ private static Properties loadPropertiesFromClasspath ( String propertiesFile ) { } }
Properties properties = new Properties ( ) ; try ( InputStream is = Thread . currentThread ( ) . getContextClassLoader ( ) . getResourceAsStream ( propertiesFile ) ) { properties . load ( is ) ; } catch ( IOException e ) { throw new RuntimeException ( "failed to load properties" , e ) ; } return properties ;
public class RsaEncryptedConverter { /** * Decode this array . * @ param rgbValue * @ return * @ throws NoSuchAlgorithmException */ public byte [ ] decodeBytes ( byte [ ] rgbValue ) throws NoSuchAlgorithmException { } }
rgbValue = super . decodeBytes ( rgbValue ) ; // Base64 encoding rgbValue = this . decrypt ( rgbValue ) ; return rgbValue ;
public class ExpressionBuilderFragment { /** * Replies a keyword for declaring a container . * @ param grammarContainer the container description . * @ return the keyword , never < code > null < / code > nor an empty string . */ protected String ensureContainerKeyword ( EObject grammarContainer ) { } }
final Iterator < Keyword > iterator = Iterators . filter ( grammarContainer . eContents ( ) . iterator ( ) , Keyword . class ) ; if ( iterator . hasNext ( ) ) { return iterator . next ( ) . getValue ( ) ; } return getExpressionConfig ( ) . getFieldContainerDeclarationKeyword ( ) ;
public class JSDocInfoBuilder { /** * Records that the { @ link JSDocInfo } being built should have its * { @ link JSDocInfo # isHidden ( ) } flag set to { @ code true } . * @ return { @ code true } if the hiddenness was recorded and { @ code false } * if it was already defined */ public boolean recordHiddenness ...
if ( ! currentInfo . isHidden ( ) ) { currentInfo . setHidden ( true ) ; populated = true ; return true ; } else { return false ; }
public class ObjectType { /** * We treat this as the unknown type if any of its implicit prototype * properties is unknown . */ @ Override public boolean isUnknownType ( ) { } }
// If the object is unknown now , check the supertype again , // because it might have been resolved since the last check . if ( unknown ) { ObjectType implicitProto = getImplicitPrototype ( ) ; if ( implicitProto == null || implicitProto . isNativeObjectType ( ) ) { unknown = false ; for ( ObjectType interfaceType : g...
public class NavMesh { /** * Returns closest point on polygon . * @ param ref * @ param pos * @ return */ float [ ] closestPointOnDetailEdges ( MeshTile tile , Poly poly , float [ ] pos , boolean onlyBoundary ) { } }
int ANY_BOUNDARY_EDGE = ( DT_DETAIL_EDGE_BOUNDARY << 0 ) | ( DT_DETAIL_EDGE_BOUNDARY << 2 ) | ( DT_DETAIL_EDGE_BOUNDARY << 4 ) ; int ip = poly . index ; PolyDetail pd = tile . data . detailMeshes [ ip ] ; float dmin = Float . MAX_VALUE ; float tmin = 0 ; float [ ] pmin = null ; float [ ] pmax = null ; for ( int i = 0 ;...
public class DataSetComparator { /** * - - Private methods */ public void shouldBeEmpty ( IDataSet dataSet , String tableName , AssertionErrorCollector errorCollector ) throws DataSetException { } }
final SortedTable tableState = new SortedTable ( dataSet . getTable ( tableName ) ) ; int rowCount = tableState . getRowCount ( ) ; if ( rowCount != 0 ) { errorCollector . collect ( new AssertionError ( tableName + " expected to be empty, but was <" + rowCount + ">." ) ) ; }
public class WasAssociatedWith { /** * Gets the value of the plan property . * @ return * possible object is * { @ link org . openprovenance . prov . sql . IDRef } */ @ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { } }
CascadeType . ALL } ) @ JoinColumn ( name = "PLAN" ) public org . openprovenance . prov . model . QualifiedName getPlan ( ) { return plan ;
public class PutEventsRequestEntryMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PutEventsRequestEntry putEventsRequestEntry , ProtocolMarshaller protocolMarshaller ) { } }
if ( putEventsRequestEntry == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( putEventsRequestEntry . getTime ( ) , TIME_BINDING ) ; protocolMarshaller . marshall ( putEventsRequestEntry . getSource ( ) , SOURCE_BINDING ) ; protocolMarshalle...
public class JpaControllerManagement { /** * Returns the configured minimum polling interval . * @ return current { @ link TenantConfigurationKey # MIN _ POLLING _ TIME _ INTERVAL } . */ @ Override public String getMinPollingTime ( ) { } }
return systemSecurityContext . runAsSystem ( ( ) -> tenantConfigurationManagement . getConfigurationValue ( TenantConfigurationKey . MIN_POLLING_TIME_INTERVAL , String . class ) . getValue ( ) ) ;
public class ProposalLineItem { /** * Gets the targeting value for this ProposalLineItem . * @ return targeting * Contains the targeting criteria for the { @ code ProposalLineItem } . * This attribute is * optional during creation and defaults to the { @ link * Product # targeting product ' s targeting } . */ p...
return targeting ;
public class RedmineJSONBuilder { /** * Converts object to a " simple " json . * @ param tag * object tag . * @ param object * object to convert . * @ param writer * object writer . * @ return object String representation . * @ throws RedmineInternalError * if conversion fails . */ public static < T >...
final StringWriter swriter = new StringWriter ( ) ; final JSONWriter jsWriter = new JSONWriter ( swriter ) ; try { jsWriter . object ( ) ; jsWriter . key ( tag ) ; jsWriter . object ( ) ; writer . write ( jsWriter , object ) ; jsWriter . endObject ( ) ; jsWriter . endObject ( ) ; } catch ( JSONException e ) { throw new...
public class SkillRequestTimestampVerifier { /** * Validates if the provided date is inclusively within the verifier tolerance , either in the * past or future , of the current system time . This method will throw a { @ link SecurityException } if the * tolerance is not in the expected range , or if the request is ...
if ( deserializedRequestEnvelope == null ) { throw new SecurityException ( "Incoming request did not contain a request envelope" ) ; } Request request = deserializedRequestEnvelope . getRequest ( ) ; if ( request == null || request . getTimestamp ( ) == null ) { throw new SecurityException ( "Incoming request was null ...
public class UserAvatarResolver { /** * Resolve an avatar image URL string for the user . * Note that this method must be called from an HTTP request to be reliable ; else use { @ link # resolveOrNull } . * @ param u user * @ param avatarSize the preferred image size , " [ width ] x [ height ] " * @ return a UR...
String avatar = resolveOrNull ( u , avatarSize ) ; return avatar != null ? avatar : Jenkins . getInstance ( ) . getRootUrl ( ) + Functions . getResourcePath ( ) + "/images/" + avatarSize + "/user.png" ;
public class appfwpolicylabel { /** * Use this API to add appfwpolicylabel . */ public static base_response add ( nitro_service client , appfwpolicylabel resource ) throws Exception { } }
appfwpolicylabel addresource = new appfwpolicylabel ( ) ; addresource . labelname = resource . labelname ; addresource . policylabeltype = resource . policylabeltype ; return addresource . add_resource ( client ) ;
public class MSwingUtilities { /** * Affiche une boîte de dialogue de confirmation . * @ param component Component * @ param message String * @ return boolean */ public static boolean showConfirmation ( Component component , String message ) { } }
return JOptionPane . showConfirmDialog ( SwingUtilities . getWindowAncestor ( component ) , message , UIManager . getString ( "OptionPane.titleText" ) , JOptionPane . OK_OPTION | JOptionPane . CANCEL_OPTION ) == JOptionPane . OK_OPTION ;
public class AnnotatedHttpServiceTypeUtil { /** * Normalizes the specified container { @ link Class } . Throws { @ link IllegalArgumentException } * if it is not able to be normalized . */ static Class < ? > normalizeContainerType ( Class < ? > containerType ) { } }
if ( containerType == Iterable . class || containerType == List . class || containerType == Collection . class ) { return ArrayList . class ; } if ( containerType == Set . class ) { return LinkedHashSet . class ; } if ( List . class . isAssignableFrom ( containerType ) || Set . class . isAssignableFrom ( containerType ...
public class GeneralSettingsPanel { /** * http : / / stackoverflow . com / questions / 252893 / how - do - you - change - the - classpath - within - java */ @ SuppressWarnings ( "unchecked" ) private void addURL ( URL url ) throws Exception { } }
URLClassLoader classLoader = ( URLClassLoader ) ClassLoader . getSystemClassLoader ( ) ; Class clazz = URLClassLoader . class ; Method method = clazz . getDeclaredMethod ( "addURL" , new Class [ ] { URL . class } ) ; method . setAccessible ( true ) ; method . invoke ( classLoader , new Object [ ] { url } ) ;
public class NavMesh { /** * Find the space at a given location * @ param x The x coordinate at which to find the space * @ param y The y coordinate at which to find the space * @ return The space at the given location */ public Space findSpace ( float x , float y ) { } }
for ( int i = 0 ; i < spaces . size ( ) ; i ++ ) { Space space = getSpace ( i ) ; if ( space . contains ( x , y ) ) { return space ; } } return null ;
public class FileUtils { /** * SD is available . * @ return true , otherwise is false . */ public static boolean storageAvailable ( ) { } }
if ( Environment . getExternalStorageState ( ) . equals ( Environment . MEDIA_MOUNTED ) ) { File sd = new File ( Environment . getExternalStorageDirectory ( ) . getAbsolutePath ( ) ) ; return sd . canWrite ( ) ; } else { return false ; }
public class Less { /** * Compile the less data from a string . * @ param baseURL * the baseURL for import of external less data . * @ param lessData * the input less data * @ param compress * true , if the CSS data should be compressed without any extra formating characters . * @ return the resulting les...
return compile ( baseURL , lessData , compress , new ReaderFactory ( ) ) ;
public class ListMultipartUploadsResult { /** * A list of in - progress multipart uploads . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setUploadsList ( java . util . Collection ) } or { @ link # withUploadsList ( java . util . Collection ) } if you want ...
if ( this . uploadsList == null ) { setUploadsList ( new java . util . ArrayList < UploadListElement > ( uploadsList . length ) ) ; } for ( UploadListElement ele : uploadsList ) { this . uploadsList . add ( ele ) ; } return this ;
public class LabeledPoint { /** * get the value of that named property */ @ Override public Object getMember ( String name ) { } }
switch ( name ) { case "getFeatures" : return F_getFeatures ; case "getLabel" : return F_getLabel ; case "parse" : return F_parse ; } return super . getMember ( name ) ;
public class BeanPropertyMap { /** * Returns the property value specified by ' key ' within this map . */ public Object getProperty ( PropertyKey key ) { } }
if ( ! isValidKey ( key ) ) throw new IllegalArgumentException ( "Key " + key + " is not valid for " + getMapClass ( ) ) ; // Check local properties first if ( _properties . containsKey ( key ) ) return _properties . get ( key ) ; // Return the value of the annotation type instance ( if any ) if ( _annot != null ) retu...
public class SQLDatabaseFactory { /** * Open or create a database file , and return a connection to it , optionally backed by a * SQLCipher enabled database . * If the database file does not exist , it will be created , and any intermediate directories * will be created as necessary . * @ param dbFile full file...
Misc . checkNotNull ( dbFile , "dbFile" ) ; File dbDirectory = dbFile . getParentFile ( ) ; if ( ! dbDirectory . mkdirs ( ) ) { logger . info ( String . format ( Locale . ENGLISH , "Did not create directories for path: %s directories may already exist" , dbFile ) ) ; } Misc . checkArgument ( dbDirectory . isDirectory (...
public class MapConverter { /** * getFloat . * @ param data a { @ link java . util . Map } object . * @ param name a { @ link java . lang . String } object . * @ return a { @ link java . lang . Float } object . */ public Float getFloat ( Map < String , Object > data , String name ) { } }
return get ( data , name , Float . class ) ;
public class CSLTool { /** * Sets the name of the output file * @ param outputFile the file name or null if output should be written * to standard out */ @ OptionDesc ( longName = "output" , shortName = "o" , description = "write output to FILE instead of stdout" , argumentName = "FILE" , argumentType = ArgumentTyp...
this . outputFile = outputFile ;
public class SolarTime { /** * / * [ deutsch ] * < p > Berechnet den Moment der h & ouml ; chsten Position der Sonne an der Position dieser Instanz . < / p > * < p > Hinweis : Die Transit - Zeit besagt nicht , ob die Sonne & uuml ; ber oder unter dem Horizont ist . < / p > * @ return noon function applicable on a...
return date -> transitAtNoon ( toLMT ( date ) , this . longitude , this . calculator ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcCoolingTowerType ( ) { } }
if ( ifcCoolingTowerTypeEClass == null ) { ifcCoolingTowerTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 146 ) ; } return ifcCoolingTowerTypeEClass ;
public class DefaultJobLifecycleListenerImpl { /** * { @ inheritDoc } */ @ Override public void onStatusChange ( JobExecutionState state , RunningState previousStatus , RunningState newStatus ) { } }
if ( _log . isPresent ( ) ) { _log . get ( ) . info ( "JobExection status change for " + state . getJobSpec ( ) . toShortString ( ) + ": " + previousStatus + " --> " + newStatus ) ; }
public class ScreenField { /** * Output this screen using HTML . * @ exception DBException File exception . */ public void printScreenFieldData ( ScreenField sField , PrintWriter out , int iPrintOptions ) { } }
this . getScreenFieldView ( ) . printScreenFieldData ( sField , out , iPrintOptions ) ;
public class QrcodeAPI { /** * 创建二维码 * @ param actionName 二维码类型 , QR _ SCENE为临时 , QR _ LIMIT _ SCENE为永久 * @ param sceneId 场景值ID , 临时二维码时为32位非0整型 , 永久二维码时最大值为100000 ( 目前参数只支持1 - - 100000) * @ param sceneStr 场景值ID ( 字符串形式的ID ) , 字符串类型 , 长度限制为1到64 , 仅永久二维码支持此字段 * @ param expireSeconds 该二维码有效时间 , 以秒为单位 。 最大不超过25920...
BeanUtil . requireNonNull ( actionName , "actionName is null" ) ; BeanUtil . requireNonNull ( sceneId , "actionInfo is null" ) ; LOG . debug ( "创建二维码信息....." ) ; QrcodeResponse response = null ; String url = BASE_API_URL + "cgi-bin/qrcode/create?access_token=#" ; Map < String , Object > param = new HashMap < String , O...
public class CommonsMultipartFileParameter { /** * Save an uploaded file as a given destination file . * @ param destFile the destination file * @ param overwrite whether to overwrite if it already exists * @ return a saved file * @ throws IOException if an I / O error has occurred */ @ Override public File sav...
if ( destFile == null ) { throw new IllegalArgumentException ( "destFile can not be null" ) ; } validateFile ( ) ; try { destFile = determineDestinationFile ( destFile , overwrite ) ; fileItem . write ( destFile ) ; } catch ( FileUploadException e ) { throw new IllegalStateException ( e . getMessage ( ) ) ; } catch ( E...
public class VimGenerator2 { /** * Generate the Vim strings of characters . * @ param it the receiver of the generated elements . */ protected void generateStrings ( IStyleAppendable it ) { } }
appendComment ( it , "Strings constants" ) ; // $ NON - NLS - 1 $ appendMatch ( it , "sarlSpecialError" , "\\\\." , true ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ appendMatch ( it , "sarlSpecialCharError" , "[^']" , true ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ appendMatch ( it , "sarlSpecialChar" , "\\\\\\(...
public class ClassUtility { /** * Extract the searched type from a ParamterizedType . * @ param superType the base class hosting the generic type * @ param typeSearched the searched type , the returned class shall be a subclass of it * @ return the searched type or null */ private static Class < ? > searchIntoPar...
if ( superType instanceof ParameterizedType ) { for ( final Type genericType : ( ( ParameterizedType ) superType ) . getActualTypeArguments ( ) ) { if ( genericType instanceof Class < ? > && typeSearched . isAssignableFrom ( ( Class < ? > ) genericType ) ) { return ( Class < ? > ) genericType ; } else if ( genericType ...
public class Choice8 { /** * { @ inheritDoc } */ @ Override public < I > Choice8 < A , B , C , D , E , F , G , I > fmap ( Function < ? super H , ? extends I > fn ) { } }
return Monad . super . < I > fmap ( fn ) . coerce ( ) ;
public class AGNES { /** * Update the scratch distance matrix . * @ param end Active set size * @ param mat Matrix view * @ param builder Hierarchy builder ( to get cluster sizes ) * @ param mindist Distance that was used for merging * @ param x First matrix position * @ param y Second matrix position * @...
// Update distance matrix . Note : y < x final int xbase = MatrixParadigm . triangleSize ( x ) ; final int ybase = MatrixParadigm . triangleSize ( y ) ; double [ ] scratch = mat . matrix ; DBIDArrayIter ij = mat . ix ; // Write to ( y , j ) , with j < y int j = 0 ; for ( ; j < y ; j ++ ) { if ( builder . isLinked ( ij ...
public class FutureImpl { /** * The get ( ) method throws this exception wrapped as the cause of an ExecutionException . < br > * Multiple calls are ignored . < br > * Calls after cancel are ignored . * @ param e Exception */ public void set ( final Exception e ) { } }
if ( this . value . compareAndSet ( null , e ) ) { this . listeners . clear ( ) ; this . cdl . countDown ( ) ; }
public class RESTAssert { /** * assert that string matches [ + - ] ? [ 0-9 ] * * @ param string the string to check * @ param status the status code to throw * @ throws WebApplicationException with given status code */ public static void assertInt ( final String string , final StatusType status ) { } }
RESTAssert . assertNotEmpty ( string ) ; RESTAssert . assertPattern ( string , "[+-]?[0-9]*" , status ) ;
public class WDataTable { /** * For rendering purposes only - has no effect on model . * @ param index the sort column index , or - 1 for no sort . * @ param ascending true for ascending order , false for descending */ protected void setSort ( final int index , final boolean ascending ) { } }
TableModel model = getOrCreateComponentModel ( ) ; model . sortColIndex = index ; model . sortAscending = ascending ;
public class Instrumented { /** * Returns a { @ link com . codahale . metrics . Timer . Context } only if { @ link org . apache . gobblin . metrics . MetricContext } is defined . * @ param context an Optional & lt ; { @ link org . apache . gobblin . metrics . MetricContext } $ gt ; * @ param name name of the timer ...
return context . transform ( new Function < MetricContext , Timer . Context > ( ) { @ Override public Timer . Context apply ( @ Nonnull MetricContext input ) { return input . timer ( name ) . time ( ) ; } } ) ;
public class CmsLoginController { /** * Returns the link to the login form . < p > * @ param cms the current cms context * @ return the login form link */ public static String getFormLink ( CmsObject cms ) { } }
return OpenCms . getLinkManager ( ) . substituteLinkForUnknownTarget ( cms , CmsWorkplaceLoginHandler . LOGIN_HANDLER , false ) ;
public class CouchDBUtils { /** * Gets the context . * @ param httpHost * the http host * @ return the context */ public static HttpContext getContext ( HttpHost httpHost ) { } }
AuthCache authCache = new BasicAuthCache ( ) ; authCache . put ( httpHost , new BasicScheme ( ) ) ; HttpContext context = new BasicHttpContext ( ) ; context . setAttribute ( ClientContext . AUTH_CACHE , authCache ) ; return context ;
public class ContextUtils { /** * Get the { @ link android . media . MediaRouter } service for this context . * @ param context the context . * @ return the { @ link android . media . MediaRouter } */ @ TargetApi ( Build . VERSION_CODES . JELLY_BEAN ) public static MediaRouter getMediaRouter ( Context context ) { }...
return ( MediaRouter ) context . getSystemService ( Context . MEDIA_ROUTER_SERVICE ) ;
public class LongHashPartition { /** * Update the address in array for given key . */ private void updateIndex ( long key , int hashCode , long address , int size , MemorySegment dataSegment , int currentPositionInSegment ) throws IOException { } }
assert ( numKeys <= numBuckets / 2 ) ; int bucketId = hashCode & numBucketsMask ; // each bucket occupied 16 bytes ( long key + long pointer to data address ) int bucketOffset = bucketId * SPARSE_BUCKET_ELEMENT_SIZE_IN_BYTES ; MemorySegment segment = buckets [ bucketOffset >>> segmentSizeBits ] ; int segOffset = bucket...
public class JaxbConfigurationReader { /** * Creates a custom component based on an element which specified just a class name and an optional set of * properties . * @ param < E > * @ param customElementType the JAXB custom element type * @ param expectedClazz an expected class or interface that the component s...
final InjectionManager injectionManager = configuration . getEnvironment ( ) . getInjectionManagerFactory ( ) . getInjectionManager ( configuration ) ; return createCustomElementInternal ( customElementType , expectedClazz , injectionManager , initialize ) ;
public class CmsAliasView { /** * Gets the buttons which should be displayed in the button bar of the popup containing this view . < p > * @ return the buttons for the popup button bar */ public List < CmsPushButton > getButtonBar ( ) { } }
List < CmsPushButton > buttons = new ArrayList < CmsPushButton > ( ) ; buttons . add ( m_cancelButton ) ; buttons . add ( m_saveButton ) ; buttons . add ( m_downloadButton ) ; buttons . add ( m_uploadButton ) ; return buttons ;
public class AbstractAttribute { /** * Simple encoding method that returns the text - encoded version of * this attribute with no formatting . * @ return the text - encoded XML */ @ Override public String encode ( ) { } }
ReadableByteArrayOutputStream out = new ReadableByteArrayOutputStream ( ) ; encode ( out ) ; return out . toString ( ) ;
public class PDFDomTree { /** * Creates a new empty HTML document tree . * @ throws ParserConfigurationException */ protected void createDocument ( ) throws ParserConfigurationException { } }
DocumentBuilderFactory builderFactory = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder builder = builderFactory . newDocumentBuilder ( ) ; DocumentType doctype = builder . getDOMImplementation ( ) . createDocumentType ( "html" , "-//W3C//DTD XHTML 1.1//EN" , "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" ) ...
public class FbBot { /** * This method will be invoked after { @ link FbBot # askTimeForMeeting ( Event ) } . You can * call { @ link Bot # stopConversation ( Event ) } to end the conversation . * @ param event */ @ Controller public void askWhetherToRepeat ( Event event ) { } }
if ( event . getMessage ( ) . getText ( ) . contains ( "yes" ) ) { reply ( event , "Great! I will remind you tomorrow before the meeting." ) ; } else { reply ( event , "Okay, don't forget to attend the meeting tomorrow :)" ) ; } stopConversation ( event ) ; // stop conversation
public class ProductBackendApiDecorator { /** * Get a list with all categories */ public Observable < List < String > > getAllCategories ( ) { } }
return getAllProducts ( ) . map ( products -> { Set < String > categories = new HashSet < String > ( ) ; for ( Product p : products ) { categories . add ( p . getCategory ( ) ) ; } List < String > result = new ArrayList < String > ( categories . size ( ) ) ; result . addAll ( categories ) ; return result ; } ) ;
public class JQMFlip { /** * Sets the currently selected value . * @ param fireEvents - if false then ValueChangeEvent won ' t be raised ( though ChangeEvent will be raised anyway ) . */ @ Override public void setValue ( String value , boolean fireEvents ) { } }
int newIdx = value == null ? 0 : value . equals ( getValue1 ( ) ) ? 0 : value . equals ( getValue2 ( ) ) ? 1 : 0 ; int oldIdx = getSelectedIndex ( ) ; String oldVal = fireEvents ? getValue ( ) : null ; internVal = value ; if ( oldIdx != newIdx ) { inSetValue = true ; try { setSelectedIndex ( newIdx ) ; } finally { inSe...
public class RandomGenerator { /** * Randomly chooses four atoms and alters the bonding * pattern between them according to rules described * in " Faulon , JCICS 1996 , 36 , 731 " . */ public void mutate ( IAtomContainer ac ) { } }
logger . debug ( "RandomGenerator->mutate() Start" ) ; int nrOfAtoms = ac . getAtomCount ( ) ; int x1 = 0 , x2 = 0 , y1 = 0 , y2 = 0 ; double a11 = 0 , a12 = 0 , a22 = 0 , a21 = 0 ; double b11 = 0 , lowerborder = 0 , upperborder = 0 ; IAtom ax1 = null , ax2 = null , ay1 = null , ay2 = null ; IBond b1 = null , b2 = null...
public class DetailView { /** * Trigger a refresh . */ private void lazyRefresh ( ) { } }
Runnable pr = new Runnable ( ) { @ Override public void run ( ) { if ( pendingRefresh . compareAndSet ( this , null ) ) { refresh ( ) ; } } } ; pendingRefresh . set ( pr ) ; scheduleUpdate ( pr ) ;
public class CreateDocsMojo { /** * Create Excel documentation in interactive mode . * @ throws PrompterException */ private void createExcelDoc ( ) throws PrompterException { } }
ExcelDocConfiguration configuration = new ExcelDocConfiguration ( ) ; String company = prompter . prompt ( "Enter company:" , configuration . getCompany ( ) ) ; String author = prompter . prompt ( "Enter author:" , configuration . getAuthor ( ) ) ; String pageTitle = prompter . prompt ( "Enter page title:" , configurat...
public class JsonWriter { /** * Encodes { @ code value } . * @ return this writer . */ public JsonWriter value ( Boolean value ) throws IOException { } }
if ( value == null ) { return nullValue ( ) ; } writeDeferredName ( ) ; beforeValue ( ) ; out . write ( value ? "true" : "false" ) ; return this ;
public class MultiVertexGeometryImpl { /** * Checked vs . Jan 11 , 2011 */ @ Override public Point3D getXYZ ( int index ) { } }
if ( index < 0 || index >= getPointCount ( ) ) throw new IndexOutOfBoundsException ( ) ; _verifyAllStreams ( ) ; AttributeStreamOfDbl v = ( AttributeStreamOfDbl ) m_vertexAttributes [ 0 ] ; Point3D pt = new Point3D ( ) ; pt . x = v . read ( index * 2 ) ; pt . y = v . read ( index * 2 + 1 ) ; // TODO check excluded if s...
public class MeasureFactory { /** * Create a { @ link PullMeasure } to backup the last { @ link Value } of a * { @ link PushMeasure } . When the { @ link PushMeasure } send a notification * with a given { @ link Value } , this { @ link Value } is stored into a variable * so that it can be retrieved at any time th...
final Object [ ] cache = { initialValue } ; final MeasureListener < Value > listener = new MeasureListener < Value > ( ) { @ Override public void measureGenerated ( Value value ) { cache [ 0 ] = value ; } } ; push . register ( listener ) ; return new PullMeasure < Value > ( ) { @ Override public String getName ( ) { re...
public class DefineClassUtils { /** * " Compile " a MethodHandle that is equivalent to the following closure : * Class < ? > defineClass ( Class targetClass , String className , byte [ ] byteCode ) { * MethodHandles . Lookup targetClassLookup = MethodHandles . privateLookupIn ( targetClass , lookup ) ; * return t...
// this is getting meta MethodHandle defineClass = lookup . unreflect ( MethodHandles . Lookup . class . getMethod ( "defineClass" , byte [ ] . class ) ) ; MethodHandle privateLookupIn = lookup . findStatic ( MethodHandles . class , "privateLookupIn" , MethodType . methodType ( MethodHandles . Lookup . class , Class . ...
public class DFSClient { /** * Get file info : decide which rpc to call based on protocol version */ private FileStatus versionBasedGetFileInfo ( String src ) throws IOException { } }
if ( namenodeVersion >= ClientProtocol . OPTIMIZE_FILE_STATUS_VERSION ) { return HdfsFileStatus . toFileStatus ( namenode . getHdfsFileInfo ( src ) , src ) ; } else { return namenode . getFileInfo ( src ) ; }
public class AmazonCloudFormationClient { /** * Returns information about a stack drift detection operation . A stack drift detection operation detects whether a * stack ' s actual configuration differs , or has < i > drifted < / i > , from it ' s expected configuration , as defined in the * stack template and any ...
request = beforeClientExecution ( request ) ; return executeDescribeStackDriftDetectionStatus ( request ) ;
public class Guid { /** * Combine multiple { @ link Guid } s into a single { @ link Guid } . * @ throws IOException */ public static Guid combine ( Guid ... guids ) throws IOException { } }
byte [ ] [ ] byteArrays = new byte [ guids . length ] [ ] ; for ( int i = 0 ; i < guids . length ; i ++ ) { byteArrays [ i ] = guids [ i ] . sha ; } return fromByteArrays ( byteArrays ) ;
public class CmsVfsService { /** * Processes a file path , which may have macros in it , so it can be opened by the XML content editor . < p > * @ param cms the current CMS context * @ param res the resource for which the context menu option has been selected * @ param pathWithMacros the file path which may conta...
String subsite = OpenCms . getADEManager ( ) . getSubSiteRoot ( cms , res . getRootPath ( ) ) ; CmsMacroResolver resolver = new CmsMacroResolver ( ) ; if ( subsite != null ) { resolver . addMacro ( "subsite" , cms . getRequestContext ( ) . removeSiteRoot ( subsite ) ) ; } resolver . addMacro ( "file" , cms . getSitePat...
public class BackendUser { /** * Perform syncronously sign up attempt . * @ param username user name user will be identified by . * @ param email user email address * @ param password user password * @ return login results . */ public static SignUpResponse signUp ( String username , String email , String passwo...
return signUp ( new SignUpCredentials ( username , email , password ) ) ;
public class EntityLinkOperation { /** * ( non - Javadoc ) * @ see * com . microsoft . windowsazure . services . media . entities . EntityDeleteOperation * # getUri ( ) */ @ Override public String getUri ( ) { } }
String escapedEntityId ; try { escapedEntityId = URLEncoder . encode ( primaryEntityId , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { throw new InvalidParameterException ( "UTF-8 encoding is not supported." ) ; } return String . format ( "%s('%s')/$links/%s" , primaryEntitySet , escapedEntityId , secondaryE...
public class BaseBsoneerCodec { /** * { @ inhericDoc } */ @ Override public T decode ( BsonReader reader , DecoderContext decoderContext ) { } }
T instance = instantiate ( ) ; reader . readStartDocument ( ) ; while ( reader . readBsonType ( ) != BsonType . END_OF_DOCUMENT ) { String fieldName = reader . readName ( ) ; BsoneeBaseSetter < T > bsoneeBaseSetter = settersByName . get ( fieldName ) ; if ( bsoneeBaseSetter != null ) { bsoneeBaseSetter . set ( instance...
public class PropertiesUtil { /** * Returns a Collection of all property values that have keys with a certain prefix . * @ param props the Properties to reaqd * @ param prefix the prefix * @ return Collection of all property values with keys with a certain prefix */ public static Collection listPropertiesWithPref...
final HashSet set = new HashSet ( ) ; for ( Iterator i = props . keySet ( ) . iterator ( ) ; i . hasNext ( ) ; ) { String key = ( String ) i . next ( ) ; if ( key . startsWith ( prefix ) ) { set . add ( props . getProperty ( key ) ) ; } } return set ;
public class RestletUtilMemoryRealm { /** * Maps a group defined in a component to a role defined in the application . * @ param group * The source group . * @ param role * The target role . */ public void map ( final Group group , final Role role ) { } }
this . getRoleMappings ( ) . add ( new RoleMapping ( group , role ) ) ;
public class MultiNormalizerHybrid { /** * Undo ( revert ) the normalization applied by this DataNormalization instance to the entire inputs array * @ param features The normalized array of inputs * @ param maskArrays Optional mask arrays belonging to the inputs */ @ Override public void revertFeatures ( @ NonNull ...
for ( int i = 0 ; i < features . length ; i ++ ) { revertFeatures ( features , maskArrays , i ) ; }
public class BranchNode { /** * Returns a list of immediate sub - queries which are part of this query . * @ return List < AbstractParsedStmt > - list of sub - queries from this query */ @ Override public void extractEphemeralTableQueries ( List < StmtEphemeralTableScan > scans ) { } }
if ( m_leftNode != null ) { m_leftNode . extractEphemeralTableQueries ( scans ) ; } if ( m_rightNode != null ) { m_rightNode . extractEphemeralTableQueries ( scans ) ; }
public class TopicsInner { /** * Regenerate key for a topic . * Regenerate a shared access key for a topic . * @ param resourceGroupName The name of the resource group within the user ' s subscription . * @ param topicName Name of the topic * @ param keyName Key name to regenerate key1 or key2 * @ throws Ille...
return regenerateKeyWithServiceResponseAsync ( resourceGroupName , topicName , keyName ) . map ( new Func1 < ServiceResponse < TopicSharedAccessKeysInner > , TopicSharedAccessKeysInner > ( ) { @ Override public TopicSharedAccessKeysInner call ( ServiceResponse < TopicSharedAccessKeysInner > response ) { return response...
public class CacheUtil { /** * Gets the cache name with prefix but without Hazelcast ' s { @ link javax . cache . CacheManager } * specific prefix { @ link com . hazelcast . cache . HazelcastCacheManager # CACHE _ MANAGER _ PREFIX } . * @ param name the simple name of the cache without any prefix * @ param uri an...
String cacheNamePrefix = getPrefix ( uri , classLoader ) ; if ( cacheNamePrefix != null ) { return cacheNamePrefix + name ; } else { return name ; }
public class ContainerDefinition { /** * A list of < code > ulimits < / code > to set in the container . This parameter maps to < code > Ulimits < / code > in the < a * href = " https : / / docs . docker . com / engine / api / v1.35 / # operation / ContainerCreate " > Create a container < / a > section of the * < a...
if ( this . ulimits == null ) { setUlimits ( new com . amazonaws . internal . SdkInternalList < Ulimit > ( ulimits . length ) ) ; } for ( Ulimit ele : ulimits ) { this . ulimits . add ( ele ) ; } return this ;
public class DetectCircleGrid { /** * Remove grids which cannot possible match the expected shape */ static void pruneIncorrectShape ( FastQueue < Grid > grids , int numRows , int numCols ) { } }
// prune clusters which can ' t be a member calibration target for ( int i = grids . size ( ) - 1 ; i >= 0 ; i -- ) { Grid g = grids . get ( i ) ; if ( ( g . rows != numRows || g . columns != numCols ) && ( g . rows != numCols || g . columns != numRows ) ) { grids . remove ( i ) ; } }
public class AnimatorModel { /** * Update play mode routine . * @ param extrp The extrapolation value . */ private void updatePlaying ( double extrp ) { } }
current += speed * extrp ; // Last frame reached if ( Double . compare ( current , last + FRAME ) >= 0 ) { // If not reversed , done , else , reverse current = last + HALF_FRAME ; checkStatePlaying ( ) ; }
public class BannedDependencies { /** * { @ inheritDoc } */ protected Set < Artifact > checkDependencies ( Set < Artifact > theDependencies , Log log ) throws EnforcerRuleException { } }
Set < Artifact > excluded = checkDependencies ( theDependencies , excludes ) ; // anything specifically included should be removed // from the ban list . if ( excluded != null ) { Set < Artifact > included = checkDependencies ( theDependencies , includes ) ; if ( included != null ) { excluded . removeAll ( included ) ;...
public class Router { /** * Specify a middleware that will be called for a matching HTTP GET * @ param regex A regular expression * @ param handlers The middleware to call */ public Router get ( @ NotNull final Pattern regex , @ NotNull final IMiddleware ... handlers ) { } }
addRegEx ( "GET" , regex , handlers , getBindings ) ; return this ;
public class VirtualFileSystem { /** * Touches the specified { @ linkplain File } , i . e . sets its { @ linkplain File # getLastModified ( ) last modified time } to * current time . * @ param txn { @ linkplain Transaction } instance * @ param file { @ linkplain File } instance * @ see # readFile ( Transaction ...
new LastModifiedTrigger ( txn , file , pathnames ) . run ( ) ;
public class TimestampInterval { /** * / * [ deutsch ] * < p > Konvertiert ein beliebiges Intervall zu einem Intervall dieses Typs . < / p > * @ param interval any kind of timestamp interval * @ return TimestampInterval * @ since 3.34/4.29 */ public static TimestampInterval from ( ChronoInterval < PlainTimestam...
if ( interval instanceof TimestampInterval ) { return TimestampInterval . class . cast ( interval ) ; } else { return new TimestampInterval ( interval . getStart ( ) , interval . getEnd ( ) ) ; }
public class PKeyArea { /** * Read the record that matches this record ' s temp key area . < p > * WARNING - This method changes the current record ' s buffer . * @ param strSeekSign - Seek sign : < p > * < pre > * " = " - Look for the first match . * " = = " - Look for an exact match ( On non - unique keys ,...
return null ;
public class CxDxServerSessionImpl { /** * / * ( non - Javadoc ) * @ see org . jdiameter . api . cxdx . ServerCxDxSession # sendMultimediaAuthAnswer ( org . jdiameter . api . cxdx . events . JMultimediaAuthAnswer ) */ @ Override public void sendMultimediaAuthAnswer ( JMultimediaAuthAnswer answer ) throws InternalExce...
send ( Event . Type . SEND_MESSAGE , null , answer ) ;
public class ClassDescriptor { /** * return all AttributeDescriptors for the path < br > * ie : partner . addresses . street returns a Collection of 3 AttributeDescriptors * ( ObjectReferenceDescriptor , CollectionDescriptor , FieldDescriptor ) < br > * ie : partner . addresses returns a Collection of 2 Attribute...
return getAttributeDescriptorsForCleanPath ( SqlHelper . cleanPath ( aPath ) , pathHints ) ;
public class TimeOfDay { /** * Returns a copy of this time with the specified chronology . * This instance is immutable and unaffected by this method call . * This method retains the values of the fields , thus the result will * typically refer to a different instant . * The time zone of the specified chronolog...
newChronology = DateTimeUtils . getChronology ( newChronology ) ; newChronology = newChronology . withUTC ( ) ; if ( newChronology == getChronology ( ) ) { return this ; } else { TimeOfDay newTimeOfDay = new TimeOfDay ( this , newChronology ) ; newChronology . validate ( newTimeOfDay , getValues ( ) ) ; return newTimeO...
public class RuleBasedBreakIterator { /** * Dump the contents of the state table and character classes for this break iterator . * For debugging only . * @ deprecated This API is ICU internal only . * @ hide draft / provisional / internal are hidden on Android */ @ Deprecated public void dump ( java . io . PrintS...
if ( out == null ) { out = System . out ; } this . fRData . dump ( out ) ;
public class Setting { /** * 获取并删除键值对 , 当指定键对应值非空时 , 返回并删除这个值 , 后边的键对应的值不再查找 * @ param keys 键列表 , 常用于别名 * @ return 字符串值 * @ since 3.1.2 */ public String getAndRemoveStr ( String ... keys ) { } }
Object value = null ; for ( String key : keys ) { value = remove ( key ) ; if ( null != value ) { break ; } } return ( String ) value ;
public class Volley { /** * Creates a default instance of the worker pool and calls { @ link RequestQueue # start ( ) } on it . * @ param stack An { @ link HttpStack } to use for the network , or null for default . * @ return A started { @ link RequestQueue } instance . */ public static RequestQueue newRequestQueue...
File cacheDir = new File ( "./" , DEFAULT_CACHE_DIR ) ; String userAgent = "volley/0" ; if ( stack == null ) { stack = new HurlStack ( ) ; } Network network = new BasicNetwork ( stack ) ; RequestQueue queue = new RequestQueue ( new DiskBasedCache ( cacheDir ) , network ) ; queue . start ( ) ; return queue ;
public class JavadocFixTool { /** * Lazily initialize the readme document , reading it from README file inside the jar */ public static void initReadme ( ) { } }
try { InputStream readmeStream = JavadocFixTool . class . getResourceAsStream ( "/README" ) ; if ( readmeStream != null ) { BufferedReader readmeReader = new BufferedReader ( new InputStreamReader ( readmeStream ) ) ; StringBuilder readmeBuilder = new StringBuilder ( ) ; String s ; while ( ( s = readmeReader . readLine...
public class VirtualMachineScaleSetsInner { /** * Restarts one or more virtual machines in a VM scale set . * @ param resourceGroupName The name of the resource group . * @ param vmScaleSetName The name of the VM scale set . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return...
return beginRestartWithServiceResponseAsync ( resourceGroupName , vmScaleSetName ) . map ( new Func1 < ServiceResponse < OperationStatusResponseInner > , OperationStatusResponseInner > ( ) { @ Override public OperationStatusResponseInner call ( ServiceResponse < OperationStatusResponseInner > response ) { return respon...
public class TabbedPaneDemo { /** * Sets up a validator for the specified field . * @ param field Field on which a validator should be installed . * @ return Property representing the result of the field validation and that can be used for tab - wise validation . */ private ReadableProperty < Boolean > installField...
// FieLd is valid if not empty SimpleBooleanProperty fieldResult = new SimpleBooleanProperty ( ) ; on ( new JTextFieldDocumentChangedTrigger ( field ) ) . read ( new JTextFieldTextProvider ( field ) ) . check ( new StringNotEmptyRule ( ) ) . handleWith ( new IconBooleanFeedback ( field ) ) . handleWith ( fieldResult ) ...
public class ThreadSafety { /** * Gets the set of in - scope threadsafe type parameters from the containerOf specs on annotations . * < p > Usually only the immediately enclosing declaration is searched , but it ' s possible to have * cases like : * < pre > * { @ literal @ } MarkerAnnotation ( containerOf = " T...
if ( sym == null ) { return ImmutableSet . of ( ) ; } ImmutableSet . Builder < String > result = ImmutableSet . builder ( ) ; OUTER : for ( Symbol s = sym ; s . owner != null ; s = s . owner ) { switch ( s . getKind ( ) ) { case INSTANCE_INIT : continue ; case PACKAGE : break OUTER ; default : break ; } AnnotationInfo ...
public class ComputeNodesImpl { /** * Upload Azure Batch service log files from the specified compute node to Azure Blob Storage . * This is for gathering Azure Batch service log files in an automated fashion from nodes if you are experiencing an error and wish to escalate to Azure support . The Azure Batch service l...
return ServiceFuture . fromHeaderResponse ( uploadBatchServiceLogsWithServiceResponseAsync ( poolId , nodeId , uploadBatchServiceLogsConfiguration ) , serviceCallback ) ;
public class DRL5Lexer { /** * $ ANTLR start " NULL _ SAFE _ DOT " */ public final void mNULL_SAFE_DOT ( ) throws RecognitionException { } }
try { int _type = NULL_SAFE_DOT ; int _channel = DEFAULT_TOKEN_CHANNEL ; // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 267:15 : ( ' ! . ' ) // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 267:17 : ' ! . ' { match ( "!." ) ; if ( state . failed ) return ; } sta...
public class ApiOvhCloud { /** * Add new alert * REST : POST / cloud / project / { serviceName } / alerting * @ param monthlyThreshold [ required ] Monthly threshold for this alerting in currency * @ param email [ required ] Email to contact * @ param delay [ required ] Delay between alerts in seconds * @ par...
String qPath = "/cloud/project/{serviceName}/alerting" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "delay" , delay ) ; addBody ( o , "email" , email ) ; addBody ( o , "monthlyThreshold" , monthlyThreshold ) ; String resp = exec ...
public class TermsByQueryRequest { /** * Validates the request * @ return null if valid , exception otherwise */ @ Override public ActionRequestValidationException validate ( ) { } }
ActionRequestValidationException validationException = super . validate ( ) ; if ( termsEncoding != null && termsEncoding . equals ( TermsEncoding . BYTES ) ) { if ( maxTermsPerShard == null ) { validationException = ValidateActions . addValidationError ( "maxTermsPerShard not specified for terms encoding [bytes]" , va...
public class AbstractAppender { /** * Builds a populated AppendEntries request . */ @ SuppressWarnings ( "unchecked" ) protected AppendRequest buildAppendEntriesRequest ( RaftMemberContext member , long lastIndex ) { } }
final RaftLogReader reader = member . getLogReader ( ) ; final Indexed < RaftLogEntry > prevEntry = reader . getCurrentEntry ( ) ; final DefaultRaftMember leader = raft . getLeader ( ) ; AppendRequest . Builder builder = AppendRequest . builder ( ) . withTerm ( raft . getTerm ( ) ) . withLeader ( leader != null ? leade...
public class PlayEngine { /** * Sends an onPlayStatus message . * http : / / help . adobe . com / en _ US / FlashPlatform / reference / actionscript / 3 / flash / events / NetDataEvent . html * @ param code * @ param duration * @ param bytes */ private void sendOnPlayStatus ( String code , int duration , long b...
if ( log . isDebugEnabled ( ) ) { log . debug ( "Sending onPlayStatus - code: {} duration: {} bytes: {}" , code , duration , bytes ) ; } // create the buffer IoBuffer buf = IoBuffer . allocate ( 102 ) ; buf . setAutoExpand ( true ) ; Output out = new Output ( buf ) ; out . writeString ( "onPlayStatus" ) ; ObjectMap < O...
public class Caster { /** * casts a Object to a Integer * @ param o Object to cast to Integer * @ param defaultValue * @ return Integer from Object */ public static Integer toInteger ( Object o , Integer defaultValue ) { } }
if ( defaultValue != null ) return Integer . valueOf ( toIntValue ( o , defaultValue . intValue ( ) ) ) ; int res = toIntValue ( o , Integer . MIN_VALUE ) ; if ( res == Integer . MIN_VALUE ) return defaultValue ; return Integer . valueOf ( res ) ;
public class Buffer { /** * Reads length - encoded string . * @ param charset the charset to use , for example ASCII * @ return the read string */ public String readStringLengthEncoded ( final Charset charset ) { } }
int length = ( int ) getLengthEncodedNumeric ( ) ; String string = new String ( buf , position , length , charset ) ; position += length ; return string ;