public HopBuilder(Hop base) { if (base.key() == null) { this.key = new HopKey( base.getHopId() ); this._hopId = base.getHopId(); } else { this.key = base.key(); this._hopId = key.getHopId(); } this._address = base.getAddress(); this._lrsBits = base.getLrsBits(); if (base instanceof HopImpl) { HopImpl impl = (HopImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<Hop> casted =(AugmentationHolder<Hop>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
HopImpl(HopBuilder base) { if (base.key() != null) { this.key = base.key(); } else { this.key = new HopKey(base.getHopId()); } this._hopId = key.getHopId(); this._address = base.getAddress(); this._lrsBits = base.getLrsBits(); this.augmentation = ImmutableMap.copyOf(base.augmentation); }
private HopImpl(HopBuilder base) { if (base.key() == null) { this.key = new HopKey( base.getHopId() ); this._hopId = base.getHopId(); } else { this.key = base.key(); this._hopId = key.getHopId(); } this._address = base.getAddress(); this._lrsBits = base.getLrsBits(); this.augmentation = ImmutableMap.copyOf(base.augmentation); }