Package com.sap.cds.reflect
Interface CdsAnnotatable
- All Known Subinterfaces:
CdsAction,CdsArrayedType,CdsAssociationType,CdsBoundAction,CdsBoundFunction,CdsDecimal,CdsDefinition,CdsElement,CdsElementDefinition,CdsEntity,CdsEnumType<T>,CdsEnumType.Enumeral<T>,CdsEvent,CdsFunction,CdsOperation,CdsParameter,CdsService,CdsSimpleType,CdsStringType,CdsStructuredType,CdsType
public interface CdsAnnotatable
-
Method Summary
Modifier and TypeMethodDescriptionStream<CdsAnnotation<?>>static Predicate<CdsAnnotatable>byAnnotation(String annotation) <T> Optional<CdsAnnotation<T>>findAnnotation(String name) Returns anOptionalwrapping aCdsAnnotation.default <T> TgetAnnotationValue(String name, T defaultValue) Returns the value of theCdsAnnotationwith the given name.getDoc()
-
Method Details
-
annotations
Stream<CdsAnnotation<?>> annotations()- Returns:
- a sequential
Streamover theCdsAnnotation(s)
-
findAnnotation
Returns anOptionalwrapping aCdsAnnotation.- Type Parameters:
T- the expected type of the annotation value- Parameters:
name- the name of theCdsAnnotation- Returns:
- an
Optionaldescribing theCdsAnnotationwith the given name, or an emptyOptionalif there is noCdsAnnotationwith this name
-
getAnnotationValue
Returns the value of theCdsAnnotationwith the given name.- Type Parameters:
T- the type of the annotation value- Parameters:
name- the name of theCdsAnnotationdefaultValue- the value to be returned if there is no annotation present, may be null- Returns:
- the value of the annotation, or
defaultValueif there is no annotation with the given name
-
byAnnotation
- Parameters:
annotation- the name of theCdsAnnotation- Returns:
- a
Predicatefiltering by annotations
-
getDoc
-