Package aQute.bnd.util.dto
Class DTO
- java.lang.Object
-
- aQute.bnd.util.dto.DTO
-
- Direct Known Subclasses:
PersistentResource
,PersistentResource.Attr
,PersistentResource.Namespace
,PersistentResource.RCData
,PomOptions
,ProxyDTO
,ResolverInfo.ResolveStatus
,ServerDTO
,SettingsDTO
,Verifier.BundleActivatorError
public abstract class DTO extends java.lang.Object
Super type for Data Transfer Objects.A Data Transfer Object (DTO) is easily serializable having only public fields of primitive types and their wrapper classes, Strings, and DTOs. List, Set, Map and array aggregates may also be used. The aggregates must only hold objects of the listed types or aggregates.
The object graph from a Data Transfer Object must be a tree to simplify serialization and deserialization.
-
-
Constructor Summary
Constructors Constructor Description DTO()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.StringBuilder
appendArray(java.lang.StringBuilder result, java.util.Map<java.lang.Object,java.lang.String> objectRefs, java.lang.String refpath, java.lang.Object array)
Append the specified array's string representation to the specified StringBuilder.private static java.lang.StringBuilder
appendDTO(java.lang.StringBuilder result, java.util.Map<java.lang.Object,java.lang.String> objectRefs, java.lang.String refpath, DTO dto)
Append the specified DTO's string representation to the specified StringBuilder.private static java.lang.StringBuilder
appendIterable(java.lang.StringBuilder result, java.util.Map<java.lang.Object,java.lang.String> objectRefs, java.lang.String refpath, java.lang.Iterable<?> iterable)
Append the specified iterable's string representation to the specified StringBuilder.private static java.lang.StringBuilder
appendMap(java.lang.StringBuilder result, java.util.Map<java.lang.Object,java.lang.String> objectRefs, java.lang.String refpath, java.util.Map<?,?> map)
Append the specified map's string representation to the specified StringBuilder.private static java.lang.StringBuilder
appendString(java.lang.StringBuilder result, java.lang.CharSequence string)
Append the specified string to the specified StringBuilder.private static java.lang.StringBuilder
appendValue(java.lang.StringBuilder result, java.util.Map<java.lang.Object,java.lang.String> objectRefs, java.lang.String refpath, java.lang.Object value)
Append the specified value's string representation to the specified StringBuilder.private static java.lang.CharSequence
compress(java.lang.CharSequence in)
Compress, in length, the specified string.java.lang.String
toString()
Return a string representation of this DTO suitable for use when debugging.
-
-
-
Method Detail
-
toString
public java.lang.String toString()
Return a string representation of this DTO suitable for use when debugging.The format of the string representation is not specified and subject to change.
- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of this DTO suitable for use when debugging.
-
appendDTO
private static java.lang.StringBuilder appendDTO(java.lang.StringBuilder result, java.util.Map<java.lang.Object,java.lang.String> objectRefs, java.lang.String refpath, DTO dto)
Append the specified DTO's string representation to the specified StringBuilder.- Parameters:
result
- StringBuilder to which the string representation is appended.objectRefs
- References to "seen" objects.refpath
- The reference path of the specified DTO.dto
- The DTO whose string representation is to be appended.- Returns:
- The specified StringBuilder.
-
appendValue
private static java.lang.StringBuilder appendValue(java.lang.StringBuilder result, java.util.Map<java.lang.Object,java.lang.String> objectRefs, java.lang.String refpath, java.lang.Object value)
Append the specified value's string representation to the specified StringBuilder.This method handles cycles in the object graph, using path-based references, even though the specification requires the object graph from a DTO to be a tree.
- Parameters:
result
- StringBuilder to which the string representation is appended.objectRefs
- References to "seen" objects.refpath
- The reference path of the specified value.value
- The object whose string representation is to be appended.- Returns:
- The specified StringBuilder.
-
appendArray
private static java.lang.StringBuilder appendArray(java.lang.StringBuilder result, java.util.Map<java.lang.Object,java.lang.String> objectRefs, java.lang.String refpath, java.lang.Object array)
Append the specified array's string representation to the specified StringBuilder.- Parameters:
result
- StringBuilder to which the string representation is appended.objectRefs
- References to "seen" objects.refpath
- The reference path of the specified array.array
- The array whose string representation is to be appended.- Returns:
- The specified StringBuilder.
-
appendIterable
private static java.lang.StringBuilder appendIterable(java.lang.StringBuilder result, java.util.Map<java.lang.Object,java.lang.String> objectRefs, java.lang.String refpath, java.lang.Iterable<?> iterable)
Append the specified iterable's string representation to the specified StringBuilder.- Parameters:
result
- StringBuilder to which the string representation is appended.objectRefs
- References to "seen" objects.refpath
- The reference path of the specified list.iterable
- The iterable whose string representation is to be appended.- Returns:
- The specified StringBuilder.
-
appendMap
private static java.lang.StringBuilder appendMap(java.lang.StringBuilder result, java.util.Map<java.lang.Object,java.lang.String> objectRefs, java.lang.String refpath, java.util.Map<?,?> map)
Append the specified map's string representation to the specified StringBuilder.- Parameters:
result
- StringBuilder to which the string representation is appended.objectRefs
- References to "seen" objects.refpath
- The reference path of the specified map.map
- The map whose string representation is to be appended.- Returns:
- The specified StringBuilder.
-
appendString
private static java.lang.StringBuilder appendString(java.lang.StringBuilder result, java.lang.CharSequence string)
Append the specified string to the specified StringBuilder.- Parameters:
result
- StringBuilder to which the string is appended.string
- The string to be appended.- Returns:
- The specified StringBuilder.
-
compress
private static java.lang.CharSequence compress(java.lang.CharSequence in)
Compress, in length, the specified string.- Parameters:
in
- The string to potentially compress.- Returns:
- The string compressed, if necessary.
-
-