Create a {@link ThorntailConfigurationBuilder} from a {@link Configuration} object
774320
public static ThorntailConfigurationBuilder create(Configuration config)
    {
        ThorntailConfigurationBuilder builder = new ThorntailConfigurationBuilder();

        ConfigurationElement propertiesElem = null;
        try
        {
            propertiesElem = config.getConfigurationElement("properties");
        }
        catch (RuntimeException e)
        {
            // Do nothing
        }
        if (propertiesElem != null)
        {
            Map<String, String> properties = new TreeMap<>();
            propertiesElem.getChildren().stream()
                        .filter(ConfigurationElement.class::isInstance)
                        .map(ConfigurationElement.class::cast)
                        .forEach(elem -> properties.put(elem.getName(), elem.getText()));
            builder.properties(properties);
        }
        return builder;
    }
410327
@CheckReturnValue
  public static <ReqT, RespT> Builder<ReqT, RespT> newBuilder() {
    return newBuilder(null, null);
  }
748894
public FreemarkerConfigurationBuilder<MYSELF> configuration() {
		if (configurationBuilder == null) {
			configurationBuilder = new FreemarkerConfigurationBuilder<>(myself, environmentBuilder);
		}
		return configurationBuilder;
	}
324418
private static <D, T> D createDaoFromConfig(ConnectionSource connectionSource, Class<T> clazz) throws SQLException {
		// no loaded configs
		if (configMap == null) {
			return null;
		}

		@SuppressWarnings("unchecked")
		DatabaseTableConfig<T> config = (DatabaseTableConfig<T>) configMap.get(clazz);
		// if we don't config information cached return null
		if (config == null) {
			return null;
		}

		// else create a DAO using configuration
		Dao<T, ?> configedDao = doCreateDao(connectionSource, config);
		@SuppressWarnings("unchecked")
		D castDao = (D) configedDao;
		return castDao;
	}
962372
public AbstractBuilder getConstructorBuilder(ClassWriter classWriter)
            throws Exception {
        return ConstructorBuilder.getInstance(context,
            classWriter.getClassDoc(),
            writerFactory.getConstructorWriter(classWriter));
    }
242612
public static <K, V> ConfigurationOptionBuilder<Map<K, V>> mapOption(ValueConverter<K> keyConverter, ValueConverter<V> valueConverter) {
		return new ConfigurationOptionBuilder<Map<K, V>>(new MapValueConverter<K, V>(keyConverter, valueConverter), Map.class)
				.defaultValue(Collections.<K, V>emptyMap());
	}
727324
public static Builder newBuilder(BucketInfo bucketInfo, String name) {
    return newBuilder(bucketInfo.getName(), name);
  }
164735
private String installConfiguration(String configurationName, InputStream confFileInputStream){
		String outputPath;
		try {
			File confDir = new File(System.getProperty("java.io.tmpdir") + "/dstream_" + UUID.randomUUID());
			confDir.mkdirs();
			File executionConfig = new File(confDir, configurationName);
			executionConfig.deleteOnExit();
			FileOutputStream confFileOs = new FileOutputStream(executionConfig);

			Properties configurationProperties = new Properties();
			configurationProperties.load(confFileInputStream);
			configurationProperties.store(confFileOs, configurationName + " configuration");

			this.addToClassPath(confDir);

			outputPath = configurationProperties.containsKey(DStreamConstants.OUTPUT)
					? configurationProperties.getProperty(DStreamConstants.OUTPUT)
							: configurationName.split("\\.")[0] + "/out";
		}
		catch (Exception e) {
			throw new IllegalStateException("Failed to generate execution config", e);
		}
		return outputPath;
	}
238831
public synchronized ClientBuilder newBuilder(String clientName, JaxRsClientConfig jaxRsConfig, Collection<JaxRsFeatureGroup> featureGroupsIn) {
        started = true;

        final List<JaxRsFeatureGroup> featureGroups = ImmutableList.<JaxRsFeatureGroup>builder()
                .add(PrivateFeatureGroup.WILDCARD)
                .addAll(featureGroupsIn)
                .build();

        final ClientBuilder builder = factory(ctx).newBuilder(clientName, jaxRsConfig, featureGroups);

        builder.property(CLIENT_NAME_PROPERTY, clientName);
        builder.property(FEATURE_GROUP_PROPERTY, featureGroups);

        final List<Feature> features = featureGroups.stream()
            .flatMap(g -> featureMap.get(g).stream())
            .collect(Collectors.toList());

        final List<Class<? extends Feature>> classFeatures = featureGroups.stream()
            .flatMap(g -> classFeatureMap.get(g).stream())
            .collect(Collectors.toList());

        LOG.debug("Building client '{}' with feature groups {}, features {} {}, and config '{}'", clientName, featureGroups, features, classFeatures, jaxRsConfig);
        features.forEach(builder::register);
        classFeatures.forEach(builder::register);

        return builder;
    }
773394
public static <E> JpaRepositoryConfig<E> create(Class<E> entityClass) {
        return builder(entityClass).build();
    }
1222746
private Configuration createDriverConfiguration(final Configuration driverConfiguration) {
    final ConfigurationBuilder configurationBuilder = Tang.Factory.getTang()
        .newConfigurationBuilder(driverConfiguration);
    for (final ConfigurationProvider configurationProvider : this.configurationProviders) {
      configurationBuilder.addConfiguration(configurationProvider.getConfiguration());
    }
    return configurationBuilder.build();
  }
1144343
@Singleton
    @Primary
    @Requires(classes = JaegerTracer.Builder.class)
    JaegerTracer.Builder jaegerTracerBuilder(Configuration configuration) {
        JaegerTracer.Builder tracerBuilder = resolveBuilder(configuration);
        if (this.configuration.isExpandExceptionLogs()) {
            tracerBuilder.withExpandExceptionLogs();
        }
        if (this.configuration.isZipkinSharedRpcSpan()) {
            tracerBuilder.withZipkinSharedRpcSpan();
        }
        if (reporter != null) {
            tracerBuilder.withReporter(reporter);
        }
        if (sampler != null) {
            tracerBuilder.withSampler(sampler);
        }
        return tracerBuilder;
    }
1086021
protected org.apache.http.impl.client.HttpClientBuilder customizeBuilder(
        org.apache.http.impl.client.HttpClientBuilder builder
    ) {
        return builder;
    }
1003276
public static ConfigBuilder configBuilder() {
    return new ConfigBuilder(new StringReader(""), new StringWriter(),
        EMPTY_CONNECTION_FACTORY, EMPTY_COMMAND_HANDLER,
        EMPTY_PROPERTY_HANDLER, EMPTY_ENV, DEFAULT_MAX_STACK_LENGTH);
  }
793498
public static ComponentFactory create(InputStream configuration) {
    ComponentFactory factory = null;
    factory = new ComponentFactory(LanguageConfigurationUtil.get(configuration));
    return factory;
  }
1363438
@Override
    public Builder<K, V> toBuilder() {
        return new Builder<K, V>(metadata, key, value);
    }
885402
public static<T> ServiceInstanceBuilder<T>builder() throws Exception
    {
        String                  address = null;
        Collection<InetAddress> ips = ServiceInstanceBuilder.getAllLocalIPs();
        if ( ips.size() > 0 )
        {
            address = ips.iterator().next().getHostAddress();   // default to the first address
        }

        String                  id = UUID.randomUUID().toString();

        return new ServiceInstanceBuilder<T>().address(address).id(id).registrationTimeUTC(System.currentTimeMillis());
    }