Example usage for java.util List of

List of usage examples for java.util List of

Introduction

In this page you can find the example usage for java.util List of.

Prototype

static <E> List<E> of(E e1, E e2, E e3, E e4, E e5, E e6) 

Source Link

Document

Returns an unmodifiable list containing six elements.

Usage

From source file:org.diorite.config.serialization.SerializationTest.java

public static EntityStorage prepareObject() {
    EntityStorage entityStorage = new EntityStorage();
    {/* ww  w .  ja  v  a  2s.c  o m*/
        BeanObject beanObject = new BeanObject();
        beanObject.setIntProperty(53);
        beanObject.setStringProperty("some str\nnew line");
        LinkedHashMap<int[], int[]> map = new LinkedHashMap<>(3);
        map.put(new int[] { 1, 2, 3 }, new int[] { 11, 12, 13 });
        map.put(new int[] { 4, 5, 6 }, new int[] { 14, 15, 16 });
        map.put(new int[] { 7, 8, 9 }, new int[] { 17, 18, 19 });
        beanObject.setIntMap(map);
        beanObject.setList(List.of("some string", "more element", "and more", "dfihefk  fdspbwptn  ifd",
                "  dju jms jhkror ifjw  ", "du fjfne"));
        beanObject.setList2(List.of("some string", "more element", "and more", "some string", "more element",
                "and more", "dfihefk  fdspbwptn  ifd", "  dju jms jhkror ifjw  ", "du fjfne",
                "dfihefk  fdspbwptn  ifd", "  dju jms jhkror ifjw  ", "du fjfne"));
        entityStorage.beanObject = beanObject;
    }
    {
        AbstractEntityData entity = new CreeperEntityData("creeperName", 12, false, true, null);
        entity.metaObjects.add(new MetaObject("someMeta", new MetaValue("yup", 21)));
        entity.metaObjects.add(new MetaObject("someMeta2", new MetaValue("yup", 54)));
        SomeProperties someProperties = new SomeProperties();
        someProperties.prop.put("propertyName", "propertyValue");
        entity.propertiesCollection.add(someProperties);
        entity.uuidMetaObjectMap.put(UUID.randomUUID(),
                new MetaObject("specialMeta", new MetaValue("val", 12)));
        entityStorage.entityData.add(entity);
    }
    {
        AbstractEntityData entity = new SheepEntityData("sheepName", 12, false, 3, null);
        entity.metaObjects.add(new MetaObject("someMeta", new MetaValue("yup", 21)));
        entity.metaObjects.add(new MetaObject("someMeta2", new MetaValue("yup", 54)));
        SomeProperties someProperties = new SomeProperties();
        entity.propertiesCollection.add(someProperties);
        entity.uuidMetaObjectMap.put(UUID.randomUUID(),
                new MetaObject("specialMeta", new MetaValue("val", 12)));
        entityStorage.entityData.add(entity);
    }
    {
        AbstractEntityData entity = new CreeperEntityData("creeperName", 12, false, true, null);
        entityStorage.entityData.add(entity);
    }
    return entityStorage;
}