Example usage for android.util Config clone

List of usage examples for android.util Config clone

Introduction

In this page you can find the example usage for android.util Config clone.

Prototype

@HotSpotIntrinsicCandidate
protected native Object clone() throws CloneNotSupportedException;

Source Link

Document

Creates and returns a copy of this object.

Usage

From source file:android.support.v7.widget.BaseLinearLayoutManagerTest.java

protected static List<Config> addConfigVariation(List<Config> base, String fieldName, Object... variations)
        throws CloneNotSupportedException, NoSuchFieldException, IllegalAccessException {
    List<Config> newConfigs = new ArrayList<Config>();
    Field field = Config.class.getDeclaredField(fieldName);
    for (Config config : base) {
        for (Object variation : variations) {
            Config newConfig = (Config) config.clone();
            field.set(newConfig, variation);
            newConfigs.add(newConfig);//from   ww w  .  j  a  v  a 2s  .co  m
        }
    }
    return newConfigs;
}