Add items into list in one line using guava

    //@formatter:off
    final Builder<Resource> list = ImmutableList.<Resource>builder()
            .add(new ClassPathResource("/log4j.xml"))
            .add(new ClassPathResource("/upload-config.xml"))
            .add(new ClassPathResource("/upload-application.xml"))
            .add(new ClassPathResource("/upload-db"));
    //@formatter:on

 

你可能感兴趣的:(guava)