Interface CdsAnnotatable

All Known Subinterfaces:
CdsAction, CdsArrayedType, CdsAssociationType, CdsBoundAction, CdsBoundFunction, CdsDecimal, CdsDefinition, CdsElement, CdsEntity, CdsEnumType<T>, CdsEnumType.Enumeral<T>, CdsEvent, CdsFunction, CdsOperation, CdsParameter, CdsService, CdsSimpleType, CdsStringType, CdsStructuredType, CdsType

public interface CdsAnnotatable
  • Method Details

    • annotations

      Stream<CdsAnnotation<?>> annotations()
      Returns a sequential Stream over all CdsAnnotation(s) of this CdsAnnotatable.
      Returns:
      a sequential Stream over the CdsAnnotation(s)
    • findAnnotation

      <T> Optional<CdsAnnotation<T>> findAnnotation(String name)
      Returns an Optional wrapping a CdsAnnotation.
      Type Parameters:
      T - the expected type of the annotation value
      Parameters:
      name - the name of the CdsAnnotation
      Returns:
      an Optional describing the CdsAnnotation with the given name, or an empty Optional if there is no CdsAnnotation with this name
    • getAnnotationValue

      default <T> T getAnnotationValue(String name, T defaultValue)
      Returns the value of the CdsAnnotation with the given name.
      Type Parameters:
      T - the type of the annotation value
      Parameters:
      name - the name of the CdsAnnotation
      defaultValue - the value to be returned if there is no annotation present, may be null
      Returns:
      the value of the annotation, or defaultValue if there is no annotation with the given name
    • byAnnotation

      static Predicate<CdsAnnotatable> byAnnotation(String annotation)
      Returns a Predicate to filter CdsAnnotatable(s) that have a CdsAnnotation with the given name.
      Parameters:
      annotation - the name of the CdsAnnotation
      Returns:
      a Predicate filtering by annotations