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

public static <E> ImmutableList<E> of(E e1, E e2) 

Source Link

Usage

From source file:com.yahoo.yqlplus.engine.internal.plan.types.base.MapEntryTypeWidget.java

@Override
public PropertyAdapter getPropertyAdapter() {
    return new ClosedPropertyAdapter(this, ImmutableList.of(new PropertyAdapter.Property("key", keyType),
            new PropertyAdapter.Property("value", valueType))) {

        @Override//from w  w  w.  j  a  v  a  2 s .  c  o m
        protected AssignableValue getPropertyValue(BytecodeExpression target, String propertyName) {
            if ("key".equalsIgnoreCase(propertyName)) {
                return new CastAssignableValue(keyType, new MethodAssignableValue(AnyTypeWidget.getInstance(),
                        Map.Entry.class, "getKey", target));
            } else if ("value".equalsIgnoreCase(propertyName)) {
                return new CastAssignableValue(valueType, new MethodAssignableValue(AnyTypeWidget.getInstance(),
                        Map.Entry.class, "getValue", target));
            } else {
                throw new PropertyNotFoundException("Map.Entry does not have property '%s'", propertyName);
            }
        }
    };
}