public interface Destination extends DestinationProperties
HttpDestination
or a RfcDestination
.
Additionally provides an easy way to decorate itself with a given decorator function.
Modifier and Type | Method and Description |
---|---|
HttpDestination |
asHttp()
Decorates this object as a
HttpDestination , |
RfcDestination |
asRfc()
Decorates this object as a
RfcDestination , |
default <TargetT extends DestinationProperties> |
decorate(Function<DestinationProperties,TargetT> decorator)
Provides an convenient way to decorate this destination with a custom class.
|
boolean |
isHttp()
Verifies that this object can be converted to a
HttpDestination . |
boolean |
isRfc()
Verifies that this object can be converted to a
RfcDestination . |
get, get, get, get
@Nonnull default <TargetT extends DestinationProperties> TargetT decorate(@Nonnull Function<DestinationProperties,TargetT> decorator)
Example usage:
{ CustomDestination customDestination = destination.decorate(CustomDestination::new); }
TargetT
- The type of the decorated destination.decorator
- The decorator function to apply. Should not return null
.IllegalArgumentException
- if the provided decorator returns null
.@Nonnull HttpDestination asHttp() throws IllegalArgumentException
HttpDestination
,IllegalArgumentException
- if this object cannot be decorated as a HttpDestination
.boolean isHttp()
HttpDestination
.true
, if a call to asHttp()
will succeed; false
otherwise.@Nonnull RfcDestination asRfc() throws IllegalArgumentException
RfcDestination
,IllegalArgumentException
- if this object cannot be decorated as a RfcDestination
.boolean isRfc()
RfcDestination
.true
, if a call to asRfc()
()} will succeed; false
otherwise.Copyright © 2019 SAP SE. All rights reserved.