Class CObject

java.lang.Object
eu.c6.gibraltar.api.common.CObject
All Implemented Interfaces:
ICObject, Serializable, Cloneable
Direct Known Subclasses:
AnyFolder, AnyGroup, AnyRoom, AnyTask, AnyTaskAction, AnyTaskAttachment, AnyUser, AnyUsersReporting, ApiColumn, ApiConfigModule, ApiDuplicatesResult, ApiExportConfigOptions, ApiFilteredSearchRequest, ApiFullTextSearchRequest, ApiImportConfigOptions, ApiLabel, ApiMember, ApiMetadataDocument, ApiOcrFileFeedback, ApiOcrResult, ApiSendTaskResult, ApiSignUrlResult, Labels, Predicate, Range, View

public class CObject extends Object implements ICObject
The Class CObject to implements ICObject used to manage JSON data.

Example :

 
 ICObject jsonObj = new CObject();
 
 jsonObj.set("myField", "Value 01");
 jsonObj.set("my.path.field", "Value 02");
 jsonObj.set("myFieldArray", Arrays.asList("A", "B", "C"));
 
 ICObject jsonNestObj = new CObject();
 jsonNestObj.set("nestedField", "Nested Value 01");
 jsonObj.set("nestedObjField", jsonNestObj);
 
 String myField = jsonObj.getString("myField");
 String myPathField = jsonObj.getString("my.path.field");
 List<String> myArrayField = jsonObj.getListString("myFieldArray");
 ICObject myNestedObj = jsonObj.getNestedObject("nestedObjField");
 String nestedObjectField = jsonObj.getNestedObject("nestedObjField").getString("nestedField");
 
 
See Also:
  • Constructor Details

    • CObject

      public CObject()
      Instantiates a new CObject.
    • CObject

      public CObject(ICObject otherObj)
      Instantiates a new CObject from another instance of ICObject.
      Parameters:
      otherObj - the other IObject instance
    • CObject

      public CObject(String jSonString)
      Instantiates a new CObject from valid JSON string.
      Parameters:
      jSonString - the JSON string
    • CObject

      public CObject(Map<String,Object> jSonMap)
      Instantiates a new CObject from map of key/values. All map keys are converted to field name.
      Parameters:
      jSonMap - the Map of key/values
    • CObject

      public CObject(String fieldName, Object value)
      Instantiates a new CObject with a field already set.
      Parameters:
      fieldName - the field name to set
      value - the value
    • CObject

      public CObject(InputStream input)
      Instantiates a new CObject from inputsteam of JSON.
      Parameters:
      input - the input stream
    • CObject

      public CObject(Reader reader)
      Instantiates a new CObject from reader of JSON data.
      Parameters:
      reader - the reader
  • Method Details

    • isJSONValid

      public static boolean isJSONValid(String jSonString)
      Checks if is a JSON is valid and can be parsed by CObject.
      Parameters:
      jSonString - the JSON string
      Returns:
      true, if JSON is valid
    • convertJsonPathToFieldName

      public static String convertJsonPathToFieldName(String path)
      Convert JSON path using '/' to field name path using '.'
      Parameters:
      path - the path
      Returns:
      the converted path
    • convertFieldNameToJsonPath

      public static String convertFieldNameToJsonPath(String path)
      Convert field name path using '.' to JSON path using '/'
      Parameters:
      path - the path
      Returns:
      the converted path
    • buildPath

      public static String buildPath(Object... paths)
      Append all the provided parameters to build a path separated by the default path separator.
      Parameters:
      paths - a list of object that'll be used to create the path
      Returns:
      the builded path as string
    • parse

      public static ICObject parse(String jSonString)
      Creates a CObject from parsed JSON string
      Parameters:
      jSonString - the JSON string
      Returns:
      the new ICObject instance
    • load

      public ICObject load(ICObject obj)
      Description copied from interface: ICObject
      Load object from another instance of ICObject.
      Specified by:
      load in interface ICObject
      Parameters:
      obj - the object to copy
      Returns:
      the object loaded
    • load

      public ICObject load(InputStream input) throws IOException
      Description copied from interface: ICObject
      Load object from input JSON stream.
      Specified by:
      load in interface ICObject
      Parameters:
      input - the input stream. Must contain JSON string.
      Returns:
      the object loaded
      Throws:
      IOException - I/O exception has occurred or stream cannot be parsed.
    • merge

      public void merge(ICObject json)
      Description copied from interface: ICObject
      Merge another instance of ICObject into this object. The merge adds missing fields and overwrite existings ones.
      Specified by:
      merge in interface ICObject
      Parameters:
      json - the json plugin
    • mergeDeep

      public CObject mergeDeep(ICObject json, boolean keepExisting, boolean skipEmpty)
      Description copied from interface: ICObject
      Merge deeply another instance of ICObject into this object.Compared to merge(), this method merges every values and is not limited to tree nodes. Use it if you want to merge everything including leaves
      Specified by:
      mergeDeep in interface ICObject
      Parameters:
      json - Object instance of ICObject to merge
      keepExisting - : if set to true, any value existing in the source object won't be overriden by the json provided in parameter
      skipEmpty - : if set to true, any incoming value with empty string ("") will be considered as null and will not override the source value
      Returns:
      the object merged
    • isEmpty

      public boolean isEmpty()
      Gets the array nodes.
      Specified by:
      isEmpty in interface ICObject
      Returns:
      the array nodes
    • getFieldNames

      public Iterator<String> getFieldNames()
      Description copied from interface: ICObject
      Gets the direct field names as iterator.
      Specified by:
      getFieldNames in interface ICObject
      Returns:
      the field names iterator
    • getFieldNamesList

      public List<String> getFieldNamesList()
      Description copied from interface: ICObject
      Gets the field names list.
      Specified by:
      getFieldNamesList in interface ICObject
      Returns:
      the field names list
    • getNestedObjectNamesList

      public List<String> getNestedObjectNamesList()
      Description copied from interface: ICObject
      Gets the nested object field names list.
      Specified by:
      getNestedObjectNamesList in interface ICObject
      Returns:
      the list of field names containing a nested object
    • getFieldNamesFlattenList

      public List<String> getFieldNamesFlattenList()
      Description copied from interface: ICObject
      Gets the field names flatten list of all fields recursively. Indirect filed names use the dot path pattern (a.b.c)
      Specified by:
      getFieldNamesFlattenList in interface ICObject
      Returns:
      the field names flatten list
    • containsField

      public boolean containsField(String field)
      Description copied from interface: ICObject
      Check if object contains a field.
      Specified by:
      containsField in interface ICObject
      Parameters:
      field - the field name or field path to search
      Returns:
      true, if the field exists
    • getBoolean

      public boolean getBoolean(String field, boolean defaultValue)
      Description copied from interface: ICObject
      Gets the boolean value.
      Specified by:
      getBoolean in interface ICObject
      Parameters:
      field - the field name or field path
      defaultValue - the default value if field does not exist
      Returns:
      the boolean value
    • getBoolean

      public boolean getBoolean(String field)
      Description copied from interface: ICObject
      Gets the boolean value.
      Specified by:
      getBoolean in interface ICObject
      Parameters:
      field - the field name or field path
      Returns:
      the boolean value or false if field does not exist
    • getNestedObject

      public <T extends ICObject> T getNestedObject(String fieldOrPath, Class<T> clazz)
      Description copied from interface: ICObject
      Gets the nested object instantiated with a provided class.
      Specified by:
      getNestedObject in interface ICObject
      Type Parameters:
      T - the generic type
      Parameters:
      fieldOrPath - the field name or field path
      clazz - the implementation or interface class
      Returns:
      the nested object
    • getNestedObject

      public <T extends ICObject> T getNestedObject(String fieldOrPath, Class<T> clazz, Class<? extends T> implClazz)
      Description copied from interface: ICObject
      Gets the nested object instantiated with a provided class.
      Specified by:
      getNestedObject in interface ICObject
      Type Parameters:
      T - the generic type
      Parameters:
      fieldOrPath - the field name or field path
      clazz - the class interface
      implClazz - the implementation class
      Returns:
      the nested object
    • getNestedObject

      public ICObject getNestedObject(String field)
      Description copied from interface: ICObject
      Gets the nested object.
      Specified by:
      getNestedObject in interface ICObject
      Parameters:
      field - the field name or field path
      Returns:
      the nested object
    • getList

      public List<Object> getList(String field)
      Description copied from interface: ICObject
      Gets the list of object from a field with list of values.
      Specified by:
      getList in interface ICObject
      Parameters:
      field - the string
      Returns:
      the list
    • get

      public Object get(String field, Object defaultValue)
      Description copied from interface: ICObject
      Gets the object value.
      Specified by:
      get in interface ICObject
      Parameters:
      field - the field name or field path
      defaultValue - the default value if field does not exist
      Returns:
      the object value
    • getDate

      public Date getDate(String field, Date defaultValue)
      Description copied from interface: ICObject
      Gets the date value.
      Specified by:
      getDate in interface ICObject
      Parameters:
      field - the field name or field path
      defaultValue - the default value if field does not exist
      Returns:
      the date value
    • getDate

      public Date getDate(String field)
      Description copied from interface: ICObject
      Gets the date value or NULL if field does not exsit.
      Specified by:
      getDate in interface ICObject
      Parameters:
      field - the field
      Returns:
      the date value or NULL
    • getLocalDateTime

      public LocalDateTime getLocalDateTime(String field)
      Description copied from interface: ICObject
      Gets the local date time value or NULL if field does not exist.
      Specified by:
      getLocalDateTime in interface ICObject
      Parameters:
      field - the field name or field path
      Returns:
      the local date time value or NULL
    • getLocalDateTime

      public LocalDateTime getLocalDateTime(String field, LocalDateTime defaultValue)
      Description copied from interface: ICObject
      Gets the local date time value.
      Specified by:
      getLocalDateTime in interface ICObject
      Parameters:
      field - the field name or field path
      defaultValue - the default value if field does not exist
      Returns:
      the local date time
    • getInt

      public int getInt(String field, int defaultValue)
      Description copied from interface: ICObject
      Gets the integer value.
      Specified by:
      getInt in interface ICObject
      Parameters:
      field - the field name or field path
      defaultValue - the default value if field does not exist
      Returns:
      the integer value
    • getInt

      public int getInt(String field)
      Description copied from interface: ICObject
      Gets the integer value.
      Specified by:
      getInt in interface ICObject
      Parameters:
      field - the field name or field path
      Returns:
      the integer value or 0
    • getLong

      public long getLong(String field, long defaultValue)
      Description copied from interface: ICObject
      Gets the long value.
      Specified by:
      getLong in interface ICObject
      Parameters:
      field - the field name or field path
      defaultValue - the default value if field does not exist
      Returns:
      the long value
    • getLong

      public long getLong(String field)
      Description copied from interface: ICObject
      Gets the long value or 0 if field does not exist.
      Specified by:
      getLong in interface ICObject
      Parameters:
      field - the field
      Returns:
      the long value or 0
    • getDouble

      public double getDouble(String field, double defaultValue)
      Description copied from interface: ICObject
      Gets the double value.
      Specified by:
      getDouble in interface ICObject
      Parameters:
      field - the field name or field path
      defaultValue - the default value if field does not exist
      Returns:
      the double value
    • getDouble

      public double getDouble(String field)
      Description copied from interface: ICObject
      Gets the double value or 0 if field does not exist.
      Specified by:
      getDouble in interface ICObject
      Parameters:
      field - the field name or field path
      Returns:
      the double value or 0
    • getString

      public String getString(String field, String defaultValue)
      Description copied from interface: ICObject
      Gets the string value.
      Specified by:
      getString in interface ICObject
      Parameters:
      field - the field name or field path
      defaultValue - the default value if field does not exist
      Returns:
      the string value
    • isFieldEmpty

      public boolean isFieldEmpty(String fieldOrPath)
      Description copied from interface: ICObject
      Checks if the field is empty.
      Specified by:
      isFieldEmpty in interface ICObject
      Parameters:
      fieldOrPath - the field name or field path
      Returns:
      true, if the field is empty string or empty list.
    • getString

      public String getString(String field)
      Description copied from interface: ICObject
      Gets the string value or NULL if field does not exist.
      Specified by:
      getString in interface ICObject
      Parameters:
      field - the field name or field path
      Returns:
      the string or NULL
    • remove

      public void remove(String field)
      Description copied from interface: ICObject
      Removes the field.
      Specified by:
      remove in interface ICObject
      Parameters:
      field - the field name or field path
    • resetField

      public void resetField(String field)
      Description copied from interface: ICObject
      Reset a field.
      Specified by:
      resetField in interface ICObject
      Parameters:
      field - the field
    • toMap

      public Map<String,Object> toMap()
      Description copied from interface: ICObject
      Convert object to a map.
      Specified by:
      toMap in interface ICObject
      Returns:
      the map
    • toFlattenMapValues

      public Map<String,Object> toFlattenMapValues()
      Description copied from interface: ICObject
      Get map of flatten names with values. Map only include final values and list values but intermediate nested object.

      ex : {a : "a", b : { c : "c", d : ["d1",d2",d3"]} return a map {a = "a", b.c = "c", b.d= ["d1",d2",d3"]}

      Separator used for field names is the dot.

      Specified by:
      toFlattenMapValues in interface ICObject
      Returns:
      Map of values
    • toJson

      public String toJson()
      Description copied from interface: ICObject
      Convert object to a JSON string formated.
      Specified by:
      toJson in interface ICObject
      Returns:
      the string
    • toString

      public String toString(boolean autoIndent)
      Description copied from interface: ICObject
      Convert to string with auto indentation.
      Specified by:
      toString in interface ICObject
      Parameters:
      autoIndent - Set to true to activate the auto indentation
      Returns:
      the string result
    • toString

      public String toString()
      Description copied from interface: ICObject
      Convert object to a string.
      Specified by:
      toString in interface ICObject
      Overrides:
      toString in class Object
      Returns:
      the string
    • set

      public void set(String field, boolean value)
      Description copied from interface: ICObject
      Sets the field typed value.
      Specified by:
      set in interface ICObject
      Parameters:
      field - the field name or field path
      value - the typed value
    • set

      public void set(String field, long value)
      Description copied from interface: ICObject
      Sets the long value.
      Specified by:
      set in interface ICObject
      Parameters:
      field - the field name or field path
      value - the value
    • set

      public void set(String field, double value)
      Description copied from interface: ICObject
      Sets the double value.
      Specified by:
      set in interface ICObject
      Parameters:
      field - the field name or field path
      value - the value
    • set

      public void set(String field, String value)
      Description copied from interface: ICObject
      Sets the string value.
      Specified by:
      set in interface ICObject
      Parameters:
      field - the field name or field path
      value - the value
    • set

      public void set(String field, Date value)
      Description copied from interface: ICObject
      Sets the date value.
      Specified by:
      set in interface ICObject
      Parameters:
      field - the field name or field path
      value - the value
    • set

      public void set(String field, LocalDateTime value)
      Description copied from interface: ICObject
      Sets the local date time value.
      Specified by:
      set in interface ICObject
      Parameters:
      field - the field name or field path
      value - the value
    • setList

      public void setList(String field, Collection<?> values)
      Description copied from interface: ICObject
      Sets the list values.
      Specified by:
      setList in interface ICObject
      Parameters:
      field - the field name or field path
      values - the values
    • clearList

      public void clearList(String field)
      Description copied from interface: ICObject
      Clear list values.
      Specified by:
      clearList in interface ICObject
      Parameters:
      field - the field name or field path
    • isList

      public boolean isList(String field)
      Description copied from interface: ICObject
      Checks if the field is a list.
      Specified by:
      isList in interface ICObject
      Parameters:
      field - the field name or field path
      Returns:
      true, if the field is a list
    • isBoolean

      public boolean isBoolean(String field)
      Description copied from interface: ICObject
      Checks if a field is a boolean.
      Specified by:
      isBoolean in interface ICObject
      Parameters:
      field - the field name or field path
      Returns:
      true, if the field is boolean
    • isString

      public boolean isString(String field)
      Description copied from interface: ICObject
      Checks if the field is a string.
      Specified by:
      isString in interface ICObject
      Parameters:
      field - the field name or field path
      Returns:
      true, if the field is string
    • isInt

      public boolean isInt(String field)
      Description copied from interface: ICObject
      Checks if the field is an integer.
      Specified by:
      isInt in interface ICObject
      Parameters:
      field - the field name or field path
      Returns:
      true, if the field is int
    • isDouble

      public boolean isDouble(String field)
      Description copied from interface: ICObject
      Checks if the field is a double.
      Specified by:
      isDouble in interface ICObject
      Parameters:
      field - the field name or field path
      Returns:
      true, if the field is double
    • isDateList

      public boolean isDateList(String field)
      Description copied from interface: ICObject
      Checks if the field is list of dates.
      Specified by:
      isDateList in interface ICObject
      Parameters:
      field - the field
      Returns:
      true, if the field is date list
    • isDate

      public boolean isDate(String field)
      Description copied from interface: ICObject
      Checks if the field is a date.
      Specified by:
      isDate in interface ICObject
      Parameters:
      field - the field name or field path
      Returns:
      true, if the field is date
    • isNestedObject

      public boolean isNestedObject(String fieldOrPath)
      Description copied from interface: ICObject
      Checks if the field is a nested object.
      Specified by:
      isNestedObject in interface ICObject
      Parameters:
      fieldOrPath - the field name or field path
      Returns:
      true, if the field is a nested object
    • isNestedObjectList

      public boolean isNestedObjectList(String field)
      Description copied from interface: ICObject
      Checks if the field is a list of nested objects
      Specified by:
      isNestedObjectList in interface ICObject
      Parameters:
      field - the field
      Returns:
      true, if the field is nested object list
    • getListString

      public List<String> getListString(String fieldOrPath)
      Description copied from interface: ICObject
      Gets the list of string.
      Specified by:
      getListString in interface ICObject
      Parameters:
      fieldOrPath - the field name or field path
      Returns:
      the list string or empty list string if field does not exist
    • getListNestedObject

      public <T> List<T> getListNestedObject(String fieldOrPath, Class<T> clazz)
      This method returns a list of values instanciated as the Class passed as parameters.

      !! WARNING : Be sure that the class you are passing as parameter (or its implementation) has a constructor with the JsonNode parameters or it will not work.

      Specified by:
      getListNestedObject in interface ICObject
      Type Parameters:
      T - the generic type
      Parameters:
      fieldOrPath - : name of the field used to retrieve the list.
      clazz - : class used to instantiate the object returned in the list.
      Returns:
      a String containing the response
    • getListNestedObject

      public <T> List<T> getListNestedObject(String fieldOrPath, Class<T> clazz, Class<? extends T> implClazz)
      Description copied from interface: ICObject
      Returns a list of values instantiated as the Class passed as parameters and implementation class passed as argument.

      Be sure that the class you are passing as parameter (or its implementation) has a constructor with the JsonNode parameters or it will not work.

      Specified by:
      getListNestedObject in interface ICObject
      Type Parameters:
      T - the generic type implemeting JsonNode or CObject *
      Parameters:
      fieldOrPath - name of the field used to retrieve the list.
      clazz - class used to instantiate the object returned in the list.
      implClazz - class used to instaciante the object if Clazz corresponds to an interface
      Returns:
      a List of instantiated object
    • getListNestedObject

      public List<ICObject> getListNestedObject(String fieldOrPath)
      Description copied from interface: ICObject
      Gets the list of nested objects.
      Specified by:
      getListNestedObject in interface ICObject
      Parameters:
      fieldOrPath - the field name or field path
      Returns:
      the list nested objects or empty list if field does not exist
    • getListNestedObjectByAttribute

      public List<ICObject> getListNestedObjectByAttribute(String field, String attributeName, String attributeValue)
      Description copied from interface: ICObject
      Gets the list nested object filtered by nested object field value.
      Specified by:
      getListNestedObjectByAttribute in interface ICObject
      Parameters:
      field - name of the field used to retrieve the list
      attributeName - the field name to test on nested objects
      attributeValue - the field value to test (object.equals())
      Returns:
      the filtered list of nested object matching field value
    • getListNestedObjectByAttribute

      public <T> List<T> getListNestedObjectByAttribute(String field, String attributeName, String attributeValue, Class<T> clazz)
      Description copied from interface: ICObject
      Gets the list nested object instantiated with a class and filtered by nested object field value.
      Specified by:
      getListNestedObjectByAttribute in interface ICObject
      Type Parameters:
      T - the generic type implemeting JsonNode or CObject
      Parameters:
      field - name of the field used to retrieve the list
      attributeName - the field name to test on nested objects
      attributeValue - the field value to test (object.equals())
      clazz - class used to instantiate the object returned in the list.
      Returns:
      the filtered list of nested object matching field value
    • set

      public void set(String fieldOrPath, ICObject value)
      Description copied from interface: ICObject
      Sets the field typed value.
      Specified by:
      set in interface ICObject
      Parameters:
      fieldOrPath - the field name or field path
      value - the typed value
    • set

      public void set(String fieldOrPath, Map<String,Object> values)
      Description copied from interface: ICObject
      Sets the field value with a new nested object created from a Map. Each key/object from the map is converted to a field/field value in the new object.
      Specified by:
      set in interface ICObject
      Parameters:
      fieldOrPath - the field name or field path
      values - the values converted to a nested object
    • set

      public void set(String fieldOrPath, Object value)
      Description copied from interface: ICObject
      Sets the field typed value.
      Specified by:
      set in interface ICObject
      Parameters:
      fieldOrPath - the field name or field path
      value - the typed value
    • setNull

      public void setNull(String fieldOrPath)
      Description copied from interface: ICObject
      Sets the null value.
      Specified by:
      setNull in interface ICObject
      Parameters:
      fieldOrPath - the field name or field path
    • addValueIntoList

      public void addValueIntoList(String fieldOrPath, Object value)
      Description copied from interface: ICObject
      Append value into a field with a list of values.
      Specified by:
      addValueIntoList in interface ICObject
      Parameters:
      fieldOrPath - the field name or field path
      value - the value
    • addIntoList

      public void addIntoList(String fieldOrPath, Collection<?> values)
      Description copied from interface: ICObject
      Append values into a field with a list of values.
      Specified by:
      addIntoList in interface ICObject
      Parameters:
      fieldOrPath - the field name or field path
      values - the values
    • getListSize

      public int getListSize(String fieldOrPath)
      Description copied from interface: ICObject
      Gets the list size of a field with a list of values..
      Specified by:
      getListSize in interface ICObject
      Parameters:
      fieldOrPath - the field name or field path
      Returns:
      the list size or 0 if field is not a list
    • insertIntoList

      public void insertIntoList(String fieldOrPath, Object value, int i)
      Description copied from interface: ICObject
      Insert a value into a field with a list of values at the specified index.
      Specified by:
      insertIntoList in interface ICObject
      Parameters:
      fieldOrPath - the field name or field path
      value - the value
      i - the index
    • replaceIntoList

      public void replaceIntoList(String fieldOrPath, Object value, int i)
      Description copied from interface: ICObject
      Replaces a value into a field with a list of values using index.
      Specified by:
      replaceIntoList in interface ICObject
      Parameters:
      fieldOrPath - the field name or field path
      value - the value to set
      i - the index to replace into the list of values
    • removeValueFromList

      public void removeValueFromList(String fieldOrPath, Object toBeRemovedValue)
      Description copied from interface: ICObject
      Removes the value from list values of a field.
      Specified by:
      removeValueFromList in interface ICObject
      Parameters:
      fieldOrPath - the field name or field path
      toBeRemovedValue - the value to be removed
    • removeFromList

      public void removeFromList(String fieldOrPath, Collection<?> values)
      Description copied from interface: ICObject
      Removes values from list values of a field.
      Specified by:
      removeFromList in interface ICObject
      Parameters:
      fieldOrPath - the field name or field path
      values - the values to remove
    • contains

      public boolean contains(String fieldOrPath, Object value)
      Description copied from interface: ICObject
      Checks if object contains a field with specified value.
      Specified by:
      contains in interface ICObject
      Parameters:
      fieldOrPath - the field name or field path
      value - the value
      Returns:
      true, if successful
    • equals

      public boolean equals(Object object)
      Description copied from interface: ICObject
      Checks if current object is equals to another.
      Specified by:
      equals in interface ICObject
      Overrides:
      equals in class Object
      Parameters:
      object - the object
      Returns:
      true, if compared object is instance of ICObject, compared object have exactly same fields names and all fields values are equals.
    • getInputStream

      public InputStream getInputStream(boolean prettyPrint)
      Description copied from interface: ICObject
      Gets the object as input stream.
      Specified by:
      getInputStream in interface ICObject
      Parameters:
      prettyPrint - Set to true for pretty print
      Returns:
      the input stream
    • getReader

      public Reader getReader(boolean prettyPrint) throws UnsupportedEncodingException
      Description copied from interface: ICObject
      Gets the object as reader.
      Specified by:
      getReader in interface ICObject
      Parameters:
      prettyPrint - tSet to true for pretty print
      Returns:
      the reader
      Throws:
      UnsupportedEncodingException - the unsupported encoding exception
    • getOutputStream

      public ByteArrayOutputStream getOutputStream(boolean prettyPrint)
      Description copied from interface: ICObject
      Gets the object as output stream.
      Specified by:
      getOutputStream in interface ICObject
      Parameters:
      prettyPrint - Set to true for pretty print
      Returns:
      the output stream
    • clone

      public ICObject clone()
      Description copied from interface: ICObject
      Clone the object.
      Specified by:
      clone in interface ICObject
      Returns:
      the object cloned
    • clone

      public <T extends ICObject> T clone(Class<T> clazz)
      Description copied from interface: ICObject
      Clone the object as new class.
      Specified by:
      clone in interface ICObject
      Type Parameters:
      T - the generic type
      Parameters:
      clazz - the class to implement the clone
      Returns:
      the cloned object instance of provided class
    • clone

      public <T extends ICObject> T clone(Class<T> clazz, Class<? extends T> implClazz)
      Description copied from interface: ICObject
      Clone the object as new class.
      Specified by:
      clone in interface ICObject
      Type Parameters:
      T - the generic type
      Parameters:
      clazz - the interface to implement the clone
      implClazz - the class to implement the clone
      Returns:
      the cloned object instance of provided class
    • textValue

      public String textValue()
      Description copied from interface: ICObject
      Convert to text value.
      Specified by:
      textValue in interface ICObject
      Returns:
      the string