Summary: - Refactor tests for better modularity for future tests. - Add a positive check for child builder pattern. - Instead of returning MyComponent, return Component to mimic generated code better. Reviewed By: Katalune Differential Revision: D17684995 fbshipit-source-id: d0b851e34master
parent
e4a03889f3
commit
c68dc542b7
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* 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.litho.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.PARAMETER, ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
public @interface Prop {
|
||||
ResType resType() default ResType.NONE;
|
||||
|
||||
boolean optional() default false;
|
||||
|
||||
String varArg() default "";
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
/*
|
||||
* 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.litho.annotations;
|
||||
|
||||
public enum ResType {
|
||||
SOME,
|
||||
NONE
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* 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.litho.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.PARAMETER, ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
public @interface TreeProp {
|
||||
ResType resType() default ResType.NONE;
|
||||
|
||||
boolean optional() default false;
|
||||
}
|
Loading…
Reference in new issue