Example usage for org.apache.commons.lang3 StringUtils lowerCase

List of usage examples for org.apache.commons.lang3 StringUtils lowerCase

Introduction

In this page you can find the example usage for org.apache.commons.lang3 StringUtils lowerCase.

Prototype

public static String lowerCase(final String str) 

Source Link

Document

Converts a String to lower case as per String#toLowerCase() .

A null input String returns null .

 StringUtils.lowerCase(null)  = null StringUtils.lowerCase("")    = "" StringUtils.lowerCase("aBc") = "abc" 

Note: As described in the documentation for String#toLowerCase() , the result of this method is affected by the current locale.

Usage

From source file:it.larusba.integration.neo4j.jsonloader.transformer.UnrefactoredDomainBasedJsonTransformer.java

private String buildNodeLabel(String documentType, Map<String, Object> documentMap,
        JsonObjectDescriptorHelper objectDescriptorHelper) {

    String typeAttribute = (String) documentMap.get(objectDescriptorHelper.getTypeAttribute(documentType));

    if (StringUtils.isBlank(typeAttribute)) {
        typeAttribute = StringUtils.lowerCase(documentType);
    }/*w  ww  .  ja v  a  2 s . com*/

    return StringUtils.capitalize(typeAttribute);
}

From source file:com.adobe.acs.commons.hc.impl.HealthCheckStatusEmailer.java

/**
 * Gererates the plain-text email sections for sets of Health Check Execution Results.
 *
 * @param title The section title// w  ww.  j a va  2 s .co m
 * @param results the  Health Check Execution Results to render as plain text
 * @return the String for this section to be embedded in the e-mail
 */
protected String resultToPlainText(final String title, final List<HealthCheckExecutionResult> results) {
    final StringBuilder sb = new StringBuilder();

    sb.append(title);
    sb.append(System.lineSeparator());

    if (results.size() == 0) {
        sb.append("No " + StringUtils.lowerCase(title) + " could be found!");
        sb.append(System.lineSeparator());
    } else {
        sb.append(StringUtils.repeat("-", NUM_DASHES));
        sb.append(System.lineSeparator());

        for (final HealthCheckExecutionResult result : results) {
            sb.append(StringUtils.rightPad("[ " + result.getHealthCheckResult().getStatus().name() + " ]",
                    HEALTH_CHECK_STATUS_PADDING));
            sb.append("  ");
            sb.append(result.getHealthCheckMetadata().getTitle());
            sb.append(System.lineSeparator());
        }
    }

    return sb.toString();
}

From source file:com.jayway.restassured.itest.java.ContentTypeITest.java

private String toJetty9(String charset) {
    return StringUtils.lowerCase(StringUtils.remove(charset, " "));
}

From source file:com.ottogroup.bi.spqr.pipeline.MicroPipelineManagerTest.java

/**
 * Test case for {@link MicroPipelineManager#shutdownPipeline(String)} being provided
 * valid id as input which must reduce the number of registered pipelines as well as 
 * {@link MicroPipeline#shutdown()} must be called
 *///w ww .ja  v  a 2s.  c o m
@Test
public void testShutdownPipeline_withValidInput() throws Exception {
    MicroPipelineConfiguration cfg = new MicroPipelineConfiguration();
    cfg.setId("testExecutePipeline_withValidConfiguration");

    MicroPipeline pipeline = Mockito.mock(MicroPipeline.class);
    Mockito.when(pipeline.getId()).thenReturn(cfg.getId());

    MicroPipelineFactory factory = Mockito.mock(MicroPipelineFactory.class);
    Mockito.when(factory.instantiatePipeline(cfg, executorService)).thenReturn(pipeline);

    MicroPipelineManager manager = new MicroPipelineManager("id", factory, executorService);

    Assert.assertEquals("Values must be equal", StringUtils.lowerCase(StringUtils.trim(cfg.getId())),
            manager.executePipeline(cfg));
    Assert.assertEquals("Values must be equal", 1, manager.getNumOfRegisteredPipelines());

    Mockito.verify(factory).instantiatePipeline(cfg, executorService);

    manager.shutdownPipeline(cfg.getId());
    Assert.assertEquals("Values must be equal", 0, manager.getNumOfRegisteredPipelines());
    Mockito.verify(pipeline).shutdown();
}

From source file:com.ottogroup.bi.asap.pipeline.MicroPipeline.java

/**
 * Subscribes the {@link Component} referenced by the <i>subscriberId</i> to the {@link Component} referenced by the <i>publisherId</i>
 * @param subscriberId/* w  ww.  j  a  v  a 2s.co  m*/
 * @param publisherId
 * @throws RequiredInputMissingException
 * @throws UnknownComponentException
 * @throws IllegalComponentSubscriptionException thrown in case a component tries to subscribe itself to an {@link Emitter} or a {@link Source} tries to subscribe itself somewhere else
 */
public void subscribe(final String subscriberId, final String publisherId)
        throws RequiredInputMissingException, UnknownComponentException, IllegalComponentSubscriptionException {

    ///////////////////////////////////////////////////////////////////
    // validate input
    if (StringUtils.isBlank(subscriberId))
        throw new RequiredInputMissingException("Missing required input for 'subscriberId'");
    if (StringUtils.isBlank(publisherId))
        throw new RequiredInputMissingException("Missing required input for 'publisherId'");
    if (StringUtils.equalsIgnoreCase(subscriberId, publisherId))
        throw new IllegalComponentSubscriptionException("Self-subscriptions are not permitted [subscriberId='"
                + subscriberId + "', publisherId='" + publisherId + "']");
    //
    ///////////////////////////////////////////////////////////////////

    ///////////////////////////////////////////////////////////////////
    // ensure that the subscriber id does not reference a source component,
    // ensure that the publisher id does not reference an emitter component and
    // ensure that subscriber id and publisher id are different
    String sid = StringUtils.lowerCase(StringUtils.trim(subscriberId));
    String pid = StringUtils.lowerCase(StringUtils.trim(publisherId));

    if (this.sourceExecutors.containsKey(sid))
        throw new IllegalComponentSubscriptionException("Source component '" + subscriberId
                + "' is not allowed to subscribe itself to another component");
    if (this.emitterExecutors.containsKey(pid))
        throw new IllegalComponentSubscriptionException("Emitter component '" + publisherId
                + "' is not allowed to serve as publisher for another component");

    // execute subscription
    Mailbox subscriberMailbox = null;
    if (this.operatorExecutors.containsKey(sid)) {
        OperatorExecutor subscriber = this.operatorExecutors.get(sid);
        if (subscriber == null)
            throw new UnknownComponentException(
                    "Unknown component referenced by subscriberId '" + subscriberId + "'");
        subscriberMailbox = subscriber.getMailbox();
    } else if (this.emitterExecutors.containsKey(sid)) {
        EmitterExecutor subscriber = this.emitterExecutors.get(sid);
        if (subscriber == null)
            throw new UnknownComponentException(
                    "Unknown component referenced by subscriberId '" + subscriberId + "'");
        subscriberMailbox = subscriber.getMailbox();
    } else {
        throw new UnknownComponentException(
                "Unknown component referenced by subscriberId '" + subscriberId + "'");
    }

    if (this.operatorExecutors.containsKey(pid)) {
        OperatorExecutor publisher = this.operatorExecutors.get(pid);
        if (publisher == null)
            throw new UnknownComponentException(
                    "Unknown component referenced by publisherId '" + publisherId + "'");
        publisher.subscribe(sid, subscriberMailbox);
    } else if (this.sourceExecutors.containsKey(pid)) {
        SourceExecutor publisher = this.sourceExecutors.get(pid);
        if (publisher == null)
            throw new UnknownComponentException(
                    "Unknown component referenced by publisherId '" + publisherId + "'");
        publisher.subscribe(sid, subscriberMailbox);
    } else {
        throw new UnknownComponentException(
                "Unknown component referenced by publisherId '" + publisherId + "'");
    }
    //
    ///////////////////////////////////////////////////////////////////

}

From source file:com.sonicle.webtop.core.sdk.ServiceManifest.java

/**
 * Converts the package name into its path representation.
 * (eg. com.sonicle.webtop.mail -> com/sonicle/webtop/mail)
 * @return The value./*  w w  w  .ja  v  a 2  s. c  o m*/
 */
public String getJarPath() {
    return StringUtils.lowerCase(StringUtils.replace(getPackageName(), ".", "/"));
}

From source file:com.sonicle.webtop.core.sdk.ServiceManifest.java

/**
 * Converts the js package name into its path representation.
 * (eg. Sonicle.webtop.mail -> sonicle/webtop/mail)
 * @return The value./*from  w w  w  .j  av a2  s.c om*/
 */
public String getJsPath() {
    return StringUtils.lowerCase(StringUtils.replace(getJsPackageName(), ".", "/"));
}

From source file:com.ottogroup.bi.asap.pipeline.MicroPipeline.java

/**
 * Unsubscribes the referenced subscriber from the referenced publisher
 * @param subscriberId/*  w w w.j  ava  2 s .  co  m*/
 * @param publisherId
 * @throws RequiredInputMissingException
 */
public void unsubscribe(final String subscriberId, final String publisherId)
        throws RequiredInputMissingException, UnknownComponentException {

    ///////////////////////////////////////////////////////////////////
    // validate input
    if (StringUtils.isBlank(subscriberId))
        throw new RequiredInputMissingException("Missing required input for 'subscriberId'");
    if (StringUtils.isBlank(publisherId))
        throw new RequiredInputMissingException("Missing required input for 'publisherId'");
    //
    ///////////////////////////////////////////////////////////////////

    ///////////////////////////////////////////////////////////////////
    //
    String pid = StringUtils.lowerCase(StringUtils.trim(publisherId));

    if (this.sourceExecutors.containsKey(pid)) {
        SourceExecutor publisher = this.sourceExecutors.get(pid);
        if (publisher == null)
            throw new UnknownComponentException(
                    "Unknown component referenced by publisherId '" + publisherId + "'");
        publisher.unsubscribe(subscriberId);
    } else if (this.operatorExecutors.containsKey(pid)) {
        OperatorExecutor publisher = this.operatorExecutors.get(pid);
        if (publisher == null)
            throw new UnknownComponentException(
                    "Unknown component referenced by publisherId '" + publisherId + "'");
        publisher.unsubscribe(subscriberId);
    } else {
        throw new UnknownComponentException(
                "Unknown component referenced by publisherId '" + publisherId + "'");
    }

    //
    ///////////////////////////////////////////////////////////////////

    if (logger.isDebugEnabled())
        logger.debug("unsubscription [subscriberId=" + subscriberId + ", publisherId=" + publisherId + "]");
}

From source file:ca.on.oicr.pde.workflows.GATK3Workflow.java

@Override
public void buildWorkflow() {

    final String binDir = this.getWorkflowBaseDir() + "/bin/";
    final Boolean manualOutput = BooleanUtils.toBoolean(getProperty("manual_output"), "true", "false");
    final String queue = getOptionalProperty("queue", "");
    final String perl = getProperty("perl");
    final String java = getProperty("java");
    final String tabixDir = getProperty("tabix_dir");
    final String gatk = getOptionalProperty("gatk_jar", binDir);
    final String mergeVCFScript = binDir + "sw_module_merge_GATK_VCF.pl";
    final String gatkKey = getProperty("gatk_key");
    final String identifier = getProperty("identifier");
    final String refFasta = getProperty("ref_fasta");
    final String dbsnpVcf = getProperty("gatk_dbsnp_vcf");
    final Integer intervalPadding = hasPropertyAndNotNull("interval_padding")
            ? Integer.parseInt(getProperty("interval_padding"))
            : null;/*  w  ww .  j  a va 2  s  .c  om*/
    final String standCallConf = getProperty("stand_call_conf");
    final String standEmitConf = getProperty("stand_emit_conf");
    final Integer downsamplingCoverage = hasPropertyAndNotNull("downsampling_coverage")
            ? Integer.parseInt(getProperty("downsampling_coverage"))
            : null;
    final String downsamplingType = getOptionalProperty("downsampling_type", null);
    final Integer gatkHaplotypeCallerThreads = Integer.parseInt(getProperty("gatk_haplotype_caller_threads"));
    final Integer gatkHaplotypeCallerXmx = Integer.parseInt(getProperty("gatk_haplotype_caller_xmx"));
    final Integer gatkUnifiedGenotyperXmx = Integer.parseInt(getProperty("gatk_unified_genotyper_xmx"));
    final Integer gatkUnifiedGenotyperThreads = Integer.parseInt(getProperty("gatk_unified_genotyper_threads"));
    final Integer gatkOverhead = Integer.parseInt(getProperty("gatk_sched_overhead_mem"));
    final String haplotypeCallerParams = getOptionalProperty("gatk_haplotype_caller_params", null);
    final String unifiedGenotyperParams = getOptionalProperty("gatk_unified_genotyper_params", null);

    final List<String> intervalFilesList = Arrays
            .asList(StringUtils.split(getOptionalProperty("interval_files", ""), ","));
    final Set<String> intervalFiles = new HashSet<>(intervalFilesList);
    if (intervalFiles.size() != intervalFilesList.size()) {
        throw new RuntimeException("Duplicate interval_files detected");
    }

    final Set<String> chrSizes;
    if (hasProperty("chr_sizes")) {
        //chr_sizes has been set
        List<String> chrSizesList = Arrays.asList(StringUtils.split(getProperty("chr_sizes"), ","));
        chrSizes = new HashSet<>(chrSizesList);
        if (chrSizes.size() != chrSizesList.size()) {
            throw new RuntimeException("Duplicate chr_sizes detected.");
        }
    } else if (!intervalFiles.isEmpty()) {
        //chr_sizes not set, interval_files has been set - use interval files to calculate chrSizes
        try {
            chrSizes = BEDFileUtils.getChromosomes(intervalFiles);
        } catch (IOException ioe) {
            throw new RuntimeException(ioe);
        }
    } else {
        //chr_sizes and interval_files not set - can not calculate chrSizes
        chrSizes = new HashSet<>();
    }

    // one chrSize record is required, null will result in no parallelization
    if (chrSizes.isEmpty()) {
        chrSizes.add(null);
    }

    Multimap<VariantCaller, Pair<String, Job>> snvFiles = HashMultimap.create();
    Multimap<VariantCaller, Pair<String, Job>> indelFiles = HashMultimap.create();
    Multimap<VariantCaller, Pair<String, Job>> finalFiles = HashMultimap.create();
    for (String chrSize : chrSizes) {
        for (VariantCaller vc : variantCallers) {
            String workingDir = DATADIR + vc.toString() + "/";
            switch (vc) {
            case HAPLOTYPE_CALLER:
                //GATK Haplotype Caller ( https://www.broadinstitute.org/gatk/gatkdocs/org_broadinstitute_gatk_tools_walkers_haplotypecaller_HaplotypeCaller.php )
                HaplotypeCaller haplotypeCallerCommand = new HaplotypeCaller.Builder(java,
                        Integer.toString(gatkHaplotypeCallerXmx) + "g", TMPDIR, gatk, gatkKey, DATADIR)
                                .setInputBamFiles(inputBamFiles).setReferenceSequence(refFasta)
                                .setDbsnpFilePath(dbsnpVcf).setStandardCallConfidence(standCallConf)
                                .setStandardEmitConfidence(standEmitConf)
                                .setGenotypingMode(
                                        getOptionalProperty("haplotype_caller_genotyping_mode", null))
                                .setOutputMode(getOptionalProperty("haplotype_caller_output_mode", null))
                                .setOperatingMode(HaplotypeCaller.OperatingMode.VCF).addInterval(chrSize)
                                .addIntervalFiles(intervalFiles).setIntervalPadding(intervalPadding)
                                .setDownsamplingCoverageThreshold(downsamplingCoverage)
                                .setDownsamplingType(downsamplingType)
                                .setOutputFileName(
                                        "gatk" + (chrSize != null ? "." + chrSize.replace(":", "-") : ""))
                                .setNumCpuThreadsPerDataThread(gatkHaplotypeCallerThreads)
                                .setExtraParameters(haplotypeCallerParams).build();
                Job haplotypeCallerJob = this.getWorkflow().createBashJob("GATKHaplotypeCaller")
                        .setMaxMemory(Integer.toString((gatkHaplotypeCallerXmx + gatkOverhead) * 1024))
                        .setQueue(queue);
                haplotypeCallerJob.getCommand().setArguments(haplotypeCallerCommand.getCommand());

                finalFiles.put(vc, Pair.of(haplotypeCallerCommand.getOutputFile(), haplotypeCallerJob));
                break;

            case UNIFIED_GENOTYPER:
                //GATK Unified Genotyper (INDELS) ( https://www.broadinstitute.org/gatk/guide/tooldocs/org_broadinstitute_gatk_tools_walkers_genotyper_UnifiedGenotyper.php )
                UnifiedGenotyper indelsUnifiedGenotyperCommand = new UnifiedGenotyper.Builder(java,
                        Integer.toString(gatkUnifiedGenotyperXmx) + "g", TMPDIR, gatk, gatkKey, workingDir)
                                .setInputBamFiles(inputBamFiles).setReferenceSequence(refFasta)
                                .setDbsnpFilePath(dbsnpVcf).setStandardCallConfidence(standCallConf)
                                .setStandardEmitConfidence(standEmitConf).setGenotypeLikelihoodsModel("INDEL")
                                .setGroup("Standard").addInterval(chrSize).addIntervalFiles(intervalFiles)
                                .setIntervalPadding(intervalPadding)
                                .setDownsamplingCoverageThreshold(downsamplingCoverage)
                                .setDownsamplingType(downsamplingType)
                                .setOutputFileName(
                                        "gatk" + (chrSize != null ? "." + chrSize.replace(":", "-") : ""))
                                .setNumCpuThreadsPerDataThread(gatkUnifiedGenotyperThreads)
                                .setExtraParameters(unifiedGenotyperParams).build();
                Job indelsUnifiedGenotyperJob = this.getWorkflow().createBashJob("GATKUnifiedGenotyperIndel")
                        .setMaxMemory(Integer.toString((gatkUnifiedGenotyperXmx + gatkOverhead) * 1024))
                        .setQueue(queue);
                indelsUnifiedGenotyperJob.getCommand().setArguments(indelsUnifiedGenotyperCommand.getCommand());

                indelFiles.put(vc,
                        Pair.of(indelsUnifiedGenotyperCommand.getOutputFile(), indelsUnifiedGenotyperJob));

                //GATK Unified Genotyper (SNVS) ( https://www.broadinstitute.org/gatk/gatkdocs/org_broadinstitute_gatk_tools_walkers_genotyper_UnifiedGenotyper.php )
                UnifiedGenotyper snvsUnifiedGenotyperCommand = new UnifiedGenotyper.Builder(java,
                        Integer.toString(gatkUnifiedGenotyperXmx) + "g", TMPDIR, gatk, gatkKey, workingDir)
                                .setInputBamFiles(inputBamFiles).setReferenceSequence(refFasta)
                                .setDbsnpFilePath(dbsnpVcf).setStandardCallConfidence(standCallConf)
                                .setStandardEmitConfidence(standEmitConf).setGenotypeLikelihoodsModel("SNP")
                                .addInterval(chrSize).addIntervalFiles(intervalFiles)
                                .setIntervalPadding(intervalPadding)
                                .setDownsamplingCoverageThreshold(downsamplingCoverage)
                                .setDownsamplingType(downsamplingType)
                                .setOutputFileName(
                                        "gatk" + (chrSize != null ? "." + chrSize.replace(":", "-") : ""))
                                .setNumCpuThreadsPerDataThread(gatkUnifiedGenotyperThreads)
                                .setExtraParameters(unifiedGenotyperParams).build();
                Job snvsUnifiedGenotyperJob = this.getWorkflow().createBashJob("GATKUnifiedGenotyperSNV")
                        .setMaxMemory(Integer.toString((gatkUnifiedGenotyperXmx + gatkOverhead) * 1024))
                        .setQueue(queue);
                snvsUnifiedGenotyperJob.getCommand().setArguments(snvsUnifiedGenotyperCommand.getCommand());

                snvFiles.put(vc, Pair.of(snvsUnifiedGenotyperCommand.getOutputFile(), snvsUnifiedGenotyperJob));
                break;

            default:
                throw new RuntimeException("Unsupported mode: " + variantCallers.toString());
            }
        }
    }

    for (VariantCaller vc : variantCallers) {
        Collection<Pair<String, Job>> snvs = snvFiles.get(vc);
        Collection<Pair<String, Job>> indels = indelFiles.get(vc);
        Collection<Pair<String, Job>> all = finalFiles.get(vc);
        String workingDir = DATADIR + vc.toString() + "/";

        if (!snvs.isEmpty()) {
            MergeVcf mergeSnvsCommand = new MergeVcf.Builder(perl, mergeVCFScript, workingDir)
                    .addInputFiles(getLeftCollection(snvs)).build();
            Job mergeSnvsJob = this.getWorkflow().createBashJob("MergeRawSNVs").setMaxMemory("4096")
                    .setQueue(queue);
            mergeSnvsJob.getParents().addAll(getRightCollection(snvs));
            mergeSnvsJob.getCommand().setArguments(mergeSnvsCommand.getCommand());

            snvs.clear();
            snvs.add(Pair.of(mergeSnvsCommand.getOutputFile(), mergeSnvsJob));
        }

        if (!indels.isEmpty()) {
            MergeVcf mergeIndelsCommand = new MergeVcf.Builder(perl, mergeVCFScript, workingDir)
                    .addInputFiles(getLeftCollection(indels)).build();
            Job mergeIndelsJob = this.getWorkflow().createBashJob("MergeRawIndels").setMaxMemory("4096")
                    .setQueue(queue);
            mergeIndelsJob.getParents().addAll(getRightCollection(indels));
            mergeIndelsJob.getCommand().setArguments(mergeIndelsCommand.getCommand());

            indels.clear();
            indels.add(Pair.of(mergeIndelsCommand.getOutputFile(), mergeIndelsJob));
        }

        if (!snvs.isEmpty() && !indels.isEmpty() && all.isEmpty()) {
            MergeVcf mergeFinalCommand = new MergeVcf.Builder(perl, mergeVCFScript, workingDir)
                    .addInputFiles(getLeftCollection(snvs)).addInputFiles(getLeftCollection(indels)).build();
            Job mergeFinalJob = this.getWorkflow().createBashJob("MergeFinal").setMaxMemory("4096")
                    .setQueue(queue);
            mergeFinalJob.getParents().addAll(getRightCollection(snvs));
            mergeFinalJob.getParents().addAll(getRightCollection(indels));
            mergeFinalJob.getCommand().setArguments(mergeFinalCommand.getCommand());

            all.add(Pair.of(mergeFinalCommand.getOutputFile(), mergeFinalJob));
        } else if (snvs.isEmpty() && indels.isEmpty() && !all.isEmpty()) {
            if (all.size() > 1) {
                MergeVcf mergeFinalCommand = new MergeVcf.Builder(perl, mergeVCFScript, workingDir)
                        .addInputFiles(getLeftCollection(all)).build();
                Job mergeFinalJob = this.getWorkflow().createBashJob("MergeFinal").setMaxMemory("4096")
                        .setQueue(queue);
                mergeFinalJob.getParents().addAll(getRightCollection(all));
                mergeFinalJob.getCommand().setArguments(mergeFinalCommand.getCommand());

                all.clear();
                all.add(Pair.of(mergeFinalCommand.getOutputFile(), mergeFinalJob));
            } else {
                //there is one vcf, no need to merge
            }
        } else {
            throw new RuntimeException(
                    String.format("Unexpected state: snvs file = [%s], indels size = [%s], final size = [%s]",
                            snvs.size(), indels.size(), all.size()));
        }

        //Sort and compress the final vcf
        SortVcf sortVcfCommand = new SortVcf.Builder(workingDir)
                .setInputFile(Iterables.getOnlyElement(getLeftCollection(all)))
                .setOutputFileName(identifier + "." + StringUtils.lowerCase(vc.toString()) + ".raw").build();
        CompressAndIndexVcf compressIndexVcfCommand = new CompressAndIndexVcf.Builder(tabixDir, workingDir)
                .setInputFile(sortVcfCommand.getOutputFile()).build();
        List<String> cmd = new LinkedList<>();
        cmd.addAll(sortVcfCommand.getCommand());
        cmd.add("&&");
        cmd.addAll(compressIndexVcfCommand.getCommand());
        Job sortCompressIndexVcfJob = getWorkflow().createBashJob("SortCompressIndexVcf")
                .setMaxMemory(Integer.toString(4096)).setQueue(queue)
                .addParent(Iterables.getOnlyElement(getRightCollection(all)));
        sortCompressIndexVcfJob.getCommand().setArguments(cmd);

        //final output file
        SqwFile vcf = createOutputFile(compressIndexVcfCommand.getOutputVcfFile(), "application/vcf-4-gzip",
                manualOutput);
        SqwFile tbi = createOutputFile(compressIndexVcfCommand.getOutputTabixFile(), "application/tbi",
                manualOutput);
        vcf.getAnnotations().put(ANNOTKEY, vc.toString());
        tbi.getAnnotations().put(ANNOTKEY, vc.toString());
        sortCompressIndexVcfJob.addFile(vcf);
        sortCompressIndexVcfJob.addFile(tbi);
    }
}

From source file:io.swagger.codegen.languages.AbstractSwift3Codegen.java

@Override
public String toEnumVarName(String name, String datatype) {
    if (name.length() == 0) {
        return "empty";
    }// w  w  w .j  av  a 2 s. co m

    Pattern startWithNumberPattern = Pattern.compile("^\\d+");
    Matcher startWithNumberMatcher = startWithNumberPattern.matcher(name);
    if (startWithNumberMatcher.find()) {
        String startingNumbers = startWithNumberMatcher.group(0);
        String nameWithoutStartingNumbers = name.substring(startingNumbers.length());

        return "_" + startingNumbers + camelize(nameWithoutStartingNumbers, true);
    }

    // for symbol, e.g. $, #
    if (getSymbolName(name) != null) {
        return camelize(WordUtils.capitalizeFully(getSymbolName(name).toUpperCase()), true);
    }

    // Camelize only when we have a structure defined below
    Boolean camelized = false;
    if (name.matches("[A-Z][a-z0-9]+[a-zA-Z0-9]*")) {
        name = camelize(name, true);
        camelized = true;
    }

    // Reserved Name
    String nameLowercase = StringUtils.lowerCase(name);
    if (isReservedWord(nameLowercase)) {
        return escapeReservedWord(nameLowercase);
    }

    // Check for numerical conversions
    if ("Int".equals(datatype) || "Int32".equals(datatype) || "Int64".equals(datatype)
            || "Float".equals(datatype) || "Double".equals(datatype)) {
        String varName = "number" + camelize(name);
        varName = varName.replaceAll("-", "minus");
        varName = varName.replaceAll("\\+", "plus");
        varName = varName.replaceAll("\\.", "dot");
        return varName;
    }

    // If we have already camelized the word, don't progress
    // any further
    if (camelized) {
        return name;
    }

    char[] separators = { '-', '_', ' ', ':', '(', ')' };
    return camelize(
            WordUtils.capitalizeFully(StringUtils.lowerCase(name), separators).replaceAll("[-_ :\\(\\)]", ""),
            true);
}