reflect_buddy library
Classes
- CamelToSnake
- Converts keys to snake case. Can be used on classes as well as on public variables and getters e.g. a name like userFirstName will be converted to user_first_name
- CreditCardNumberValidator
- DoubleValidator
- EmailValidator
- FirstToUpper
- Used for json serialization. This annotation (is set on class) will convert every field / variable name in a way that the first letter will be uppercase e.g. firstName will be converted to FirstName
- IntValidator
- JsonDateConverter
- Serializes / Deserializes dates by a provided
- JsonIgnore
- JsonInclude
- JsonIncludeParentFields
- A class level annotation. It will also include the fields of the direct parent.
- JsonIntConverter
- JsonKey
- ignoreDirections contains a list of directions which will be ignored includeDirections contains a list of directions which will be included
- JsonKeyNameConverter
- JsonNumConverter
- JsonPhoneConverter
- JsonTrimString
- Trims a string before assigning
- JsonValueConverter
- Similar to JsonValueValidator but it must not throw any exceptions but convert a value instead For example: you get 101 from your json map, but an expected value must be in a range between 10 and 50. You simply clamp the actual value and return the max expected value in this case NOTICE: JsonValueConverter's are called before a value is deserialized, so it can prepare an incoming value to be correctly deserialized
- JsonValueValidator
- If you need to validate a value before assigning it to a field, you can annotate the field with a descendant of this class. You can use many of these validators on a field You can see an example implementation in IntValidator If a validator does not validate a value it must throw an exception
- NameValidator
- NumValidator
- PasswordValidator
- PhoneValidator
- RequiredValidator
- SnakeToCamel
- StringValidator