Summary: @public Switches instance creation from `new YogaNode()` to `YogaNode.create()`. This allows for experimentation with different implementations, while maintaining API + ABI compatibility internally at FB, as well as for dependent projects in open source and elsewhere. Reviewed By: amir-shalem Differential Revision: D14122975 fbshipit-source-id: f194b146b7cd693dba1a7dafdf92d350e54cb179
40 lines
852 B
Java
40 lines
852 B
Java
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the LICENSE
|
|
* file in the root directory of this source tree.
|
|
*
|
|
*/
|
|
package com.facebook.yoga;
|
|
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
|
|
public class TestParametrization {
|
|
public static Iterable<NodeFactory> nodeFactories() {
|
|
NodeFactory nodeFactory = new NodeFactory() {
|
|
@Override
|
|
public YogaNode create() {
|
|
return YogaNode.create();
|
|
}
|
|
|
|
@Override
|
|
public YogaNode create(YogaConfig config) {
|
|
return YogaNode.create(config);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "JNI";
|
|
}
|
|
};
|
|
return Arrays.asList(nodeFactory);
|
|
}
|
|
|
|
|
|
public interface NodeFactory {
|
|
YogaNode create();
|
|
YogaNode create(YogaConfig config);
|
|
}
|
|
}
|