V addInstance ( Schema . BaseType instanceBaseType , BiFunction < VertexElement , T , V > producer , boolean isInferred ) { preCheckForInstanceCreation ( ) ; if ( isAbstract ( ) ) throw TransactionException . addingInstancesToAbstractType ( this ) ; VertexElement instanceVertex = vertex ( ) . tx ( ) . addVertexElement ( instanceBaseType ) ; vertex ( ) . tx ( ) . ruleCache ( ) . ackTypeInstance ( this ) ; if ( ! Schema . MetaSchema . isMetaLabel ( label ( ) ) ) { vertex ( ) . tx ( ) . cache ( ) . addedInstance ( id ( ) ) ; if ( isInferred ) instanceVertex . property ( Schema . VertexProperty . IS_INFERRED , true ) ; } V instance = producer . apply ( instanceVertex , getThis ( ) ) ; assert instance != null : "producer should never return null" ; return instance ; }
Utility method used to create an instance of this type