List of usage examples for com.google.common.collect ImmutableList copyOf
public static <E> ImmutableList<E> copyOf(E[] elements)
From source file:com.cdancy.etcd.rest.domain.auth.UserDetails.java
@SerializedNames({ "user", "roles", "errorMessage" }) public static UserDetails create(String user, List<Role> roles, ErrorMessage errorMessage) { return new AutoValue_UserDetails(user, roles != null ? ImmutableList.copyOf(roles) : ImmutableList.<Role>of(), errorMessage); }
From source file:extrabiomes.helpers.ForestryModHelper.java
public static Collection<ItemStack> getLeaves() { return ImmutableList.copyOf(leaves); }
From source file:org.jclouds.etcd.domain.members.CreateMember.java
@SerializedNames({ "name", "peerURLs", "clientURLs" }) public static CreateMember create(String name, List<String> peerURLs, List<String> clientURLs) { if (clientURLs == null) clientURLs = ImmutableList.of(); return new AutoValue_CreateMember(name, ImmutableList.copyOf(peerURLs), ImmutableList.copyOf(clientURLs)); }
From source file:de.muspellheim.datenverteiler.fuzzylib.FuzzyVariable.java
public FuzzyVariable(String name, List<FuzzySet> fuzzySets) { this.name = name; this.fuzzySets = ImmutableList.copyOf(fuzzySets); }
From source file:codecrafter47.bungeetablistplus.util.ContextAwareOrdering.java
public static <Context, T> ContextAwareOrdering<Context, T> compound( Iterable<ContextAwareOrdering<Context, T>> comparators) { return new CompoundContextAwareOrdering<>(ImmutableList.copyOf(comparators)); }
From source file:com.google.errorprone.refaster.UClassType.java
public static UClassType create(String fullyQualifiedClass, UType... typeArguments) { return create(fullyQualifiedClass, ImmutableList.copyOf(typeArguments)); }
From source file:com.google.errorprone.refaster.UTry.java
static UTry create(Iterable<? extends UTree<?>> resources, UBlock block, Iterable<UCatch> catches, @Nullable UBlock finallyBlock) { return new AutoValue_UTry(ImmutableList.copyOf(resources), block, ImmutableList.copyOf(catches), finallyBlock);/*from w w w. j ava 2 s . c om*/ }
From source file:com.teradata.benchto.driver.utils.YamlUtils.java
public static List<String> asStringList(Object object) { if (!(object instanceof Iterable<?>)) { return ImmutableList.copyOf(Splitter.on(",").trimResults().omitEmptyStrings().split(object.toString())); } else {// w w w .ja va 2 s. c o m Iterable<?> iterable = (Iterable<?>) object; return StreamSupport.stream(iterable.spliterator(), false).map(Object::toString).collect(toList()); } }
From source file:com.facebook.presto.RowPageBuilder.java
public static RowPageBuilder rowPageBuilder(Type... types) { return rowPageBuilder(ImmutableList.copyOf(types)); }
From source file:de.monticore.symboltable.Symbols.java
public static <T extends Symbol> List<T> sortSymbolsByPosition(final Collection<T> unorderedSymbols) { final List<T> sortedSymbols = new ArrayList<>(unorderedSymbols); Collections.sort(sortedSymbols, (symbol1, symbol2) -> symbol1.getSourcePosition().compareTo(symbol2.getSourcePosition())); return ImmutableList.copyOf(sortedSymbols); }