public class FakeValuesService extends Object
Constructor and Description |
---|
FakeValuesService(Locale locale,
RandomService randomService) |
Modifier and Type | Method and Description |
---|---|
String |
bothify(String string)
Applies both a
numerify(String) and a letterify(String)
over the incoming string. |
String |
composite(String formatKey,
String joiner,
Object objectToInvokeMethodOn)
A property that is composed of other properties.
|
Object |
fetch(String key)
Fetch a random value from an array item specified by the key
|
Object |
fetchObject(String key)
Return the object selected by the key from yaml file.
|
String |
fetchString(String key)
Same as
fetch(String) except this casts the result into a String. |
String |
letterify(String letterString)
Returns a string with the '?' characters in the parameter replaced with random alphabetic
characters.
|
String |
numerify(String numberString)
Returns a string with the '#' characters in the parameter replaced with random digits between 0-9 inclusive.
|
public FakeValuesService(Locale locale, RandomService randomService)
public Object fetch(String key)
key
- public String fetchString(String key)
fetch(String)
except this casts the result into a String.key
- public Object fetchObject(String key)
key
- key contains path to an object. Path segment is separated by
dot. E.g. name.first_namepublic String composite(String formatKey, String joiner, Object objectToInvokeMethodOn)
fetch(String)
. It will
proceed to convert the returned properties from the fetch(String)
method to a methodName and invoke this method against the object passed in.
Finally, concatenation occurs with the return values of the methods
using the joiner parameter as a separator.formatKey
- joiner
- objectToInvokeMethodOn
- public String numerify(String numberString)
numberString
- public String bothify(String string)
numerify(String)
and a letterify(String)
over the incoming string.string
- Copyright © 2015. All Rights Reserved.