Interface DestinationProperties

All Known Subinterfaces:
Destination, HttpDestination, HttpDestinationProperties, RfcDestination, RfcDestinationProperties
All Known Implementing Classes:
DefaultDestination, DefaultHttpDestination, DefaultRfcDestination

public interface DestinationProperties
Interface representing the minimal information an arbitrary destination needs to implement.

As the interface suggests, a generic destination is just a store of key-value-pairs. The provided default methods allow type-safe to the values if the format of content is known.

  • Method Summary

    Modifier and Type
    Method
    Description
    default <ValueT> io.vavr.control.Option<ValueT>
    get(DestinationPropertyKey<ValueT> propertyKey)
    Convenience method to convert the Object return type of get(String) into any expected type.
    io.vavr.control.Option<Object>
    get(String key)
    Gets the value associated with the given key (if any).
    default <ValueT> io.vavr.control.Option<ValueT>
    get(String key, Class<ValueT> expectedType)
    Convenience method to cast the Object return type of get(String) into the expected type.
    default <ValueT> io.vavr.control.Option<ValueT>
    get(String key, Function<Object,ValueT> conversion)
    Convenience method to convert the Object return type of get(String) into any expected type.
    Retrieves the set of property keys of the destination.
  • Method Details

    • get

      @Nonnull io.vavr.control.Option<Object> get(@Nonnull String key)
      Gets the value associated with the given key (if any).
      Parameters:
      key - The key to get the value for.
      Returns:
      An Option object containing the value, if any.
    • getPropertyNames

      @Nonnull Iterable<String> getPropertyNames()
      Retrieves the set of property keys of the destination.
      Returns:
      An iterable of type String which is the set of property keys for a destination
    • get

      @Nonnull default <ValueT> io.vavr.control.Option<ValueT> get(@Nonnull String key, @Nonnull Class<ValueT> expectedType)
      Convenience method to cast the Object return type of get(String) into the expected type.
      Type Parameters:
      ValueT - The expected type of the value.
      Parameters:
      key - The key to get the value for.
      expectedType - The expected type to cast the value to.
      Returns:
      An Option object containing the converted value, if any.
      Throws:
      ClassCastException - if the contained type cannot be cast to the expected type.
    • get

      @Nonnull default <ValueT> io.vavr.control.Option<ValueT> get(@Nonnull String key, @Nonnull Function<Object,ValueT> conversion)
      Convenience method to convert the Object return type of get(String) into any expected type.
      Type Parameters:
      ValueT - The expected type of the value.
      Parameters:
      key - The key to get the value for.
      conversion - A function converting the object given by get(String) into the expected type. Will never be called if no value (or null) is present for the given key.
      Returns:
      An Option object containing the converted value, if any.
    • get

      @Nonnull default <ValueT> io.vavr.control.Option<ValueT> get(@Nonnull DestinationPropertyKey<ValueT> propertyKey)
      Convenience method to convert the Object return type of get(String) into any expected type.
      Type Parameters:
      ValueT - The expected type of the value.
      Parameters:
      propertyKey - The DestinationPropertyKey for the value to retrieve.
      Returns:
      An Option object containing the converted value, if any.