All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.wizzardo.tools.reflection.Misc Maven / Gradle / Ivy

There is a newer version: 0.23
Show newest version
package com.wizzardo.tools.reflection;

import java.util.Collection;

/**
 * Created by wizzardo on 26/03/17.
 */
class Misc {

    static  StringBuilder join(StringBuilder sb, E[] arr, String separator) {
        int length = arr.length;
        for (int i = 0; i < length; i++) {
            if (i > 0)
                sb.append(separator);
            sb.append(arr[i]);
        }
        return sb;
    }

    static  StringBuilder join(StringBuilder sb, Collection arr, String separator) {
        boolean comma = false;
        for (E anArr : arr) {
            if (!comma)
                comma = true;
            else
                sb.append(separator);

            sb.append(anArr);
        }
        return sb;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy