/* * 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 codetoanalyze.java.litho; import com.facebook.litho.Component; import com.facebook.litho.annotations.Prop; import com.facebook.litho.annotations.ResType; /** * using @Prop(resType = ..) allows you to set the Prop with any of .propname, .propnameRes, or * .propnameAttr */ public class ResPropComponent extends Component { @Prop(resType = ResType.SOME) Object prop; // implicitly non-optional with resType public Builder create() { return new Builder(); } public static class Builder extends Component.Builder { ResPropComponent mResPropComponent; public Builder prop(Object o) { this.mResPropComponent.prop = o; return this; } public Builder propRes(Object o) { this.mResPropComponent.prop = o; return this; } public Builder propAttr(Object o) { this.mResPropComponent.prop = o; return this; } public Builder propDip(Object o) { this.mResPropComponent.prop = o; return this; } public Builder propPx(Object o) { this.mResPropComponent.prop = o; return this; } public Builder propSp(Object o) { this.mResPropComponent.prop = o; return this; } public ResPropComponent build() { return mResPropComponent; } @Override public Builder getThis() { return this; } } }