/** * Factory method to create an unmodifiable collection. * <p> * If the collection passed in is already unmodifiable, it is returned. * * @param coll the collection to decorate, must not be null * @return an unmodifiable collection * @throws IllegalArgumentException if collection is null */ public static Collection decorate(Collection coll) { if (coll instanceof Unmodifiable) { return coll; } return new UnmodifiableCollection(coll); }
/** * Factory method to create an unmodifiable collection. * <p> * If the collection passed in is already unmodifiable, it is returned. * * @param coll the collection to decorate, must not be null * @return an unmodifiable collection * @throws IllegalArgumentException if collection is null */ public static Collection decorate(Collection coll) { if (coll instanceof Unmodifiable) { return coll; } return new UnmodifiableCollection(coll); }
/** * Factory method to create an unmodifiable collection. * <p> * If the collection passed in is already unmodifiable, it is returned. * * @param coll the collection to decorate, must not be null * @return an unmodifiable collection * @throws IllegalArgumentException if collection is null */ public static Collection decorate(Collection coll) { if (coll instanceof Unmodifiable) { return coll; } return new UnmodifiableCollection(coll); }
/** * Factory method to create an unmodifiable collection. * <p> * If the collection passed in is already unmodifiable, it is returned. * * @param coll the collection to decorate, must not be null * @return an unmodifiable collection * @throws IllegalArgumentException if collection is null */ public static Collection decorate(Collection coll) { if (coll instanceof Unmodifiable) { return coll; } return new UnmodifiableCollection(coll); }
/** * Factory method to create an unmodifiable collection. * <p> * If the collection passed in is already unmodifiable, it is returned. * * @param coll the collection to decorate, must not be null * @return an unmodifiable collection * @throws IllegalArgumentException if collection is null */ public static Collection decorate(Collection coll) { if (coll instanceof Unmodifiable) { return coll; } return new UnmodifiableCollection(coll); }
/** * Factory method to create an unmodifiable collection. * <p> * If the collection passed in is already unmodifiable, it is returned. * * @param coll the collection to decorate, must not be null * @return an unmodifiable collection * @throws IllegalArgumentException if collection is null */ public static Collection decorate(Collection coll) { if (coll instanceof Unmodifiable) { return coll; } return new UnmodifiableCollection(coll); }
/** * Factory method to create an unmodifiable collection. * <p> * If the collection passed in is already unmodifiable, it is returned. * * @param coll the collection to decorate, must not be null * @return an unmodifiable collection * @throws IllegalArgumentException if collection is null */ public static Collection decorate(Collection coll) { if (coll instanceof Unmodifiable) { return coll; } return new UnmodifiableCollection(coll); }
public UnmodifiableCollection giveMeSomeUnmodifableCollection() { return new UnmodifiableCollection(new LinkedList()); }