/** Checks if list contains a value. */ public static boolean listContains(SoyList list, SoyValue value) { return list.asJavaList().contains(value); }
/** Concatenates its arguments. */ public static List<SoyValueProvider> concatLists(List<SoyList> args) { ImmutableList.Builder<SoyValueProvider> flattened = ImmutableList.builder(); for (SoyList soyList : args) { flattened.addAll(soyList.asJavaList()); } return flattened.build(); }
/** * IMPORTANT: Do not use this method. Consider it internal to Soy. * * <p>Creates a new SoyEasyList initialized from a SoyList. * * @param list The list of initial values. * @return A new SoyEasyList initialized from the given SoyList. */ @Deprecated public SoyEasyList newEasyListFromList(SoyList list) { EasyListImpl result = new EasyListImpl(); for (SoyValueProvider provider : list.asJavaList()) { result.add(provider); } return result; }
/** * IMPORTANT: Do not use this method. Consider it internal to Soy. * * <p>Creates a new SoyEasyList initialized from a SoyList. * * @param list The list of initial values. * @return A new SoyEasyList initialized from the given SoyList. */ @Deprecated public SoyEasyList newEasyListFromList(SoyList list) { EasyListImpl result = new EasyListImpl(); for (SoyValueProvider provider : list.asJavaList()) { result.add(provider); } return result; }
params[i] = value.stringValue(); } else if (type == List.class) { params[i] = ((SoyList) value).asJavaList(); } else if (Message.class.isAssignableFrom(type)) { params[i] = type.cast(((SoyProtoValue) value).getProto());