Java List First Item getDependenciesPrivate(List projects, boolean firstDependencies)

Here you can find the source of getDependenciesPrivate(List projects, boolean firstDependencies)

Description

get Dependencies Private

License

Apache License

Declaration

private static String getDependenciesPrivate(List<String> projects, boolean firstDependencies) 

Method Source Code

//package com.java2s;
/**//from  www  .ja  v a  2 s. com
 * Copyright 2014 SPeCS.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License. under the License.
 */

import java.util.List;

public class Main {
    private static String getDependenciesPrivate(List<String> projects, boolean firstDependencies) {

        if (projects.isEmpty()) {
            return "";
        }

        StringBuilder builder = new StringBuilder();

        // builder.append("depends=\"");

        // Append first
        if (!firstDependencies) {
            builder.append(",");
        }
        builder.append(getCompileTargetName(projects.get(0)));
        // Append remaining
        for (int i = 1; i < projects.size(); i++) {
            // for (String project : projects) {
            builder.append(",");
            builder.append(getCompileTargetName(projects.get(i)));
            // builder.append(getCompileTargetName(project));
        }
        // builder.append("\"");

        return builder.toString();
    }

    /**
     * The target name, which is "build_<PROJECT_NAME>".
     * 
     * @return
     */
    public static String getCompileTargetName(String projectName) {
        return "compile_" + projectName;
    }
}

Related

  1. firstUnique(List list)
  2. firstValue(List list)
  3. formatEJBQLObjectRangeRestriction(final String fieldName, final Object value1, final Object value2, final String paramName1, final String paramName2, List paramsName, List paramsValue, boolean firstRestriction)
  4. formatEJBQLObjectRestriction(final String fieldName, final Object value, final String paramName, List paramsName, List paramsValue, boolean firstRestriction)
  5. getAllButFirst(List list)
  6. getFirst(List c)
  7. getFirst(List l)
  8. getFirst(List list)
  9. getFirst(List list)

  10. HOME | Copyright © www.java2s.com 2016