Kafenio.editor 0.8.5

de.xeinfach.kafenio.util
Class Utils

java.lang.Object
  extended byde.xeinfach.kafenio.util.Utils

public final class Utils
extends java.lang.Object

Static utility class with miscellaneous functions.

Author:
Maxym Mykhalchuk, Karsten Pawlik

Method Summary
static java.lang.String checkNullOrEmpty(java.lang.String inputString)
           
static java.lang.String checkNullOrEmpty(java.lang.String inputString, java.lang.String returnValue)
           
static java.lang.String ensureHasNoLeading(char character, java.lang.String aString)
          Ensures that the given string does not have a given character as the first one.
static java.lang.String ensureHasTrailing(char character, java.lang.String aString)
          Ensures that the given string's last character is the given character.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

ensureHasNoLeading

public static java.lang.String ensureHasNoLeading(char character,
                                                  java.lang.String aString)
Ensures that the given string does not have a given character as the first one. If it is the case, all such characters are deleted from the beginning of the string.

Parameters:
character - a character to check for
aString - a string to check
Returns:
returns the given string without a leading character(s)

ensureHasTrailing

public static java.lang.String ensureHasTrailing(char character,
                                                 java.lang.String aString)
Ensures that the given string's last character is the given character. If the last character is the given character or an empty/null string is passed, the string is returned unchanged.

Parameters:
character - a character to check for
aString - a string to check
Returns:
returns the given string with the given character appended

checkNullOrEmpty

public static java.lang.String checkNullOrEmpty(java.lang.String inputString,
                                                java.lang.String returnValue)
Parameters:
inputString - input string to check
returnValue - a return value
Returns:
returns the inputString if the inputString IS NOT null or empty and the returnValue if the inputString IS empty or null

checkNullOrEmpty

public static java.lang.String checkNullOrEmpty(java.lang.String inputString)
Parameters:
inputString - input string to check
Returns:
returns the inputString or null if the inputString is empty or null

Kafenio.editor 0.8.5

Copyright © 2003-2004 by Karsten Pawlik. All Rights Reserved. Published under the Lesser General Public License (LGPL)