/** * Constructor. * * @param properties * properties to set. * @throws IllegalArgumentException * if properties is null. */ public PluginPropertyFactory( final KeyValueSet properties ) throws IllegalArgumentException { Assert.assertNotNull( properties, "Properties cannot be null" ); this.properties = properties; }
/** * @param properties * properties to test. * @throws IllegalArgumentException * if properties is null. */ public static void assertProperties( final KeyValueSet properties ) throws IllegalArgumentException { Assert.assertNotNull( properties, "Properties cannot be null" ); }
/** * Constructor. * * @param node * node to set. * @throws IllegalArgumentException * if node is null. */ public LoadXml( final Node node ) throws IllegalArgumentException { super(); Assert.assertNotNull( node, "Node cannot be null" ); this.node = node; }
/** * Constructor. * * @param node * node to set. * @throws IllegalArgumentException * if node is null. */ public ReadFromPreferences( final Preferences node ) throws IllegalArgumentException { super(); Assert.assertNotNull( node, "Node cannot be null" ); this.node = node; }
/** * Constructor. * * @param node * node to set. * @throws IllegalArgumentException * if node is null. */ public SaveToPreferences( final Preferences node ) throws IllegalArgumentException { super(); Assert.assertNotNull( node, "Node cannot be null" ); this.node = node; }
/** * Constructor. * * @param shell * the shell to set. * @param varSpace * the variableSpace to be used. e.g. for TextVar * @throws IllegalArgumentException * if shell is null. */ public PluginWidgetFactory( final Shell shell, final VariableSpace varSpace ) throws IllegalArgumentException { Assert.assertNotNull( shell, "Shell cannot be null" ); Assert.assertNotNull( varSpace, "transMeta cannot be null" ); this.shell = shell; this.varSpace = varSpace; }
/** * Constructor. * * @param repository * the repository. * @param metaStore * the MetaStore * @param stepId * the step ID. * @throws IllegalArgumentException * if repository is null. */ public ReadFromRepository( final Repository repository, final IMetaStore metaStore, final ObjectId stepId ) throws IllegalArgumentException { super(); Assert.assertNotNull( repository, "Repository cannot be null" ); this.repository = repository; this.metaStore = metaStore; this.stepId = stepId; }
/** * Constructor. * * @param repository * repository to use. * @param metaStore * the MetaStore * @param transformationId * transformation ID to set. * @param stepId * step ID to set. * @throws IllegalArgumentException * if repository is null. */ public SaveToRepository( final Repository repository, final IMetaStore metaStore, final ObjectId transformationId, final ObjectId stepId ) throws IllegalArgumentException { super(); Assert.assertNotNull( repository, "Repository cannot be null" ); this.repository = repository; this.metaStore = metaStore; this.transformationId = transformationId; this.stepId = stepId; }
/** * Constructor. * * @param shell * shell to set. * @param textVar * text variable to edit. * @param filterExtensions * filter extensions to set. * @param filterNames * filter names to set. * @throws IllegalArgumentException * if shell or text variable is null. */ public SimpleFileSelection( final Shell shell, final TextVar textVar, final String[] filterExtensions, final String[] filterNames ) throws IllegalArgumentException { super(); Assert.assertNotNull( shell, "Shell cannot be null" ); Assert.assertNotNull( textVar, "Text var cannot be null" ); Assert.assertNotNull( filterNames, "Filter names cannot be null" ); Assert.assertNotNull( filterExtensions, "Filter extensions cannot be null" ); this.shell = shell; this.textVar = textVar; this.filterExtensions = new String[filterExtensions.length]; System.arraycopy( filterExtensions, 0, this.filterExtensions, 0, filterExtensions.length ); this.filterNames = new String[filterNames.length]; System.arraycopy( filterNames, 0, this.filterNames, 0, filterNames.length ); }
/** * Factory method. * * @param someClassInPackage * some class in package. * @return messages. * @throws IllegalArgumentException * if class is null */ public static PluginMessages getMessages( final Class<?> someClassInPackage ) throws IllegalArgumentException { Assert.assertNotNull( someClassInPackage, "Class cannot be null" ); return getMessages( someClassInPackage.getPackage().getName() ); }
/** * Walk entries. * * @param handler * handler to call. * @param filter * filter to use. * @throws IllegalArgumentException * if closure or filter is null. */ public void walk( final Closure handler, final Predicate filter ) throws IllegalArgumentException { Assert.assertNotNull( handler, "Handler cannot be null" ); Assert.assertNotNull( filter, "Filter cannot be null" ); for ( KeyValue<?> keyValue : this.entries.values() ) { if ( filter.evaluate( keyValue ) ) { handler.execute( keyValue ); } } }
/** * Append log on. * * @param dbhost * DB host, e.g localtd * @param user * the user. * @param password * the password. * @return this * @throws IllegalArgumentException * if input is invalid. */ public FastloadControlBuilder logon( final String dbhost, final String user, final String password ) throws IllegalArgumentException { Assert.assertNotBlank( dbhost, "DB host must not be blank" ); Assert.assertNotBlank( user, "User must not be blank" ); Assert.assertNotNull( password, "Password must not be null" ); this.builder.append( "LOGON " ); this.builder.append( dbhost ); this.builder.append( '/' ); this.builder.append( user ); this.builder.append( ',' ); this.builder.append( password ); return this.newline(); }
/** * {@inheritDoc} * * @see org.apache.commons.collections.Closure#execute(java.lang.Object) * @throws IllegalArgumentException * if property is null. * @throws FunctorException * if KettleException in handle thrown. */ public final void execute( final Object property ) throws IllegalArgumentException, FunctorException { Assert.assertNotNull( property, "Plugin property cannot be null" ); try { this.handle( (PluginProperty) property ); } catch ( KettleException e ) { throw new FunctorException( "EXCEPTION: " + this, e ); } }
Assert.assertNotNull( targetTableFields, "fields cannot be null" ); Assert.assertNotNull( dataFile, "dataFile cannot be null" );
/** * @param targetTableFields * ... * @param tableFieldList * @param tableName * ... * @return ... */ public FastloadControlBuilder insert( final RowMetaInterface targetTableFields, StringListPluginProperty tableFieldList, final String tableName ) { Assert.assertNotNull( targetTableFields, "targetTableFields cannot be null." ); Assert.assertNotNull( tableName, "TableName cannot be null." ); this.builder.append( "INSERT INTO " + tableName + "(" ); for ( int i = 0; i < targetTableFields.size(); i++ ) { int tableIndex = tableFieldList.getValue().indexOf( targetTableFields.getValueMeta( i ).getName() ); if ( tableIndex >= 0 ) { this.builder.append( ":" + targetTableFields.getValueMeta( i ).getName() ); if ( targetTableFields.getValueMeta( i ).getType() == ValueMetaInterface.TYPE_DATE ) { this.builder.append( "(DATE, FORMAT '" ); this.builder.append( DEFAULT_DATE_FORMAT ); this.builder.append( "')" ); } if ( i < tableFieldList.size() - 1 ) { this.builder.append( "," ); } } } this.builder.append( ")" ); return this.newline(); }
public GoogleAnalyticsApiFacade( HttpTransport httpTransport, JsonFactory jsonFactory, String application, String oathServiceEmail, File keyFile ) throws IOException, GeneralSecurityException { Assert.assertNotNull( httpTransport, "HttpTransport cannot be null" ); Assert.assertNotNull( jsonFactory, "JsonFactory cannot be null" ); Assert.assertNotBlank( application, "Application name cannot be empty" ); Assert.assertNotBlank( oathServiceEmail, "OAuth Service Email name cannot be empty" ); Assert.assertNotNull( keyFile, "OAuth secret key file cannot be null" ); this.httpTransport = httpTransport; Credential credential = new GoogleCredential.Builder() .setTransport( httpTransport ) .setJsonFactory( jsonFactory ) .setServiceAccountScopes( AnalyticsScopes.all() ) .setServiceAccountId( oathServiceEmail ) .setServiceAccountPrivateKeyFromP12File( keyFile ) .build(); analytics = new Analytics.Builder( httpTransport, jsonFactory, credential ) .setApplicationName( application ) .build(); }
Assert.assertNotNull( passThroughKeys ); Assert.assertNotNull( passThroughKeys.get( 0 ) ); Assert.assertTrue( passThroughKeys.get( 0 ).startsWith( "0_file" ) ); Assert.assertTrue( passThroughKeys.get( 0 ).endsWith( "filename1" ) ); Assert.assertNotNull( passThroughKeys.get( 1 ) ); Assert.assertTrue( passThroughKeys.get( 1 ).startsWith( "1_file" ) ); Assert.assertTrue( passThroughKeys.get( 1 ).endsWith( "filename2" ) );
final Map<String, String> noParams = new HashMap<>( ); Assert.assertNotNull( runtimeCtx.createNewInstance( persisted ) ); Assert.assertNotNull( runtimeCtx.createNewInstance( notPersisted ) ); Assert.assertNotNull( runtimeCtx.createNewInstance( persisted, noParams ) ); Assert.assertNotNull( runtimeCtx.createNewInstance( notPersisted, noParams ) ); Assert.assertNotNull( runtimeCtx.createNewInstance( persisted, noParams, forceImmediateWrite ) ); Assert.assertNotNull( runtimeCtx.createNewInstance( notPersisted, noParams, dontForceImmediateWrite ) );
@Test public void testGetUrlFactory() throws Exception { Assert.assertNotNull( runtimeCtx.getUrlFactory() ); Assert.assertTrue( runtimeCtx.getUrlFactory() == urlFactory ); }