Interface AttributeProvider

All Known Subinterfaces:
Request, Response

@Experimental public interface AttributeProvider
Provides generic attributes configured for this object. The attributes available may depend on the configured GenerativeAIConnectorPlugin.
Since:
5.2.240708
  • Method Details

    • getAttribute

      @NotNull @NotNull Optional<Object> getAttribute(@NotNull @NotNull String name)
      Returns the value of the given attribute, or empty.
      Parameters:
      name - The name of the attribute.
      Returns:
      The attribute value, or empty.
      Since:
      5.2.240708
    • getAttribute

      @NotNull default <T> @NotNull Optional<T> getAttribute(@NotNull @NotNull String name, @NotNull @NotNull Class<T> type)
      Returns the value of the given attribute if it matches the given type, or empty if not found or incompatible.
      Parameters:
      name - The name of the attribute.
      type - The expected value type.
      Returns:
      The attribute value, or empty.
      Since:
      5.2.240708
    • getAttributeBoolean

      @NotNull default @NotNull Optional<Boolean> getAttributeBoolean(@NotNull @NotNull String name)
      Returns the boolean value of the given attribute, or empty if not of type Boolean.
      Parameters:
      name - The name of the attribute.
      Returns:
      The attribute value, or empty.
      Since:
      5.2.240708
    • getAttributeString

      @NotNull default @NotNull Optional<String> getAttributeString(@NotNull @NotNull String name)
      Returns the string value of the given attribute, or empty if not of type String.
      Parameters:
      name - The name of the attribute.
      Returns:
      The attribute value, or empty.
      Since:
      5.2.240708
    • getAttributeInteger

      @NotNull default @NotNull Optional<Integer> getAttributeInteger(@NotNull @NotNull String name)
      Returns the integer value of the given attribute, or empty if not a number.
      Parameters:
      name - The name of the attribute.
      Returns:
      The attribute value, or empty.
      Since:
      5.2.240708
    • getAttributeLong

      @NotNull default @NotNull Optional<Long> getAttributeLong(@NotNull @NotNull String name)
      Returns the long value of the given attribute, or empty if not a number.
      Parameters:
      name - The name of the attribute.
      Returns:
      The attribute value, or empty.
      Since:
      5.2.240708
    • getAttributeFloat

      @NotNull default @NotNull Optional<Float> getAttributeFloat(@NotNull @NotNull String name)
      Returns the float value of the given attribute, or empty if not a number.
      Parameters:
      name - The name of the attribute.
      Returns:
      The attribute value, or empty.
      Since:
      5.2.240708
    • getAttributeDouble

      @NotNull default @NotNull Optional<Double> getAttributeDouble(@NotNull @NotNull String name)
      Returns the double value of the given attribute, or empty if not a number.
      Parameters:
      name - The name of the attribute.
      Returns:
      The attribute value, or empty.
      Since:
      5.2.240708