Class YAMLFileManager
- Direct Known Subclasses:
SHAFT.TestData.YAML
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionget()
Fetch all the date from the YAML fileFetch a single piece of data from the YAML file using a single key or a series of keys<T> T
Fetch a single piece of data from the YAML file using a single key or a series of keysgetBoolean
(String key) Fetch a single piece of data from the YAML file using a single key or a series of keysFetch a single piece of data from the YAML file using a single key or a series of keysFetch a single piece of data from the YAML file using a single key or a series of keysgetInteger
(String key) Fetch a single piece of data from the YAML file using a single key or a series of keys<T> List
<T> Fetch a single piece of data from the YAML file using a single key or a series of keysFetch a single piece of data from the YAML file using a single key or a series of keysFetch a single piece of data from the YAML file using a single key or a series of keysFetch a single piece of data from the YAML file using a single key or a series of keysgetTestData
(String key) Fetch a single piece of data from the YAML file using a single key or a series of keys
-
Field Details
-
KEY_CONTAINS_LIST_REGEX
- See Also:
-
NUMBER_IN_SQUARE_BRACKETS_REGEX
- See Also:
-
SQUARE_BRACKETS_REGEX
- See Also:
-
KEY_SEPARATOR_REGEX
- See Also:
-
-
Constructor Details
-
YAMLFileManager
Creating an instance ofYAMLFileManager
- Parameters:
filePath
- target test data yaml file path
-
-
Method Details
-
get
Fetch all the date from the YAML file- Returns:
- all date existed in the YAML file as
Map
-
get
Fetch a single piece of data from the YAML file using a single key or a series of keysto support key series use a dot to separate keys "key1.key2" to support list in the key series "key[index]"
- Parameters:
key
- the path to the wanted data can be a single key or a series of keys- Returns:
- the wanted value as
Object
-
getTestData
Fetch a single piece of data from the YAML file using a single key or a series of keysto support key series use a dot to separate keys "key1.key2" to support list in the key series "key[index]"
- Parameters:
key
- the path to the wanted data can be a single key or a series of keys- Returns:
- the wanted value as
String
even if it not a string it will parse it to be string
-
getString
Fetch a single piece of data from the YAML file using a single key or a series of keysto support key series use a dot to separate keys "key1.key2" to support list in the key series "key[index]"
- Parameters:
key
- the path to the wanted data can be a single key or a series of keys- Returns:
- the wanted value as
String
if the value is not a string it will throw an error
-
getInteger
Fetch a single piece of data from the YAML file using a single key or a series of keysto support key series use a dot to separate keys "key1.key2" to support list in the key series "key[index]"
- Parameters:
key
- the path to the wanted data can be a single key or a series of keys- Returns:
- the wanted value as
Integer
-
getDouble
Fetch a single piece of data from the YAML file using a single key or a series of keysto support key series use a dot to separate keys "key1.key2" to support list in the key series "key[index]"
- Parameters:
key
- the path to the wanted data can be a single key or a series of keys- Returns:
- the wanted value as
Double
-
getLong
Fetch a single piece of data from the YAML file using a single key or a series of keysto support key series use a dot to separate keys "key1.key2" to support list in the key series "key[index]"
to support
Long
values the char "L" should be added at the end of the number- Parameters:
key
- the path to the wanted data can be a single key or a series of keys- Returns:
- the wanted value as
Long
-
getBoolean
Fetch a single piece of data from the YAML file using a single key or a series of keysto support key series use a dot to separate keys "key1.key2" to support list in the key series "key[index]"
- Parameters:
key
- the path to the wanted data can be a single key or a series of keys- Returns:
- the wanted value as
Boolean
-
getDate
Fetch a single piece of data from the YAML file using a single key or a series of keysto support key series use a dot to separate keys "key1.key2" to support list in the key series "key[index]"
Always return date on the local time zone
- Parameters:
key
- the path to the wanted data can be a single key or a series of keys- Returns:
- the wanted value as
Date
-
getAs
Fetch a single piece of data from the YAML file using a single key or a series of keysto support key series use a dot to separate keys "key1.key2" to support list in the key series "key[index]"
- Parameters:
key
- the path to the wanted data can be a single key or a series of keysclazz
- the class that data wanted to be parsed for- Returns:
- the wanted value as
YAMLFileManager
-
getListAs
Fetch a single piece of data from the YAML file using a single key or a series of keysto support key series use a dot to separate keys "key1.key2" to support list in the key series "key[index]"
- Parameters:
key
- the path to the wanted data can be a single key or a series of keysclazz
- the class that data wanted to be parsed for- Returns:
- the wanted value as
List<T>
-
getMapAs
Fetch a single piece of data from the YAML file using a single key or a series of keysto support key series use a dot to separate keys "key1.key2" to support list in the key series "key[index]"
- Parameters:
key
- the path to the wanted data can be a single key or a series of keysclazz
- the class that data wanted to be parsed for- Returns:
- the wanted value as
Map
ofString
andYAMLFileManager
-