595 |
* of this method is Serializable. |
* of this method is Serializable. |
596 |
* |
* |
597 |
* @param o the single element. |
* @param o the single element. |
598 |
* @returns an immutable Set containing only o. |
* @return an immutable Set containing only o. |
599 |
*/ |
*/ |
600 |
// It's not serializable because the spec is broken. |
// It's not serializable because the spec is broken. |
601 |
public static Set singleton(final Object o) |
public static Set singleton(final Object o) |
645 |
* of this method is Serializable. |
* of this method is Serializable. |
646 |
* |
* |
647 |
* @param o the single element. |
* @param o the single element. |
648 |
* @returns an immutable List containing only o. |
* @return an immutable List containing only o. |
649 |
*/ |
*/ |
650 |
// It's not serializable because the spec is broken. |
// It's not serializable because the spec is broken. |
651 |
public static List singletonList(final Object o) |
public static List singletonList(final Object o) |
677 |
* |
* |
678 |
* @param key the single key. |
* @param key the single key. |
679 |
* @param value the single value. |
* @param value the single value. |
680 |
* @returns an immutable Map containing only the single key value pair. |
* @return an immutable Map containing only the single key value pair. |
681 |
*/ |
*/ |
682 |
// It's not serializable because the spec is broken. |
// It's not serializable because the spec is broken. |
683 |
public static Map singletonMap(final Object key, final Object value) |
public static Map singletonMap(final Object key, final Object value) |
686 |
{ |
{ |
687 |
public Set entrySet() |
public Set entrySet() |
688 |
{ |
{ |
689 |
return singleton(new HashMap.Entry(key, value)); |
return singleton(new BasicMapEntry(key, value)); |
690 |
} |
} |
691 |
}; |
}; |
692 |
} |
} |