Skip to content
Snippets Groups Projects
Commit 9e64ccf8 authored by ribeaudc's avatar ribeaudc
Browse files

change: - 'CollectionStyle.DEFAULT_COLLECTION_STYLE' -->...

change: - 'CollectionStyle.DEFAULT_COLLECTION_STYLE' --> 'CollectionStyle.DEFAULT', 'CollectionStyle.NO_BOUNDARY_COLLECTION_STYLE' ---> 'CollectionStyle.NO_BOUNDARY', 'CollectionStyle.NICE_COLLECTION_STYLE' ---> 'CollectionStyle.SINGLE_QUOTE_BOUNDARY'.

SVN: 5479
parent f417807c
No related branches found
No related tags found
No related merge requests found
...@@ -24,8 +24,7 @@ package ch.systemsx.cisd.common.collections; ...@@ -24,8 +24,7 @@ package ch.systemsx.cisd.common.collections;
public enum CollectionStyle public enum CollectionStyle
{ {
/** Default <code>CollectionStyle</code>. */ /** Default <code>CollectionStyle</code>. */
DEFAULT_COLLECTION_STYLE("[", "]", ", "), NO_BOUNDARY_COLLECTION_STYLE("", "", ", "), DEFAULT("[", "]", ", "), NO_BOUNDARY("", "", ", "), SINGLE_QUOTE_BOUNDARY("'", "'", "', '");
NICE_COLLECTION_STYLE("'", "'", "', '");
private final String collectionStart; private final String collectionStart;
......
...@@ -36,7 +36,7 @@ public final class CollectionUtils ...@@ -36,7 +36,7 @@ public final class CollectionUtils
* Abbreviates a given array of <code>Object</code>. * Abbreviates a given array of <code>Object</code>.
* <p> * <p>
* By default it shows the number of items left, * 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. * used.
* </p> * </p>
* *
...@@ -52,7 +52,7 @@ public final class CollectionUtils ...@@ -52,7 +52,7 @@ public final class CollectionUtils
* Abbreviates a given <code>Collection</code>. * Abbreviates a given <code>Collection</code>.
* <p> * <p>
* By default it shows the number of items left, * 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. * used.
* </p> * </p>
* *
...@@ -107,7 +107,7 @@ public final class CollectionUtils ...@@ -107,7 +107,7 @@ public final class CollectionUtils
final IToStringConverter<? super T> converter) final IToStringConverter<? super T> converter)
{ {
return abbreviate(collection, maxLength, converter, return abbreviate(collection, maxLength, converter,
CollectionStyle.DEFAULT_COLLECTION_STYLE); CollectionStyle.DEFAULT);
} }
/** /**
...@@ -128,7 +128,7 @@ public final class CollectionUtils ...@@ -128,7 +128,7 @@ public final class CollectionUtils
/** /**
* Abbreviates a given array of <code>Object</code>. * Abbreviates a given array of <code>Object</code>.
* <p> * <p>
* By default {@link CollectionStyle#DEFAULT_COLLECTION_STYLE} and * By default {@link CollectionStyle#DEFAULT} and
* {@link ToStringDefaultConverter} are used. * {@link ToStringDefaultConverter} are used.
* </p> * </p>
* *
...@@ -144,7 +144,7 @@ public final class CollectionUtils ...@@ -144,7 +144,7 @@ public final class CollectionUtils
/** /**
* Abbreviates a given <code>Collection</code>. * Abbreviates a given <code>Collection</code>.
* <p> * <p>
* By default {@link CollectionStyle#DEFAULT_COLLECTION_STYLE} and * By default {@link CollectionStyle#DEFAULT} and
* {@link ToStringDefaultConverter} are used. * {@link ToStringDefaultConverter} are used.
* </p> * </p>
* *
...@@ -160,7 +160,7 @@ public final class CollectionUtils ...@@ -160,7 +160,7 @@ public final class CollectionUtils
/** /**
* Abbreviates a given array of <code>Object</code>. * Abbreviates a given array of <code>Object</code>.
* <p> * <p>
* By default {@link CollectionStyle#DEFAULT_COLLECTION_STYLE} is used. * By default {@link CollectionStyle#DEFAULT} is used.
* </p> * </p>
* *
* @param maxLength the maximum number of items that should be shown. If <code>-1</code> then * @param maxLength the maximum number of items that should be shown. If <code>-1</code> then
...@@ -170,25 +170,25 @@ public final class CollectionUtils ...@@ -170,25 +170,25 @@ public final class CollectionUtils
final boolean showLeft, final IToStringConverter<? super T> converter) final boolean showLeft, final IToStringConverter<? super T> converter)
{ {
return abbreviate(objects, maxLength, showLeft, converter, return abbreviate(objects, maxLength, showLeft, converter,
CollectionStyle.DEFAULT_COLLECTION_STYLE); CollectionStyle.DEFAULT);
} }
/** /**
* Abbreviates a given array of <code>Object</code>. * Abbreviates a given array of <code>Object</code>.
* <p> * <p>
* {@link CollectionStyle#DEFAULT_COLLECTION_STYLE} is used and all items is displayed. * {@link CollectionStyle#DEFAULT} is used and all items is displayed.
* </p> * </p>
*/ */
public final static <T> String abbreviate(final T[] objects, public final static <T> String abbreviate(final T[] objects,
final IToStringConverter<? super T> converter) 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>. * Abbreviates a given <code>Collection</code>.
* <p> * <p>
* By default {@link CollectionStyle#DEFAULT_COLLECTION_STYLE} is used. * By default {@link CollectionStyle#DEFAULT} is used.
* </p> * </p>
* *
* @param maxLength the maximum number of items that should be shown. If <code>-1</code> then * @param maxLength the maximum number of items that should be shown. If <code>-1</code> then
...@@ -198,7 +198,7 @@ public final class CollectionUtils ...@@ -198,7 +198,7 @@ public final class CollectionUtils
final boolean showLeft, final IToStringConverter<? super T> converter) final boolean showLeft, final IToStringConverter<? super T> converter)
{ {
return abbreviate(collection, maxLength, showLeft, converter, return abbreviate(collection, maxLength, showLeft, converter,
CollectionStyle.DEFAULT_COLLECTION_STYLE); CollectionStyle.DEFAULT);
} }
/** /**
......
...@@ -58,7 +58,7 @@ public final class MandatoryPropertyMissingException extends ParserException ...@@ -58,7 +58,7 @@ public final class MandatoryPropertyMissingException extends ParserException
final static String toString(final Set<String> set) 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() public final Set<String> getMissingMandatoryProperties()
......
...@@ -59,7 +59,7 @@ public final class CollectionUtilsTest ...@@ -59,7 +59,7 @@ public final class CollectionUtilsTest
public final void testAbbreviateWithArray() public final void testAbbreviateWithArray()
{ {
final String[] s = StringUtilities.getStrings(5); final String[] s = StringUtilities.getStrings(5);
final CollectionStyle collectionStyle = CollectionStyle.DEFAULT_COLLECTION_STYLE; final CollectionStyle collectionStyle = CollectionStyle.DEFAULT;
String string = String string =
collectionStyle.getCollectionStart() collectionStyle.getCollectionStart()
+ StringUtils.join(s, collectionStyle.getCollectionSeparator()) + StringUtils.join(s, collectionStyle.getCollectionSeparator())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment