💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 组件源码 ``` /** * <b>方法描述:</b> 增加元素 <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2018-05-11 11:51:56 <br/> * * @param c * 入参|集合|{@link java.util.Collection} * @param obj * 入参|元素|{@link Object} * @return 0 失败<br/> * 1 成功<br/> */ @Component(label = "增加元素", style = "判断型", type = "同步组件", comment = "集合或元素为空时返回错误", version = "1.0.0", deprecated = false, author = "admin", date = "2018-05-11 11:51:56") @InParams(param = { @Param(name = "c", comment = "集合", type = java.util.Collection.class), @Param(name = "obj", comment = "元素", type = Object.class) }) @Returns(returns = { @Return(id = "0", desp = "失败"), @Return(id = "1", desp = "成功") }) public static ResultBase P_add(Collection c, Object obj) { if (c == null) return ResultBase.newFailureResult("TPTC1002", "集合为空集合"); if (obj == null) return ResultBase.newFailureResult("TPTC1002", "添加元素为空"); c.add(obj); return ResultBase.newSuccessResult(); } ``` # 交易中组件使用方式 ![](https://img.kancloud.cn/0b/df/0bdf1ed625cf35be70ffdfa0b8b853d9_1865x867.png) # 参数说明及示例 ## 入口参数 集合:传入一个集合,示例: `[1,2,3]` 元素:添加进入集合的元素,示例: `5` > 注意:IDE 中集合和数组都以 [] 表示。