package digital.laboratory.platform.inspection.test;
/**
 @title LcTest
 @description
 @author xy
 @version 1.0
 @create 2023/12/14 17:10
 */

import digital.laboratory.platform.inspection.test.entity.UserInfo;
import org.junit.jupiter.api.Test;

import java.util.ArrayList;
import java.util.List;

public class LcTest {
    @Test
    void test1(){
        boolean t1=false;
        String t2="";
        t2=t1 ? "123":"234";
        System.out.println(t2);
    }
    @Test
    void test2(){
       List<String> testList1=new ArrayList<>();
        testList1.add("11");
        testList1.add("12");
        testList1.add("13");
        String tmp=getListFisrt(testList1);
        System.out.println("输出的数据"+tmp);
    }
    @Test
    void test3(){
        for (MyEnumTest value : MyEnumTest.values()) {
            System.out.println(value.getTypeName()+" 是 "+value.getTypeDes());
        }
    }
    @Test
    void test4(){
        UserInfo userInfo=new UserInfo();
        userInfo.setUserName("张三");
        userInfo.setId("1111");
        UserInfo userInfo1=setOtherProperty(userInfo);
        System.out.println("用户的属性如下："+userInfo1.getUserName()+"//"+userInfo1.getId()+"//"+userInfo1.getSex()+"//"+userInfo1.getAge());
    }
    private UserInfo setOtherProperty(UserInfo userInfo){
        userInfo.setSex("男人");
        userInfo.setAge(39);
        return userInfo;
    }
    private <T> T getListFisrt(List<T> data) {
        if (data == null || data.size() == 0) {
            return null;
        }
        return data.get(0);
    }
}
