private static Optional < String > roleNotLinkedToRelation ( Role role , RelationType relationType , Relation relation ) { boolean notFound = role . relations ( ) . noneMatch ( innerRelationType -> innerRelationType . label ( ) . equals ( relationType . label ( ) ) ) ; if ( notFound ) { return Optional . of ( VALIDATION_RELATION_CASTING_LOOP_FAIL . getMessage ( relation . id ( ) , role . label ( ) , relationType . label ( ) ) ) ; } return Optional . empty ( ) ; }
Checks if the Role of the Casting has been linked to the RelationType of the Relation which the Casting connects to .