/** * Specify a default value. * * @param val List of values * * @return The same builder */ @SuppressWarnings("unchecked") public GenericCollectionPropertyBuilder<V, C> defaultValue(Collection<? extends V> val) { super.defaultValue(getDefaultValue(val)); return this; }
/** * Specify that the default value is an empty collection. * * @return The same builder */ public GenericCollectionPropertyBuilder<V, C> emptyDefaultValue() { return super.defaultValue(getDefaultValue(Collections.<V>emptyList())); }
/** * Specify default values. To specify an empty * default value, use {@link #emptyDefaultValue()}. * * @param head First value * @param tail Rest of the values * * @return The same builder */ @SuppressWarnings("unchecked") public GenericCollectionPropertyBuilder<V, C> defaultValues(V head, V... tail) { List<V> tmp = new ArrayList<>(tail.length + 1); tmp.add(head); tmp.addAll(Arrays.asList(tail)); return super.defaultValue(getDefaultValue(tmp)); }
/** * Specify that the default value is an empty collection. * * @return The same builder */ public GenericCollectionPropertyBuilder<V, C> emptyDefaultValue() { return super.defaultValue(getDefaultValue(Collections.<V>emptyList())); }
/** * Specify a default value. * * @param val List of values * * @return The same builder */ @SuppressWarnings("unchecked") public GenericCollectionPropertyBuilder<V, C> defaultValue(Collection<? extends V> val) { super.defaultValue(getDefaultValue(val)); return this; }
/** * Specify default values. To specify an empty * default value, use {@link #emptyDefaultValue()}. * * @param head First value * @param tail Rest of the values * * @return The same builder */ @SuppressWarnings("unchecked") public GenericCollectionPropertyBuilder<V, C> defaultValues(V head, V... tail) { List<V> tmp = new ArrayList<>(tail.length + 1); tmp.add(head); tmp.addAll(Arrays.asList(tail)); return super.defaultValue(getDefaultValue(tmp)); }