DTOs.Converter, DTOs.Dec<T>, DTOs.Difference, DTOs.Enc, DTOs.LiteralMap<K,V>, DTOs.Reason, DTOs.Retrieve| Constructor and Description |
|---|
DTOsProvider() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,java.lang.Object> |
asMap(java.lang.Object dto)
Return a partially read only Map object that maps directly to a DTO.
|
DTOs.Converter |
convert(java.lang.Object source)
Create a converter on an object.
|
<T> DTOs.Dec<T> |
decoder(java.lang.Class<T> type)
Return a JSON decoder that uses the type to control the parsing.
|
DTOs.Dec<?> |
decoder(java.lang.reflect.Type type,
java.io.InputStream source)
Return a JSON decoder on an input stream that uses the type to control
the parsing.
|
<T> DTOs.Dec<T> |
decoder(TypeReference<T> type)
Return a JSON decoder that uses the type to control the parsing.
|
<T> T |
deepCopy(T source)
Deep copy
|
boolean |
deepEquals(java.lang.Object a,
java.lang.Object b)
Check if two DTOs fields are equal.
|
java.util.List<DTOs.Difference> |
diff(java.lang.Object older,
java.lang.Object newer)
Return a list of paths where the two objects differ.
|
DTOs.Enc |
encoder(java.lang.Object source)
Return encoder builder for JSON
|
boolean |
equals(java.lang.Object a,
java.lang.Object b)
Check if two dtos fields are equal.
|
java.lang.String |
escape(java.lang.String unescaped)
Escape a string to be used in a path.
|
java.lang.String[] |
fromPathToSegments(java.lang.String path)
Takes a path with escaped '.'and '\' and then turns it into an array of
unescaped keys
|
java.lang.String |
fromSegmentsToPath(java.lang.String[] segments)
Takes a path with unescaped keys and turns it into a string path where
the \ and .
|
osgi.enroute.dtos.bndlib.provider.DTOsProvider.Answer |
get(java.lang.Object dto,
java.lang.String... path)
Access a DTO with a path that consists of an array with segments.
|
osgi.enroute.dtos.bndlib.provider.DTOsProvider.Answer |
get(java.lang.Object dto,
java.lang.String path)
Access a DTO with a path.
|
<T> java.util.Comparator<T> |
getComparator(java.lang.Class<T> dtoClass)
Return a comparator who works on the primary fields of a DTO class.
|
int |
hashCode(java.lang.Object dto)
Calculate a hash Code for the fields in this DTO.
|
boolean |
isComplex(java.lang.Object a)
Return true if the give dto is complex (either Map, Collection, Array, or
has public fields.
|
boolean |
isDTO(java.lang.Object o)
An object with public fields.
|
boolean |
isValidDTO(java.lang.Object o)
Verify that the object is a DTO and has no cycles.
|
osgi.enroute.dtos.bndlib.provider.DTOsProvider.Answer |
set(java.lang.Object dto,
java.lang.Object value,
java.lang.String... path)
Set a value in a DTO with a path that consists of an array with segments.
|
osgi.enroute.dtos.bndlib.provider.DTOsProvider.Answer |
set(java.lang.Object dto,
java.lang.Object value,
java.lang.String path)
Access a DTO with a path.
|
<T> T |
shallowCopy(T source)
Shallow copy
|
java.lang.String |
toString(java.lang.Object dto)
Convert a DTO to a human readable string presentation.
|
java.lang.String |
unescape(java.lang.String unescaped)
Unescapes a string to be used in a path.
|
public DTOs.Converter convert(java.lang.Object source)
DTOspublic java.util.Map<java.lang.String,java.lang.Object> asMap(java.lang.Object dto)
throws java.lang.Exception
DTOspublic java.lang.String toString(java.lang.Object dto)
DTOspublic boolean equals(java.lang.Object a,
java.lang.Object b)
DTOspublic int hashCode(java.lang.Object dto)
DTOspublic osgi.enroute.dtos.bndlib.provider.DTOsProvider.Answer get(java.lang.Object dto,
java.lang.String path)
throws java.lang.Exception
DTOspublic osgi.enroute.dtos.bndlib.provider.DTOsProvider.Answer get(java.lang.Object dto,
java.lang.String... path)
throws java.lang.Exception
DTOspublic osgi.enroute.dtos.bndlib.provider.DTOsProvider.Answer set(java.lang.Object dto,
java.lang.Object value,
java.lang.String path)
throws java.lang.Exception
DTOsDTOs.get(Object, String...).public osgi.enroute.dtos.bndlib.provider.DTOsProvider.Answer set(java.lang.Object dto,
java.lang.Object value,
java.lang.String... path)
throws java.lang.Exception
DTOspublic java.util.List<DTOs.Difference> diff(java.lang.Object older, java.lang.Object newer) throws java.lang.Exception
DTOspublic java.lang.String escape(java.lang.String unescaped)
DTOspublic java.lang.String unescape(java.lang.String unescaped)
DTOspublic boolean isComplex(java.lang.Object a)
DTOspublic boolean isDTO(java.lang.Object o)
DTOspublic DTOs.Enc encoder(java.lang.Object source) throws java.lang.Exception
DTOspublic <T> DTOs.Dec<T> decoder(java.lang.Class<T> type) throws java.lang.Exception
DTOspublic <T> DTOs.Dec<T> decoder(TypeReference<T> type) throws java.lang.Exception
DTOspublic DTOs.Dec<?> decoder(java.lang.reflect.Type type, java.io.InputStream source) throws java.lang.Exception
DTOspublic <T> java.util.Comparator<T> getComparator(java.lang.Class<T> dtoClass)
DTOsgetComparator in interface DTOsdtoClass - the dto classpublic <T> T shallowCopy(T source)
throws java.lang.Exception
shallowCopy in interface DTOssource - the source objectjava.lang.Exceptionpublic <T> T deepCopy(T source)
throws java.lang.Exception
public java.lang.String[] fromPathToSegments(java.lang.String path)
DTOsfromPathToSegments in interface DTOspath - the path with escaped \ and .public java.lang.String fromSegmentsToPath(java.lang.String[] segments)
DTOsfromSegmentsToPath in interface DTOssegments - The unescaped segments of the pathpublic boolean deepEquals(java.lang.Object a,
java.lang.Object b)
DTOsdeepEquals in interface DTOsa - the first objectb - the second objectpublic boolean isValidDTO(java.lang.Object o)
throws java.lang.Exception
DTOsisValidDTO in interface DTOso - The object to check for no cyclestrue if this DTO has no cycles and is further okjava.lang.ExceptionCopyright (c) OSGi Alliance (2014, 2020). All Rights Reserved.