public class TestUtils extends Object
| 修飾子とタイプ | フィールドと説明 |
|---|---|
static CsvContext |
ANONYMOUS_CSVCONTEXT |
| コンストラクタと説明 |
|---|
TestUtils() |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
static String |
format(Date value,
String pattern) |
static String |
format(Number value,
String pattern) |
static String |
format(org.joda.time.ReadablePartial value,
String pattern) |
static String |
format(TemporalAccessor value,
String pattern) |
static Annotation[] |
getAnnotations(Class<?> clazz,
String fieldName) |
static FieldAccessor |
getFieldAccessor(Class<?> clazz,
String fieldName,
Comparator<Annotation> comparator)
FieldAccessorのインスタンスを取得する。 |
static String |
getTextFromFile(String path,
Charset charset)
テキストファイルを読み込む。
|
static boolean |
isLinuxPlatform()
実行している環境がLinuxかどうか
|
static boolean |
isWindowsPlatform()
実行している環境がWindowsかどうか
|
static Date |
minusDays(Date date,
int daysToSubstract) |
static Date |
minusHours(Date date,
int hoursToSubstract) |
static Date |
minusMillseconds(Date date,
int millsecondsToSubstract) |
static Date |
minusSeconds(Date date,
int secondsToSubstract) |
static Date |
plusDays(Date date,
int daysToAdd) |
static Date |
plusHours(Date date,
int hoursToAdd) |
static Date |
plusMillseconds(Date date,
int millsecondsToAdd) |
static Date |
plusSeconds(Date date,
int secondsToAdd) |
static void |
printCellProcessorChain(CellProcessor cellProcessor,
PrintWriter writer) |
static void |
printCellProcessorChain(CellProcessor cellProcessor,
String message) |
static void |
printCellProcessorChain(Optional<CellProcessor> cellProcessor,
PrintWriter writer) |
static void |
printCellProcessorChain(Optional<CellProcessor> cellProcessor,
String message) |
static CsvContext |
testCsvContext(ColumnMapping columnMapping,
Object input)
カラム情報を元にテスト用のCsvContextを作成する。
|
static CsvContext |
testCsvContext(ColumnMapping columnMapping,
Object input,
int lineNumber,
int rowNumber)
カラム情報を元にテスト用のCsvContextを作成する。
|
static BigDecimal |
toBigDecimal(String value) |
static BigInteger |
toBigInteger(String value) |
static Byte |
toByte(String value)
create Byte from str.
|
static Calendar |
toCalendar(Date date) |
static Calendar |
toCalendar(Date date,
Locale locale) |
static Calendar |
toCalendar(Date date,
TimeZone timeZone) |
static Calendar |
toCalendar(Date date,
TimeZone timeZone,
Locale locale) |
static Character |
toCharacter(String value)
create Chracter from str.
|
static Date |
toDate(int year,
int month,
int dayOfMonth)
create Date instance.
|
static Date |
toDate(int year,
int month,
int dayOfMonth,
int hour,
int minute,
int second)
create Date instance.
|
static Double |
toDouble(String value)
create Long from str.
|
static Float |
toFloat(String value)
create Long from str.
|
static Integer |
toInteger(String value)
create Intger from str.
|
static Long |
toLong(String value)
create Long from str.
|
static String |
toRandomCase(String str)
ランダムに、大文字、小文字に変換する。
|
static Short |
toShort(String value)
create Intger from str.
|
static Date |
toSqlDate(Date date) |
static Date |
toSqlDate(int year,
int month,
int dayOfMonth) |
static Time |
toTime(Date date) |
static Time |
toTime(int hour,
int minute,
int second) |
static Timestamp |
toTimestamp(Date date) |
static Timestamp |
toTimestamp(int year,
int month,
int dayOfMonth,
int hour,
int minute,
int second,
int millsecond) |
static Timestamp |
toTimestamp(String value) |
public static final CsvContext ANONYMOUS_CSVCONTEXT
public static Character toCharacter(String value)
value - public static BigDecimal toBigDecimal(String value)
public static BigInteger toBigInteger(String value)
public static Date toDate(int year, int month, int dayOfMonth)
year - month - Month(start with 1)dayOfMonth - public static Date toDate(int year, int month, int dayOfMonth, int hour, int minute, int second)
year - month - Month(start with 1)dayOfMonth - hour - minute - second - public static Date toSqlDate(int year, int month, int dayOfMonth)
public static Timestamp toTimestamp(int year, int month, int dayOfMonth, int hour, int minute, int second, int millsecond)
public static Time toTime(int hour, int minute, int second)
public static Annotation[] getAnnotations(Class<?> clazz, String fieldName)
public static void printCellProcessorChain(Optional<CellProcessor> cellProcessor, String message)
public static void printCellProcessorChain(CellProcessor cellProcessor, String message)
public static void printCellProcessorChain(Optional<CellProcessor> cellProcessor, PrintWriter writer)
public static void printCellProcessorChain(CellProcessor cellProcessor, PrintWriter writer)
public static final String format(TemporalAccessor value, String pattern)
public static final String toRandomCase(String str)
str - public static FieldAccessor getFieldAccessor(Class<?> clazz, String fieldName, Comparator<Annotation> comparator)
FieldAccessorのインスタンスを取得する。clazz - fieldName - comparator - public static CsvContext testCsvContext(ColumnMapping columnMapping, Object input)
columnMapping - カラム情報input - 入力値public static CsvContext testCsvContext(ColumnMapping columnMapping, Object input, int lineNumber, int rowNumber)
columnMapping - カラム情報input - 入力値lineNumber - 実際の行番号rowNumber - CSV上の行番号public static boolean isWindowsPlatform()
public static boolean isLinuxPlatform()
Copyright © 2025 mygreen. All rights reserved.