Example usage for com.google.common.collect ImmutableList.Builder indexOf

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

Introduction

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

Prototype

@Override
    public int indexOf(@Nullable Object object) 

Source Link

Usage

From source file:com.facebook.presto.hive.BenchmarkHiveFileFormats.java

private static List<HiveColumnHandle> getHiveColumnHandles(TpchColumn<?>... tpchColumns) {
    ImmutableList.Builder<HiveColumnHandle> columns = ImmutableList.builder();
    for (TpchColumn<?> column : tpchColumns) {
        int ordinal = COLUMNS.indexOf(column);
        ObjectInspector inspector = getObjectInspector(column);
        HiveType hiveType = HiveType.valueOf(inspector.getTypeName());
        columns.add(new HiveColumnHandle("test", column.getColumnName(), hiveType, hiveType.getTypeSignature(),
                ordinal, false));//from   w w  w . ja v a  2  s  .  co  m
    }

    return columns.build();
}