/** * Factory method to create an unmodifiable set. * * @param set the set to decorate, must not be null * @throws IllegalArgumentException if set is null */ public static Set decorate(Set set) { if (set instanceof Unmodifiable) { return set; } return new UnmodifiableSet(set); }
/** * Factory method to create an unmodifiable set. * * @param set the set to decorate, must not be null * @throws IllegalArgumentException if set is null */ public static Set decorate(Set set) { if (set instanceof Unmodifiable) { return set; } return new UnmodifiableSet(set); }
/** * Factory method to create an unmodifiable set. * * @param set the set to decorate, must not be null * @throws IllegalArgumentException if set is null */ public static Set decorate(Set set) { if (set instanceof Unmodifiable) { return set; } return new UnmodifiableSet(set); }
/** * Factory method to create an unmodifiable set. * * @param set the set to decorate, must not be null * @throws IllegalArgumentException if set is null */ public static Set decorate(Set set) { if (set instanceof Unmodifiable) { return set; } return new UnmodifiableSet(set); }
import org.apache.commons.collections.set.UnmodifiableSet import scala.collection.JavaConverters._ val u = new UnmodifiableSet() val s = u.asScala.toSet println(s)
/** * Factory method to create an unmodifiable set. * * @param set the set to decorate, must not be null * @throws IllegalArgumentException if set is null */ public static Set decorate(Set set) { if (set instanceof Unmodifiable) { return set; } return new UnmodifiableSet(set); }
/** * Factory method to create an unmodifiable set. * * @param set the set to decorate, must not be null * @throws IllegalArgumentException if set is null */ public static Set decorate(Set set) { if (set instanceof Unmodifiable) { return set; } return new UnmodifiableSet(set); }
/** * Factory method to create an unmodifiable set. * * @param set the set to decorate, must not be null * @throws IllegalArgumentException if set is null */ public static Set decorate(Set set) { if (set instanceof Unmodifiable) { return set; } return new UnmodifiableSet(set); }