クラス SqlUtils
- java.lang.Object
-
- com.github.mygreen.splate.SqlUtils
-
public class SqlUtils extends Object
2Way-SQL機能の中で提供されるユーティリティクラス。MirageSQL/Seaser2からの持ち込みなので、既存のユーティリティクラスとは分けて定義する。
- 作成者:
- T.TSUCHIE
-
-
フィールドの概要
フィールド 修飾子とタイプ フィールド 説明 static String[]
EMPTY_STRINGS
空の文字列の配列です。
-
コンストラクタの概要
コンストラクタ コンストラクタ 説明 SqlUtils()
-
メソッドの概要
すべてのメソッド staticメソッド concreteメソッド 修飾子とタイプ メソッド 説明 static String
getMessageDigest(String text, String algorithm)
文字列のメッセージダイジェストを作成します。static boolean
isEmpty(String text)
文字列が空かどうか判定します。static boolean
isNotEmpty(String text)
文字列が空でないかどうか判定します。static String
readStream(InputStream in, String encoding)
リソースをテキストとして読み込む。static String
replace(String text, String fromText, String toText)
文字列を置き換えます。
-
-
-
フィールドの詳細
-
EMPTY_STRINGS
public static final String[] EMPTY_STRINGS
空の文字列の配列です。
-
-
メソッドの詳細
-
replace
public static final String replace(String text, String fromText, String toText)
文字列を置き換えます。 置換対象の文字列がnullの場合は、結果として null を返します。- パラメータ:
text
- テキストfromText
- 置き換え対象のテキストtoText
- 置き換えるテキスト- 戻り値:
- 結果
-
isEmpty
public static final boolean isEmpty(String text)
文字列が空かどうか判定します。- パラメータ:
text
- 文字列- 戻り値:
- 文字列が null または空文字列なら true を返します。
-
isNotEmpty
public static final boolean isNotEmpty(String text)
文字列が空でないかどうか判定します。- パラメータ:
text
- 文字列- 戻り値:
- 文字列が null または空文字列なら false を返します。
-
readStream
public static String readStream(InputStream in, String encoding) throws IOException
リソースをテキストとして読み込む。引数で指定したストリームは自動的にクローズします。
- パラメータ:
in
- リソースencoding
- エンコーディング- 戻り値:
- 読み込んだテキスト
- 例外:
IOException
- リソースの読み込みに失敗した場合にスローされます。
-
-