Example usage for com.google.common.collect ImmutableList of

List of usage examples for com.google.common.collect ImmutableList of

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableList of.

Prototype

@SuppressWarnings("unchecked")
    public static <E> ImmutableList<E> of() 

Source Link

Usage

From source file:com.microsoft.thrifty.schema.parser.ThriftFileElement.java

public static Builder builder(Location location) {
    return new AutoValue_ThriftFileElement.Builder().location(location).namespaces(ImmutableList.of())
            .includes(ImmutableList.of()).constants(ImmutableList.of()).typedefs(ImmutableList.of())
            .enums(ImmutableList.of()).structs(ImmutableList.of()).unions(ImmutableList.of())
            .exceptions(ImmutableList.of()).services(ImmutableList.of());
}

From source file:com.facebook.swift.codec.IsSetBean.java

public static IsSetBean createFull() {
    IsSetBean isSetBean = new IsSetBean();
    isSetBean.aBoolean = false;/*from   w ww. j  av a 2 s .  c om*/
    isSetBean.aByte = 0;
    isSetBean.aShort = 0;
    isSetBean.aInteger = 0;
    isSetBean.aLong = 0L;
    isSetBean.aDouble = 0.0d;
    isSetBean.aString = "";
    isSetBean.aStruct = new BonkField();
    isSetBean.aSet = ImmutableSet.of();
    isSetBean.aList = ImmutableList.of();
    isSetBean.aMap = ImmutableMap.of();

    return isSetBean;
}

From source file:com.spotify.heroic.metadata.FindSeries.java

public static FindSeries of() {
    return new FindSeries(ImmutableList.of(), ImmutableSet.of(), false);
}

From source file:org.caleydo.core.util.ExtensionUtils.java

/**
 * simple wrapper for creating all implementation instances of a given extension point
 *
 * @param extensionPoint//from  ww w  .java2 s  .  c  om
 * @param property
 *            the property which holds the class name, e.g. class
 * @param type
 *            the expected class type
 * @return
 */
public static <T> List<T> findImplementation(String extensionPoint, String property, Class<T> type) {
    if (noRegistry())
        return ImmutableList.of();
    Builder<T> factories = ImmutableList.builder();
    try {

        for (IConfigurationElement elem : RegistryFactory.getRegistry()
                .getConfigurationElementsFor(extensionPoint)) {
            final Object o = elem.createExecutableExtension(property);
            if (type.isInstance(o))
                factories.add(type.cast(o));
        }
    } catch (CoreException e) {
        log.error("can't find implementations of " + extensionPoint + " : " + property, e);
    }
    return factories.build();
}

From source file:com.tozny.mobiledemo.User.java

public User(String email, @Nullable String toznyId, @Nullable List<Device> devices) {
    this.email = email;
    this.toznyId = toznyId;
    this.devices = devices != null ? ImmutableList.copyOf(devices) : ImmutableList.of();
}

From source file:org.apache.james.jmap.model.SetFilterResponse.java

public static SetFilterResponse notUpdated(SetError error) {
    return new SetFilterResponse(ImmutableList.of(), ImmutableMap.of(SINGLETON, error));
}

From source file:com.spotify.heroic.suggest.TagSuggest.java

public static TagSuggest of() {
    return new TagSuggest(ImmutableList.of(), ImmutableList.of());
}

From source file:ro.cosu.vampires.server.actors.messages.workload.QueryWorkload.java

public static QueryWorkload all(User user) {
    return new AutoValue_QueryWorkload(ImmutableList.of(), user);
}

From source file:org.jclouds.googlecomputeengine.domain.Tags.java

@SerializedNames({ "fingerprint", "items" })
public static Tags create(String fingerprint, ImmutableList<String> items) { // Dictates the type when created from json!
    ImmutableList<String> empty = ImmutableList.of();
    return new AutoValue_Tags(fingerprint, items != null ? items : empty);
}

From source file:ai.grakn.graql.internal.gremlin.spanningtree.ExclusiveEdge.java

public static <T> ExclusiveEdge<T> of(DirectedEdge<T> edge, double weight) {
    return ExclusiveEdge.of(edge, ImmutableList.of(), weight);
}