Package org.somda.sdc.common.util
Class ObjectStringifier
java.lang.Object
org.somda.sdc.common.util.ObjectStringifier
Stringifies objects in conformance with the SDCri coding conventions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Stringstringify(T obj) Stringifies annotated fields of a given object.static <T> StringStringifies some fields of a given object.static <T> StringStringifies some fields of a given object and appends defined map.static <T> StringStringifies annotated fields of a given object and appends defined map.static <T> StringstringifyAll(T obj) Stringifies all fields of a given object.static <T> StringstringifyMap(T obj, SortedMap<String, Object> keyValues) Stringifies key-value pairs from a map.
-
Constructor Details
-
ObjectStringifier
public ObjectStringifier()
-
-
Method Details
-
stringify
Stringifies annotated fields of a given object.This function considers every field that is annotated with
Stringified.- Type Parameters:
T- any object.- Parameters:
obj- the object to stringify.- Returns:
- the stringified object in conformance with the SDCri coding conventions.
-
stringify
Stringifies annotated fields of a given object and appends defined map.- Type Parameters:
T- any object.- Parameters:
obj- the object to stringify.keyValues- key-values to be additionally appended.- Returns:
- the stringified object in conformance with the SDCri coding conventions.
-
stringify
Stringifies some fields of a given object.- Type Parameters:
T- any object.- Parameters:
obj- the object to stringify.fieldNames- the fields of the class that are requested to be stringified.- Returns:
- the stringified object in conformance with the SDCri coding conventions.
-
stringify
Stringifies some fields of a given object and appends defined map.- Type Parameters:
T- any object.- Parameters:
obj- the object to stringify.fieldNames- the fields of the class that are requested to be stringified.keyValues- key-values to be additionally appended.- Returns:
- the stringified object in conformance with the SDCri coding conventions.
-
stringifyMap
Stringifies key-value pairs from a map.- Type Parameters:
T- any object.- Parameters:
obj- the object used to access the class name.keyValues- key-value pairs to put as properties of the output-string- Returns:
- the stringified object in conformance with the SDCri coding conventions.
-
stringifyAll
Stringifies all fields of a given object.In order to filter out certain fields please use either
stringify(Object)orstringify(Object, String[]).- Type Parameters:
T- any object.- Parameters:
obj- the object to stringify.- Returns:
- the stringified object in conformance with the SDCri coding conventions.
-