use of org.neo4j.internal.kernel.api.TokenSet in project neo4j by neo4j.
the class NodeEntity method getLabels.
public Iterable<Label> getLabels(NodeCursor nodes) {
KernelTransaction transaction = internalTransaction.kernelTransaction();
try {
singleNode(transaction, nodes);
TokenSet tokenSet = nodes.labels();
TokenRead tokenRead = transaction.tokenRead();
List<Label> list = new ArrayList<>(tokenSet.numberOfTokens());
for (int i = 0; i < tokenSet.numberOfTokens(); i++) {
list.add(label(tokenRead.nodeLabelName(tokenSet.token(i))));
}
return list;
} catch (LabelNotFoundKernelException e) {
throw new IllegalStateException("Label retrieved through kernel API should exist.", e);
}
}
Aggregations