Back to project page sugar.
The source code is released under:
Copyright (C) 2012 by Satya Narayan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the S...
If you think the Android project sugar listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.orm.util; import java.util.*; //w w w .j a v a 2 s. c o m public class Collection { public static <T> List<T> list(T... args) { return Arrays.asList(args); } public static <T> Set<T> set(T... args) { Set<T> result = new HashSet<T>(args.length); result.addAll(Arrays.asList(args)); return result; } public static <K, V> Map<K, V> map(Entry<? extends K, ? extends V>... entries) { Map<K, V> result = new HashMap<K, V>(entries.length); for (Entry<? extends K, ? extends V> entry : entries) if (entry.value != null) result.put(entry.key, entry.value); return result; } public static <K, V> Entry<K, V> entry(K key, V value) { return new Entry<K, V>(key, value); } public static class Entry<K, V> { K key; V value; public Entry(K key, V value) { this.key = key; this.value = value; } } }