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.netflix.metacat.common.type.TypeUtils.java

/**
 * parameterizedTypeName.// www.  j a  v  a 2  s .  c  o m
 *
 * @param baseType      baseType
 * @param argumentNames args
 * @return type signature
 */
public static TypeSignature parameterizedTypeSignature(final TypeEnum baseType,
        final TypeSignature... argumentNames) {
    return new TypeSignature(baseType, ImmutableList.copyOf(argumentNames), ImmutableList.of());
}

From source file:com.facebook.buck.test.FakeTestResults.java

public static TestResults of(Iterable<? extends TestCaseSummary> testCases) {
    return withTestLogs(testCases, ImmutableList.of());
}

From source file:utils.FakeServiceClient.java

public static F.Promise<SearchResults> callSearchResults(final int vehicleId, final int secsDelayed,
        boolean boom) {
    return wsCallGet("searchResults", vehicleId, secsDelayed, boom).map(response -> response.getBody())
            .map(str -> Json.fromJson(Json.parse(str), SearchResults.class))
            .recover(t -> new SearchResults("", 0, ImmutableList.of()));
}

From source file:org.asoem.greyfish.utils.collect.Chains.java

public static <T> Iterable<T> of(@Nullable final T root,
        final Function<? super T, ? extends T> nextElementFunction) {
    checkNotNull(nextElementFunction);// ww  w  .  jav  a  2s .  c om

    if (root == null) {
        return ImmutableList.of();
    } else {
        return new Iterable<T>() {
            @Override
            public Iterator<T> iterator() {
                return new AbstractIterator<T>() {
                    T next = root;

                    @Override
                    protected T computeNext() {
                        if (next == null) {
                            return endOfData();
                        } else {
                            final T ret = next;
                            next = nextElementFunction.apply(next);
                            return ret;
                        }
                    }
                };
            }
        };
    }
}

From source file:com.mysema.query.types.TemplateExpressionImpl.java

public static <C> Expression<C> create(Class<C> cl, String template) {
    return new TemplateExpressionImpl<C>(cl, TemplateFactory.DEFAULT.create(template), ImmutableList.of());
}

From source file:com.wrmsr.wava.java.lang.JTypeSpecifier.java

public static JTypeSpecifier of(String... parts) {
    return new JTypeSpecifier(JQualifiedName.of((Object[]) parts), ImmutableList.of());
}

From source file:org.onosproject.store.resource.impl.ContinuousResourceAllocation.java

static ContinuousResourceAllocation empty(ContinuousResource original) {
    return new ContinuousResourceAllocation(original, ImmutableList.of());
}

From source file:org.glowroot.common.ClassNames.java

public static ImmutableList<String> fromInternalNames(String /*@Nullable*/[] internalNames) {
    if (internalNames == null) {
        return ImmutableList.of();
    }//from  www.j a v  a2  s . c  o m
    List<String> classNames = Lists.newArrayList();
    for (String internalName : internalNames) {
        classNames.add(internalName.replace('/', '.'));
    }
    return ImmutableList.copyOf(classNames);
}

From source file:buildcraft.lib.inventory.InventoryIterator.java

public static Iterable<IInvSlot> getIterable(ICapabilityProvider provider, EnumFacing side) {
    IItemHandler itemHandler = provider.getCapability(CapUtil.CAP_ITEMS, side);
    if (itemHandler != null) {
        return new InventoryIteratorHandler(itemHandler);
    } else if (provider instanceof IInventory) {
        return getIterable((IInventory) provider, side);
    } else {//from   w w  w .j ava 2  s. c o  m
        return ImmutableList.of();
    }
}

From source file:com.spotify.heroic.metric.WriteMetric.java

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