diff --git a/common/source/java/ch/systemsx/cisd/common/collections/CollectionStyle.java b/common/source/java/ch/systemsx/cisd/common/collections/CollectionStyle.java index 35783b9113a57124686f748c5ceba8834ec17812..f3a4787a8efedfe61dd5dfa1e701eb3e34f9129b 100644 --- a/common/source/java/ch/systemsx/cisd/common/collections/CollectionStyle.java +++ b/common/source/java/ch/systemsx/cisd/common/collections/CollectionStyle.java @@ -24,8 +24,7 @@ package ch.systemsx.cisd.common.collections; public enum CollectionStyle { /** Default <code>CollectionStyle</code>. */ - DEFAULT_COLLECTION_STYLE("[", "]", ", "), NO_BOUNDARY_COLLECTION_STYLE("", "", ", "), - NICE_COLLECTION_STYLE("'", "'", "', '"); + DEFAULT("[", "]", ", "), NO_BOUNDARY("", "", ", "), SINGLE_QUOTE_BOUNDARY("'", "'", "', '"); private final String collectionStart; diff --git a/common/source/java/ch/systemsx/cisd/common/collections/CollectionUtils.java b/common/source/java/ch/systemsx/cisd/common/collections/CollectionUtils.java index 1d627dcc727fc4c9e05f204416be2eddf8a291e6..8eddbfee82e8b3e7fdd5edc1485f82eb2ef36e54 100644 --- a/common/source/java/ch/systemsx/cisd/common/collections/CollectionUtils.java +++ b/common/source/java/ch/systemsx/cisd/common/collections/CollectionUtils.java @@ -36,7 +36,7 @@ public final class CollectionUtils * Abbreviates a given array of <code>Object</code>. * <p> * By default it shows the number of items left, - * {@link CollectionStyle#DEFAULT_COLLECTION_STYLE} and {@link ToStringDefaultConverter} are + * {@link CollectionStyle#DEFAULT} and {@link ToStringDefaultConverter} are * used. * </p> * @@ -52,7 +52,7 @@ public final class CollectionUtils * Abbreviates a given <code>Collection</code>. * <p> * By default it shows the number of items left, - * {@link CollectionStyle#DEFAULT_COLLECTION_STYLE} and {@link ToStringDefaultConverter} are + * {@link CollectionStyle#DEFAULT} and {@link ToStringDefaultConverter} are * used. * </p> * @@ -107,7 +107,7 @@ public final class CollectionUtils final IToStringConverter<? super T> converter) { return abbreviate(collection, maxLength, converter, - CollectionStyle.DEFAULT_COLLECTION_STYLE); + CollectionStyle.DEFAULT); } /** @@ -128,7 +128,7 @@ public final class CollectionUtils /** * Abbreviates a given array of <code>Object</code>. * <p> - * By default {@link CollectionStyle#DEFAULT_COLLECTION_STYLE} and + * By default {@link CollectionStyle#DEFAULT} and * {@link ToStringDefaultConverter} are used. * </p> * @@ -144,7 +144,7 @@ public final class CollectionUtils /** * Abbreviates a given <code>Collection</code>. * <p> - * By default {@link CollectionStyle#DEFAULT_COLLECTION_STYLE} and + * By default {@link CollectionStyle#DEFAULT} and * {@link ToStringDefaultConverter} are used. * </p> * @@ -160,7 +160,7 @@ public final class CollectionUtils /** * Abbreviates a given array of <code>Object</code>. * <p> - * By default {@link CollectionStyle#DEFAULT_COLLECTION_STYLE} is used. + * By default {@link CollectionStyle#DEFAULT} is used. * </p> * * @param maxLength the maximum number of items that should be shown. If <code>-1</code> then @@ -170,25 +170,25 @@ public final class CollectionUtils final boolean showLeft, final IToStringConverter<? super T> converter) { return abbreviate(objects, maxLength, showLeft, converter, - CollectionStyle.DEFAULT_COLLECTION_STYLE); + CollectionStyle.DEFAULT); } /** * Abbreviates a given array of <code>Object</code>. * <p> - * {@link CollectionStyle#DEFAULT_COLLECTION_STYLE} is used and all items is displayed. + * {@link CollectionStyle#DEFAULT} is used and all items is displayed. * </p> */ public final static <T> String abbreviate(final T[] objects, final IToStringConverter<? super T> converter) { - return abbreviate(objects, -1, false, converter, CollectionStyle.DEFAULT_COLLECTION_STYLE); + return abbreviate(objects, -1, false, converter, CollectionStyle.DEFAULT); } /** * Abbreviates a given <code>Collection</code>. * <p> - * By default {@link CollectionStyle#DEFAULT_COLLECTION_STYLE} is used. + * By default {@link CollectionStyle#DEFAULT} is used. * </p> * * @param maxLength the maximum number of items that should be shown. If <code>-1</code> then @@ -198,7 +198,7 @@ public final class CollectionUtils final boolean showLeft, final IToStringConverter<? super T> converter) { return abbreviate(collection, maxLength, showLeft, converter, - CollectionStyle.DEFAULT_COLLECTION_STYLE); + CollectionStyle.DEFAULT); } /** diff --git a/common/source/java/ch/systemsx/cisd/common/parser/MandatoryPropertyMissingException.java b/common/source/java/ch/systemsx/cisd/common/parser/MandatoryPropertyMissingException.java index c9042342c27ee4ae38681d3c8b3146f37a8fb5ba..f4c5c7ded002f8713dca37207672ba8602bbc86b 100644 --- a/common/source/java/ch/systemsx/cisd/common/parser/MandatoryPropertyMissingException.java +++ b/common/source/java/ch/systemsx/cisd/common/parser/MandatoryPropertyMissingException.java @@ -58,7 +58,7 @@ public final class MandatoryPropertyMissingException extends ParserException final static String toString(final Set<String> set) { - return CollectionUtils.abbreviate(set, -1, CollectionStyle.NO_BOUNDARY_COLLECTION_STYLE); + return CollectionUtils.abbreviate(set, -1, CollectionStyle.NO_BOUNDARY); } public final Set<String> getMissingMandatoryProperties() diff --git a/common/sourceTest/java/ch/systemsx/cisd/common/collections/CollectionUtilsTest.java b/common/sourceTest/java/ch/systemsx/cisd/common/collections/CollectionUtilsTest.java index 2507007ae71707b16435ba603db15235941e9834..cc1494761368e3ce632ba6638b10b0359dc39ef4 100644 --- a/common/sourceTest/java/ch/systemsx/cisd/common/collections/CollectionUtilsTest.java +++ b/common/sourceTest/java/ch/systemsx/cisd/common/collections/CollectionUtilsTest.java @@ -59,7 +59,7 @@ public final class CollectionUtilsTest public final void testAbbreviateWithArray() { final String[] s = StringUtilities.getStrings(5); - final CollectionStyle collectionStyle = CollectionStyle.DEFAULT_COLLECTION_STYLE; + final CollectionStyle collectionStyle = CollectionStyle.DEFAULT; String string = collectionStyle.getCollectionStart() + StringUtils.join(s, collectionStyle.getCollectionSeparator())