List of usage examples for com.google.common.collect ImmutableList copyOf
public static <E> ImmutableList<E> copyOf(E[] elements)
From source file:ch.piratenpartei.pivote.model.util.CollectionProperties.java
public static <T> List<T> copyOf(List<T> of) { if (of == null) { return null; } else {/*from w w w . j a v a 2 s . c o m*/ return ImmutableList.copyOf(of); } }
From source file:com.opengamma.strata.engine.config.ReportingRules.java
/** * Returns a rule that tries each of the delegate rules in turn and returns the first currency it finds. * * @param rules the delegate rules//from w ww . ja va 2 s . c om * @return a rule that tries each of the rules in turn and returns the first currency it finds */ public static ReportingRules of(ReportingRules... rules) { switch (rules.length) { case 0: return ReportingRules.empty(); case 1: return rules[0]; default: return CompositeReportingRules.builder().rules(ImmutableList.copyOf(rules)).build(); } }
From source file:org.kizombadev.markdownparser.utils.StringUtils.java
public static ImmutableList<Character> convertToCharacterArray(String value) { return ImmutableList.copyOf(ArrayUtils.toObject(value.toCharArray())); }
From source file:com.facebook.presto.operator.RowPageBuilder.java
public static RowPageBuilder rowPageBuilder(TupleInfo... tupleInfos) { return rowPageBuilder(ImmutableList.copyOf(tupleInfos)); }
From source file:com.google.template.soy.types.ast.RecordTypeNode.java
public static RecordTypeNode create(SourceLocation sourceLocation, Iterable<Property> properties) { return new AutoValue_RecordTypeNode(sourceLocation, ImmutableList.copyOf(properties)); }
From source file:com.cdancy.bitbucket.rest.utils.Utils.java
public static <T> List<T> nullToEmpty(Iterable<? extends T> input) { return (List<T>) (input == null ? ImmutableList.<T>of() : ImmutableList.copyOf(input)); }
From source file:com.opengamma.strata.calc.config.pricing.PricingRules.java
/** * Obtains an instance based on the specified individual rules. * * @param rules the individual rules// w w w . j a v a 2 s. com * @return the combined rules */ public static PricingRules of(PricingRule<?>... rules) { return DefaultPricingRules.of(ImmutableList.copyOf(rules)); }
From source file:org.trancecode.collection.TcLists.java
public static <T> List<T> immutableList(final Iterable<T> elements, final T newElement) { return ImmutableList.copyOf(Iterables.concat(elements, ImmutableList.of(newElement))); }
From source file:com.atlassian.jira.rest.client.api.domain.input.IssueInput.java
public static IssueInput createWithFields(FieldInput... fields) { return new IssueInput( Maps.uniqueIndex(ImmutableList.copyOf(fields), EntityHelper.GET_ENTITY_STRING_ID_FUNCTION)); }
From source file:com.google.caliper.runner.InMemoryResultsUploader.java
static ImmutableList<Trial> trials() { return ImmutableList.copyOf(trials); }