return false; if (!Objects.equals(_name, other.getName())) { return false;
@Override public Optional<String> getNodeName(final int tableIndex, final int nodeIndex, @Nonnull final MappingContext ctx) { if (!containsName(tableIndex, ctx)) { return Optional.absent(); } final String tableName = getTableName(tableIndex, ctx); final Optional<ClassifyTableContext> tableCtx = ctx.read(getMappingIid(tableName)); final List<NodeContext> nodeContext = tableCtx.get().getNodeContext(); if (nodeContext == null) { return Optional.absent(); } return Optional.fromNullable(nodeContext.stream() .filter(n -> n.getIndex().equals(nodeIndex)) .findFirst() .map(nodes -> nodes.getName()) .orElse(null)); }
public NodeContextBuilder(NodeContext base) { if (base.key() == null) { this.key = new NodeContextKey( base.getName() ); this._name = base.getName(); } else { this.key = base.key(); this._name = key.getName(); } this._index = base.getIndex(); if (base instanceof NodeContextImpl) { NodeContextImpl impl = (NodeContextImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<NodeContext> casted =(AugmentationHolder<NodeContext>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }