@Test public void testInheritUnsetPhysicalFields() { Interface i1 = new Interface("i1"); i1.setMtu(1200); Interface bestower = new Interface("bestower"); bestower.setMtu(1000); bestower.setDescription("dodo"); i1.inheritUnsetPhysicalFields(bestower); assertThat(i1.getMtu(), equalTo(1200)); assertThat(i1.getDescription(), equalTo("dodo")); assertNull(i1.getRedundantParentInterface()); }
public void inheritUnsetPhysicalFields(Interface bestower) { if (_agg8023adInterface == null) { _agg8023adInterface = bestower._agg8023adInterface; } if (_description == null) { _description = bestower._description; } if (_mtu == null) { _mtu = bestower._mtu; } if (_redundantParentInterface == null) { _redundantParentInterface = bestower._redundantParentInterface; } }
Interface implements Serializable { public void inheritUnsetPhysicalFields(Interface bestower) { if (_agg8023adInterface == null) { _agg8023adInterface = bestower._agg8023adInterface; } if (_description == null) { _description = bestower._description; } if (_mtu == null) { _mtu = bestower._mtu; } if (_redundantParentInterface == null) { _redundantParentInterface = bestower._redundantParentInterface; } } }
Interface implements Serializable { public void inheritUnsetPhysicalFields(Interface bestower) { if (_agg8023adInterface == null) { _agg8023adInterface = bestower._agg8023adInterface; } if (_description == null) { _description = bestower._description; } if (_mtu == null) { _mtu = bestower._mtu; } if (_redundantParentInterface == null) { _redundantParentInterface = bestower._redundantParentInterface; } } Interface(String name); }
Interface implements Serializable { public void inheritUnsetPhysicalFields(Interface bestower) { if (_agg8023adInterface == null) { _agg8023adInterface = bestower._agg8023adInterface; } if (_description == null) { _description = bestower._description; } if (_mtu == null) { _mtu = bestower._mtu; } if (_redundantParentInterface == null) { _redundantParentInterface = bestower._redundantParentInterface; } } Interface(String name); static double getDefaultBandwidthByName(String name); @Nonnull Set<InterfaceOspfNeighbor> getOspfNeighbors(); @Nullable EthernetSwitching getEthernetSwitching(); void initEthernetSwitching(); String get8023adInterface(); boolean getActive(); Set<Ip> getAdditionalArpIps(); Set<ConcreteInterfaceAddress> getAllAddresses(); Set<Ip> getAllAddressIps(); List<SubRange> getAllowedVlans(); List<String> getAllowedVlanNames(); double getBandwidth(); String getDescription(); @Nullable String getIncomingFilter(); @Nullable List<String> getIncomingFilterList(); @Nullable IsisInterfaceSettings getIsisSettings(); IsisInterfaceSettings getOrInitIsisSettings(); IsoAddress getIsoAddress(); @Nullable Integer getMtu(); String getName(); @Nullable Integer getNativeVlan(); Ip getOspfArea(); Integer getOspfCost(); @Nullable Integer getOspfDeadInterval(); @Nullable Boolean getOspfDisable(); @Nullable Integer getOspfHelloInterval(); int getOspfHelloMultiplier(); OspfInterfaceType getOspfInterfaceType(); boolean getOspfPassive(); @Nullable String getOutgoingFilter(); @Nullable List<String> getOutgoingFilterList(); Interface getParent(); InterfaceAddress getPreferredAddress(); ConcreteInterfaceAddress getPrimaryAddress(); @Nullable String getRedundantParentInterface(); String getRoutingInstance(); Map<String, Interface> getUnits(); @Nullable Integer getVlanId(); void setVlanId(@Nullable Integer vlanId); SortedMap<Integer, VrrpGroup> getVrrpGroups(); void inheritUnsetFields(); void inheritUnsetPhysicalFields(Interface bestower); boolean isDefined(); void set8023adInterface(String interfaceName); void setActive(boolean active); void setAdditionalArpIps(Iterable<Ip> additionalArpIps); void setBandwidth(double bandwidth); void setDefined(boolean defined); void setDescription(String description); void setIncomingFilter(@Nullable String accessListName); void addIncomingFilterList(@Nonnull String accessListName); void setIsoAddress(IsoAddress address); void setMtu(Integer mtu); void setNativeVlan(Integer vlan); void setOspfArea(Ip ospfArea); void setOspfCost(int ospfCost); void setOspfDeadInterval(int seconds); void setOspfDisable(boolean disable); void setOspfHelloInterval(int seconds); void setOspfHelloMultiplier(int multiplier); void setOspfPassive(boolean ospfPassive); void setOspfInterfaceType(OspfInterfaceType ospfInterfaceType); void setOutgoingFilter(@Nullable String accessListName); void addOutgoingFilterList(@Nonnull String accessListName); void setParent(Interface parent); void setPreferredAddress(InterfaceAddress address); void setPrimaryAddress(ConcreteInterfaceAddress address); void setRedundantParentInterface(@Nullable String redundantParentInterface); void setRoutingInstance(String routingInstance); void setTcpMss(@Nullable Integer tcpMss); @Nullable Integer getTcpMss(); @Override String toString(); }
Interface implements Serializable { public void inheritUnsetPhysicalFields(Interface bestower) { if (_agg8023adInterface == null) { _agg8023adInterface = bestower._agg8023adInterface; } if (_description == null) { _description = bestower._description; } if (_mtu == null) { _mtu = bestower._mtu; } if (_redundantParentInterface == null) { _redundantParentInterface = bestower._redundantParentInterface; } } Interface(String name); static double getDefaultBandwidthByName(String name); @Nonnull Set<InterfaceOspfNeighbor> getOspfNeighbors(); @Nullable EthernetSwitching getEthernetSwitching(); void initEthernetSwitching(); String get8023adInterface(); boolean getActive(); Set<Ip> getAdditionalArpIps(); Set<ConcreteInterfaceAddress> getAllAddresses(); Set<Ip> getAllAddressIps(); List<SubRange> getAllowedVlans(); List<String> getAllowedVlanNames(); double getBandwidth(); String getDescription(); @Nullable String getIncomingFilter(); @Nullable List<String> getIncomingFilterList(); @Nullable IsisInterfaceSettings getIsisSettings(); IsisInterfaceSettings getOrInitIsisSettings(); IsoAddress getIsoAddress(); @Nullable Integer getMtu(); String getName(); @Nullable Integer getNativeVlan(); Ip getOspfArea(); Integer getOspfCost(); @Nullable Integer getOspfDeadInterval(); @Nullable Boolean getOspfDisable(); @Nullable Integer getOspfHelloInterval(); int getOspfHelloMultiplier(); OspfInterfaceType getOspfInterfaceType(); boolean getOspfPassive(); @Nullable String getOutgoingFilter(); @Nullable List<String> getOutgoingFilterList(); Interface getParent(); InterfaceAddress getPreferredAddress(); ConcreteInterfaceAddress getPrimaryAddress(); @Nullable String getRedundantParentInterface(); String getRoutingInstance(); Map<String, Interface> getUnits(); @Nullable Integer getVlanId(); void setVlanId(@Nullable Integer vlanId); SortedMap<Integer, VrrpGroup> getVrrpGroups(); void inheritUnsetFields(); void inheritUnsetPhysicalFields(Interface bestower); boolean isDefined(); void set8023adInterface(String interfaceName); void setActive(boolean active); void setAdditionalArpIps(Iterable<Ip> additionalArpIps); void setBandwidth(double bandwidth); void setDefined(boolean defined); void setDescription(String description); void setIncomingFilter(@Nullable String accessListName); void addIncomingFilterList(@Nonnull String accessListName); void setIsoAddress(IsoAddress address); void setMtu(Integer mtu); void setNativeVlan(Integer vlan); void setOspfArea(Ip ospfArea); void setOspfCost(int ospfCost); void setOspfDeadInterval(int seconds); void setOspfDisable(boolean disable); void setOspfHelloInterval(int seconds); void setOspfHelloMultiplier(int multiplier); void setOspfPassive(boolean ospfPassive); void setOspfInterfaceType(OspfInterfaceType ospfInterfaceType); void setOutgoingFilter(@Nullable String accessListName); void addOutgoingFilterList(@Nonnull String accessListName); void setParent(Interface parent); void setPreferredAddress(InterfaceAddress address); void setPrimaryAddress(ConcreteInterfaceAddress address); void setRedundantParentInterface(@Nullable String redundantParentInterface); void setRoutingInstance(String routingInstance); void setTcpMss(@Nullable Integer tcpMss); @Nullable Integer getTcpMss(); @Override String toString();  }