Example usage for org.apache.commons.lang ArrayUtils add

List of usage examples for org.apache.commons.lang ArrayUtils add

Introduction

In this page you can find the example usage for org.apache.commons.lang ArrayUtils add.

Prototype

public static short[] add(short[] array, short element) 

Source Link

Document

Copies the given array and adds the given element at the end of the new array.

Usage

From source file:com.thoughtworks.go.util.ArrayUtil.java

@SuppressWarnings("unchecked")
public static <T> T[] addToArray(T[] array, T nextOne) {
    return (T[]) ArrayUtils.add(array, nextOne);
}

From source file:com.sap.prd.mobile.ios.mios.CodeSignManager.java

public static void sign(String codeSignIdentity, File appFolder, boolean force) throws IOException {
    String[] cmd = new String[] { "/usr/bin/codesign", "--preserve-metadata", "-s",
            "\"" + codeSignIdentity + "\"", "\"" + appFolder.getAbsolutePath() + "\"" };
    if (force) {//from ww  w  .j  av a2 s .  c  o  m
        cmd = (String[]) ArrayUtils.add(cmd, "-f");
    }
    ExecResult exec = exec(cmd);
    checkExitValue(exec);
}

From source file:de.maklerpoint.office.Tags.Tags.java

/**
 * // w w  w.  j a v a 2s.c o m
 * @param tag 
 */
public static void addTag(TagObj tag) {
    Preferences prefs = Preferences.userRoot().node(Tags.class.getName());
    String taglist = prefs.get("tagListe", "Standard,ffentlich,Wichtig,Dienstlich,Persnlich");

    String[] result = taglist.split(",");

    if (result == null) {
        return;
    }

    String[] clean = (String[]) ArrayUtils.add(result, tag.getName());
    prefs.put("tagListe", ArrayStringTools.arrayToString(clean, ","));

    prefs.put("tag" + tag.getName(), tag.getTagColor() + "," + tag.getFontColor());

    InitializeTags.loadTags();
}

From source file:gda.data.scan.datawriter.scannablewriter.StringComponentWriter.java

@Override
protected int[] slabSizeForWriting(final int[] dim, final int slablength) {

    final int[] onedimfordim = slabsizedimfordim(dim);

    if (onedimfordim.length < rank) {
        return ArrayUtils.add(onedimfordim, slablength);

    } else {//from w w  w .ja va2  s. co  m
        onedimfordim[onedimfordim.length - 1] = slablength;
        return onedimfordim;
    }
}

From source file:info.magnolia.jcr.node2bean.BeanWithArrayAndAdder.java

public void addMessage(String message) {
    this.messages = (String[]) ArrayUtils.add(this.messages, message);
}

From source file:gda.device.detector.DummyBufferedDetector.java

/**
 * For use by the DummyContinuousScannable class when testing / simulating this sub-system.
 *///from  w  ww . j  a  v a  2s.co  m
@Override
public void addPoint() {
    storedFrames = (int[][]) ArrayUtils.add(storedFrames, createFrame(numberFrames));
    numberFrames++;
}

From source file:gda.data.scan.datawriter.scannablewriter.StringComponentWriter.java

@Override
protected int[] putslabdimfordim(final int[] dim) {
    return ArrayUtils.add(dim, 0);
}

From source file:gda.data.scan.datawriter.scannablewriter.StringComponentWriter.java

@Override
protected byte[] getComponentSlab(final Object pos) {
    return ArrayUtils.add(pos.toString().getBytes(UTF8), (byte) 0);
}

From source file:com.thoughtworks.go.server.database.SqlMapClientFactory.java

private Resource[] addToConfigLocations(Resource[] configLocations, String ibatisConfigXmlLocation) {
    if (StringUtils.isBlank(ibatisConfigXmlLocation)) {
        return configLocations;
    }//from  ww w .java2  s  .com
    return (Resource[]) ArrayUtils.add(configLocations, new ClassPathResource(ibatisConfigXmlLocation));
}

From source file:info.magnolia.content2bean.BeanWithArrayAndAdder.java

public void addBeans(SimpleBean bean) {
    beans = (SimpleBean[]) ArrayUtils.add(beans, bean);
}