List of usage examples for com.google.common.collect ImmutableList of
@SuppressWarnings("unchecked") public static <E> ImmutableList<E> of()
From source file:de.metas.ui.web.view.json.JSONViewOrderBy.java
public static final List<DocumentQueryOrderBy> unwrapList(final List<JSONViewOrderBy> jsonOrderBys) { if (jsonOrderBys == null || jsonOrderBys.isEmpty()) { return ImmutableList.of(); }//ww w . jav a2s. co m return jsonOrderBys.stream().map(jsonOrderBy -> unwrap(jsonOrderBy)).filter(orderBy -> orderBy != null) .collect(GuavaCollectors.toImmutableList()); }
From source file:com.querydsl.core.types.template.EnumTemplate.java
public static <T extends Enum<T>> EnumExpression<T> create(Class<T> type, String template) { return new EnumTemplate<T>(type, TemplateFactory.DEFAULT.create(template), ImmutableList.of()); }
From source file:com.cdancy.etcd.rest.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(); }//from w w w . j a va 2 s . c o m return new AutoValue_CreateMember(name, ImmutableList.copyOf(peerURLs), ImmutableList.copyOf(clientURLs)); }
From source file:com.querydsl.core.types.template.TimeTemplate.java
public static <T extends Comparable<?>> TimeTemplate<T> create(Class<T> type, String template) { return new TimeTemplate<T>(type, TemplateFactory.DEFAULT.create(template), ImmutableList.of()); }
From source file:com.querydsl.core.types.template.DateTemplate.java
public static <T extends Comparable<?>> DateExpression<T> create(Class<T> type, String template) { return new DateTemplate<T>(type, TemplateFactory.DEFAULT.create(template), ImmutableList.of()); }
From source file:de.metas.ui.web.view.json.JSONDocumentViewOrderBy.java
public static final List<DocumentQueryOrderBy> unwrapList(final List<JSONDocumentViewOrderBy> jsonOrderBys) { if (jsonOrderBys == null || jsonOrderBys.isEmpty()) { return ImmutableList.of(); }// w w w .ja v a 2 s . c o m return jsonOrderBys.stream().map(jsonOrderBy -> unwrap(jsonOrderBy)).filter(orderBy -> orderBy != null) .collect(GuavaCollectors.toImmutableList()); }
From source file:org.jclouds.etcd.domain.members.Member.java
@SerializedNames({ "id", "name", "peerURLs", "clientURLs" }) private static Member create(String id, String name, List<String> peerURLs, List<String> clientURLs) { if (clientURLs == null) clientURLs = ImmutableList.of(); return new AutoValue_Member(id, name, ImmutableList.copyOf(peerURLs), ImmutableList.copyOf(clientURLs)); }
From source file:com.cloudera.oryx.computation.common.records.Specs.java
public static List<Integer> getFieldIds(Spec spec, List<String> values) { if (values.isEmpty()) { return ImmutableList.of(); }/*from www. j av a 2 s . com*/ List<Integer> fieldIds = Lists.newArrayListWithExpectedSize(values.size()); if (spec == null || spec.getField(values.get(0)) == null) { for (String value : values) { try { fieldIds.add(Integer.valueOf(value)); } catch (NumberFormatException e) { throw new IllegalArgumentException("Did not recognize column ID: " + value); } } } else { for (String value : values) { FieldSpec f = spec.getField(value); if (f != null) { fieldIds.add(f.position()); } } } return fieldIds; }
From source file:com.spotify.heroic.metric.WriteMetric.java
private static WriteMetric of(final Long time) { return new WriteMetric(ImmutableList.of(), ImmutableList.of(time)); }
From source file:com.facebook.presto.sql.planner.optimizations.AggregationNodeUtils.java
public static AggregationNode.Aggregation count(FunctionManager functionManager) { return new AggregationNode.Aggregation(new FunctionResolution(functionManager).countFunction(), ImmutableList.of(), Optional.empty(), Optional.empty(), false, Optional.empty()); }