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 anOptional
wrapping aCdsAnnotation
.default <T> T
getAnnotationValue
(String name, T defaultValue) Returns the value of theCdsAnnotation
with the given name.getDoc()
-
Method Details
-
annotations
Stream<CdsAnnotation<?>> annotations()- Returns:
- a sequential
Stream
over theCdsAnnotation(s)
-
findAnnotation
Returns anOptional
wrapping aCdsAnnotation
.- Type Parameters:
T
- the expected type of the annotation value- Parameters:
name
- the name of theCdsAnnotation
- Returns:
- an
Optional
describing theCdsAnnotation
with the given name, or an emptyOptional
if there is noCdsAnnotation
with this name
-
getAnnotationValue
Returns the value of theCdsAnnotation
with the given name.- Type Parameters:
T
- the type of the annotation value- Parameters:
name
- the name of theCdsAnnotation
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
- Parameters:
annotation
- the name of theCdsAnnotation
- Returns:
- a
Predicate
filtering by annotations
-
getDoc
-