de.smartics.maven.issues.util
Class Utils

Package class diagram package Utils
java.lang.Object
  extended by de.smartics.maven.issues.util.Utils

public final class Utils
     
     
extends Object

Utilities for this package.

Author:
Robert Reiner

Method Summary
static org.apache.maven.artifact.versioning.ArtifactVersion findVersionRepresentative(org.apache.maven.artifact.versioning.VersionRange range)
          Returns a representative from within the version range.
static String normalizeKey(String key)
          Normalizes the key to an issue information to be a valid key element to select a value in a resource bundle.
static List<String> splitToList(String commaSeparatedValues)
          Splits a comma separated list of values from a String into a list of Strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

normalizeKey

public static String normalizeKey(String key)
Normalizes the key to an issue information to be a valid key element to select a value in a resource bundle.

Parameters:
key - the key to normalize.
Returns:
the normalized key.

splitToList

public static List<String> splitToList(String commaSeparatedValues)
Splits a comma separated list of values from a String into a list of Strings.

Parameters:
commaSeparatedValues - the String value containing comma separated values. Blanks in front or after the items are trimmed.
Returns:
the list of Strings or the empty list if the given value was blank.

findVersionRepresentative

public static org.apache.maven.artifact.versioning.ArtifactVersion findVersionRepresentative(org.apache.maven.artifact.versioning.VersionRange range)
                                                                                      throws NullPointerException,
                                                                                             IllegalArgumentException
Returns a representative from within the version range.

It is expected that the restrictions are ordered by the version numbers they define ascending.

Parameters:
range - the range of version where the lowest version is requested.
Returns:
the version representative within the given range or a version instance representing 0.0.0 if the range has no lower bound.
Throws:
NullPointerException - if the given range is null.
IllegalArgumentException - if no bound is inclusive and the upper bound is null and the lower bound is not null.


Copyright © 2008-2010 Kronseder & Reiner GmbH - smartics. All Rights Reserved.