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

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

Introduction

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

Prototype

public static boolean[] clone(boolean[] array) 

Source Link

Document

Clones an array returning a typecast result and handling null.

Usage

From source file:org.fosstrak.llrp.commander.util.LLRPArrayConstraint.java

/**
 * Creates a new array constraint.//from ww  w.ja  v a  2s  .co m
 * <br/><br/>
 * <b>Example:</b> <br/>
 * To create a constraint that specifies that the array field <code>AntennaIDs</code> of the 
 * parameter <code>AISpec</code> must not be empty and has 0 as default value, use the following code: <br/>
 * <code>
 *   new LLRPArrayConstraint(
 *      "AISpec",
 *      "AntennaIDs",
 *      new int[]{0}),
 * </code>
 * 
 * @param messageOrParameterName the message/parameter this constraint is defined for
 * @param fieldName the name of the field this constraint is defined for
 * @param defaultValue a default value for the field this constraint is defined for
 */
public LLRPArrayConstraint(String messageOrParameterName, String fieldName, int[] defaultValue) {
    this.messageOrParameterName = messageOrParameterName;
    this.fieldName = fieldName;
    this.defaultValue = ArrayUtils.clone(defaultValue);
}

From source file:org.fosstrak.llrp.commander.util.LLRPRangeConstraint.java

/**
 * Creates a new range constraint. /*  ww  w.jav  a 2 s  . c  o  m*/
 * <br/><br/>
 * <b>Example:</b> <br/>
 * To create a constraint that specifies that the field <code>DurationPeriod</code> of the 
 * parameter <code>RFSurveySpecStopTrigger</code> must be greater than 0 if the enumeration
 * <code>StopTriggerType</code> has value <code>Duration</code>, use the following code: <br/>
 * <code>
 *    new LLRPRangeConstraint(
 *      "RFSurveySpecStopTrigger",
 *      "DurationPeriod",
 *      new Range[] {
 *         new Range(1, Integer.MAX_VALUE) 
 *      },
 *      "StopTriggerType",
 *      "Duration");
 * </code>
 * 
 * @param messageOrParameterName the name of the message/parameter this constraint is defined for
 * @param fieldName the name of the field this constraint is defined for
 * @param ranges an array of ranges; for a value to satisfy a constraint it must lie in
 * one of this ranges
 * @param preconditionedEnumerationName the name of the enumeration on which this constraint 
 * is dependent; use <code>null</code> if this constraint does not depend on any enumeration
 * @param preconditionedEnumerationValue the value of the enumeration on which this constraint 
 * is dependent; use <code>null</code> if this constraint does not depend on any enumeration
 */
public LLRPRangeConstraint(String messageOrParameterName, String fieldName, Range[] ranges,
        String preconditionedEnumerationName, String preconditionedEnumerationValue) {
    this.messageOrParameterName = messageOrParameterName;
    this.fieldName = fieldName;
    this.ranges = (Range[]) ArrayUtils.clone(ranges);
    this.preconditionedEnumerationName = preconditionedEnumerationName;
    this.preconditionedEnumerationValue = preconditionedEnumerationValue;
}

From source file:org.fosstrak.llrp.commander.views.TableViewPart.java

public void setColumnHeaders(String[] strings) {
    columnHeaders = (String[]) ArrayUtils.clone(strings);
}

From source file:org.fosstrak.llrp.commander.views.TableViewPart.java

public void setColumnLayouts(ColumnLayoutData[] data) {
    columnLayouts = (ColumnLayoutData[]) ArrayUtils.clone(data);
}

From source file:org.gluu.oxtrust.ldap.service.ImageRepository.java

public byte[] getBlankImage() {
    // findbugs: copy on return to not expose internal representation
    return ArrayUtils.clone(blankImage);
}

From source file:org.gluu.oxtrust.ldap.service.ImageRepository.java

public byte[] getBlankPhoto() {
    // findbugs: copy on return to not expose internal representation
    return ArrayUtils.clone(blankPhoto);
}

From source file:org.gluu.oxtrust.ldap.service.ImageRepository.java

public byte[] getBlankIcon() {
    return ArrayUtils.clone(blankIcon);
}

From source file:org.gradle.cache.internal.CacheVersion.java

public static CacheVersion of(int... components) {
    return new CacheVersion(ArrayUtils.clone(components));
}

From source file:org.hippoecm.hst.demo.jaxrs.model.ProductRepresentation.java

public ProductRepresentation represent(ProductBean bean) throws RepositoryException {
    super.represent(bean);
    this.brand = bean.getBrand();
    this.product = bean.getProduct();
    this.color = bean.getColor();
    this.type = bean.getType();
    this.price = bean.getPrice();
    this.tags = (String[]) ArrayUtils.clone(bean.getTags());
    return this;
}

From source file:org.jumpmind.symmetric.io.data.writer.AbstractBulkDatabaseWriterTest.java

protected void insertAndVerify(String[] values) {
    List<CsvData> data = new ArrayList<CsvData>();
    data.add(new CsvData(DataEventType.INSERT, (String[]) ArrayUtils.clone(values)));
    writeData(data);/*w  ww .j av a  2s  . co  m*/
    assertTestTableEquals(values[0], values);
}