Package org.osgi.util.converter
Class AbstractSpecifying<T extends Specifying<T>>
java.lang.Object
org.osgi.util.converter.AbstractSpecifying<T>
- All Implemented Interfaces:
Specifying<T>
- Direct Known Subclasses:
ConvertingImpl
,FunctioningImpl
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate T
castThis()
defaultValue
(Object defVal) The default value to use when the object cannot be converted or in case of conversion from anull
value.When converting between map-like types use case-insensitive mapping of keys.Treat the source object as the specified class.Treat the source object as a JavaBean.Treat the source object as a DTO even if the source object has methods or is otherwise not recognized as a DTO.Treat the target object as the specified class.Treat the target object as a JavaBean.Treat the target object as a DTO even if it has methods or is otherwise not recognized as a DTO.view()
Return a live view over the backing object that reflects any changes to the original object.
-
Field Details
-
defaultValue
-
hasDefault
protected volatile boolean hasDefault -
liveView
protected volatile boolean liveView -
keysIgnoreCase
protected volatile boolean keysIgnoreCase -
sourceAsClass
-
sourceAsDTO
protected volatile boolean sourceAsDTO -
sourceAsJavaBean
protected volatile boolean sourceAsJavaBean -
targetAsClass
-
targetAsDTO
protected volatile boolean targetAsDTO -
targetAsJavaBean
protected volatile boolean targetAsJavaBean
-
-
Constructor Details
-
AbstractSpecifying
AbstractSpecifying()
-
-
Method Details
-
castThis
-
defaultValue
Description copied from interface:Specifying
The default value to use when the object cannot be converted or in case of conversion from anull
value.- Specified by:
defaultValue
in interfaceSpecifying<T extends Specifying<T>>
- Parameters:
defVal
- The default value.- Returns:
- The current
Converting
object so that additional calls can be chained.
-
keysIgnoreCase
Description copied from interface:Specifying
When converting between map-like types use case-insensitive mapping of keys.- Specified by:
keysIgnoreCase
in interfaceSpecifying<T extends Specifying<T>>
- Returns:
- The current
Converting
object so that additional calls can be chained.
-
sourceAs
Description copied from interface:Specifying
Treat the source object as the specified class. This can be used to disambiguate a type if it implements multiple interfaces or extends multiple classes.- Specified by:
sourceAs
in interfaceSpecifying<T extends Specifying<T>>
- Parameters:
cls
- The class to treat the object as.- Returns:
- The current
Converting
object so that additional calls can be chained.
-
sourceAsBean
Description copied from interface:Specifying
Treat the source object as a JavaBean. By default objects will not be treated as JavaBeans, this has to be specified using this method.- Specified by:
sourceAsBean
in interfaceSpecifying<T extends Specifying<T>>
- Returns:
- The current
Converting
object so that additional calls can be chained.
-
sourceAsDTO
Description copied from interface:Specifying
Treat the source object as a DTO even if the source object has methods or is otherwise not recognized as a DTO.- Specified by:
sourceAsDTO
in interfaceSpecifying<T extends Specifying<T>>
- Returns:
- The current
Converting
object so that additional calls can be chained.
-
targetAs
Description copied from interface:Specifying
Treat the target object as the specified class. This can be used to disambiguate a type if it implements multiple interfaces or extends multiple classes.- Specified by:
targetAs
in interfaceSpecifying<T extends Specifying<T>>
- Parameters:
cls
- The class to treat the object as.- Returns:
- The current
Converting
object so that additional calls can be chained.
-
targetAsBean
Description copied from interface:Specifying
Treat the target object as a JavaBean. By default objects will not be treated as JavaBeans, this has to be specified using this method.- Specified by:
targetAsBean
in interfaceSpecifying<T extends Specifying<T>>
- Returns:
- The current
Converting
object so that additional calls can be chained.
-
targetAsDTO
Description copied from interface:Specifying
Treat the target object as a DTO even if it has methods or is otherwise not recognized as a DTO.- Specified by:
targetAsDTO
in interfaceSpecifying<T extends Specifying<T>>
- Returns:
- The current
Converting
object so that additional calls can be chained.
-
view
Description copied from interface:Specifying
Return a live view over the backing object that reflects any changes to the original object. This is only possible with conversions toMap
,Collection
,List
andSet
. The live view object will cease to be live as soon as modifications are made to it. Note that conversions to an interface or annotation will always produce a live view that cannot be modified. This modifier has no effect with conversions to other types.- Specified by:
view
in interfaceSpecifying<T extends Specifying<T>>
- Returns:
- The current
Converting
object so that additional calls can be chained.
-