/** Get the real List from a LazyList. * * @param list A LazyList returned from LazyList.add(Object) * @return The List of added items, which may be an EMPTY_LIST * or a SingletonList. * @param <E> the list entry type */ public static<E> List<E> getList(Object list) { return getList(list,false); }
@SuppressWarnings("unchecked") public static<E> ListIterator<E> listIterator(Object list) { if (list==null) { List<E> empty=Collections.emptyList(); return empty.listIterator(); } if (list instanceof List) return ((List<E>)list).listIterator(); List<E> l=getList(list); return l.listIterator(); }
@SuppressWarnings("unchecked") public static<E> Iterator<E> iterator(Object list) { if (list==null) { List<E> empty=Collections.emptyList(); return empty.iterator(); } if (list instanceof List) { return ((List<E>)list).iterator(); } List<E> l=getList(list); return l.iterator(); }
/** * Get the already parsed parts. * @return the parts that were parsed */ public Collection<Part> getParsedParts() { if (_parts == null) return Collections.emptyList(); Collection<List<Part>> values = _parts.values(); List<Part> parts = new ArrayList<>(); for (List<Part> o: values) { List<Part> asList = LazyList.getList(o, false); parts.addAll(asList); } return parts; }
return LazyList.getList(super.entrySet());
/** * Retrieve a lazy list of map entries associated with specified * internet address by taking into account the wildcard specifications. * * @param addr internet address * @return lazy list of map entries */ public Object getLazyMatches(String addr) { if (addr == null) return LazyList.getList(super.entrySet()); Object entries = null; for(Map.Entry<String, TYPE> entry: super.entrySet()) { if (_patterns.get(entry.getKey()).match(addr)) { entries = LazyList.add(entries,entry); } } return entries; }
/** * Parse, if necessary, the multipart data and return the list of Parts. * * @return the parts * @throws IOException if unable to get the parts */ public Collection<Part> getParts() throws IOException { if(!_parsed) parse(); throwIfError(); Collection<List<Part>> values = _parts.values(); List<Part> parts = new ArrayList<>(); for (List<Part> o: values) { List<Part> asList = LazyList.getList(o, false); parts.addAll(asList); } return parts; }
/** Get the real List from a LazyList. * * @param list A LazyList returned from LazyList.add(Object) * @return The List of added items, which may be an EMPTY_LIST * or a SingletonList. */ public static<E> List<E> getList(Object list) { return getList(list,false); }
/** Get multiple values. * Single valued entries are converted to singleton lists. * @param name The entry key. * @return Unmodifieable List of values. */ public List getValues(Object name) { return LazyList.getList(_map.get(name),true); }
/** Get multiple values. * Single valued entries are converted to singleton lists. * @param name The entry key. * @return Unmodifieable List of values. */ public List getValues(Object name) { return LazyList.getList(_map.get(name),true); }
/** Get multiple values. * Single valued entries are converted to singleton lists. * @param name The entry key. * @return Unmodifieable List of values. */ public List getValues(Object name) { return LazyList.getList(_map.get(name),true); }
/** Get multiple values. * Single valued entries are converted to singleton lists. * @param name The entry key. * @return Unmodifieable List of values. */ public List getValues(Object name) { return LazyList.getList(_map.get(name),true); }
@Override public String toString() { if (LazyList.size(nested)>0) return MultiException.class.getSimpleName()+ LazyList.getList(nested); return MultiException.class.getSimpleName()+"[]"; }
/** Get all entries matched by the path. * Best match first. * @param path Path to match * @return List of Map.Entry instances key=pathSpec */ public List getMatches(String path) { return LazyList.getList(getLazyMatches(path)); }
/** Get all entries matched by the path. * Best match first. * @param path Path to match * @return List of Map.Entry instances key=pathSpec */ public List getMatches(String path) { return LazyList.getList(getLazyMatches(path)); }
/** Get all entries matched by the path. * Best match first. * @param path Path to match * @return List of Map.Entry instances key=pathSpec */ public List getMatches(String path) { return LazyList.getList(getLazyMatches(path)); }
@Override public String toString() { if (LazyList.size(nested)>0) return MultiException.class.getSimpleName()+ LazyList.getList(nested); return MultiException.class.getSimpleName()+"[]"; }
/** Get all entries matched by the path. * Best match first. * @param path Path to match * @return List of Map.Entry instances key=pathSpec */ public List getMatches(String path) { return LazyList.getList(getLazyMatches(path)); }
@Override public String toString() { if (LazyList.size(nested)>0) return MultiException.class.getSimpleName()+ LazyList.getList(nested); return MultiException.class.getSimpleName()+"[]"; }
/** Get all entries matched by the path. * Best match first. * @param path Path to match * @return List of Map.Entry instances key=pathSpec */ public List getMatches(String path) { return LazyList.getList(getLazyMatches(path)); }