PaloAlto Interface: cleanup
Null annotations
Formatting
@@ -5,6 +5,8 @@ import java.util.LinkedHashSet;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.batfish.datamodel.InterfaceAddress;
/** PAN datamodel component containing interface configuration */
@@ -14,26 +16,17 @@ public final class Interface implements Serializable {
private static final long serialVersionUID = 1L;
private boolean _active;
-
- private InterfaceAddress _address;
-
- private final Set<InterfaceAddress> _allAddresses;
-
- private String _comment;
-
- private Integer _mtu;
-
- private final String _name;
-
- private Interface _parent;
-
- private Integer _tag;
-
- private final SortedMap<String, Interface> _units;
-
- private Zone _zone;
-
- public Interface(String name) {
+ @Nullable private InterfaceAddress _address;
+ @Nonnull private final Set<InterfaceAddress> _allAddresses;
+ @Nullable private String _comment;
+ @Nullable private Integer _mtu;
+ @Nonnull private final String _name;
+ @Nullable private Interface _parent;
+ @Nullable private Integer _tag;
+ @Nonnull private final SortedMap<String, Interface> _units;
+ @Nullable private Zone _zone;
+
+ public Interface(@Nonnull String name) {
_active = true;
_allAddresses = new LinkedHashSet<>();
_mtu = DEFAULT_INTERFACE_MTU;
@@ -45,38 +38,47 @@ public final class Interface implements Serializable {
return _active;
}
+ @Nullable
public InterfaceAddress getAddress() {
return _address;
}
+ @Nonnull
public Set<InterfaceAddress> getAllAddresses() {
return _allAddresses;
}
+ @Nullable
public String getComment() {
return _comment;
}
+ @Nullable
public Integer getMtu() {
return _mtu;
}
+ @Nonnull
public String getName() {
return _name;
}
+ @Nullable
public Interface getParent() {
return _parent;
}
+ @Nullable
public Integer getTag() {
return _tag;
}
+ @Nonnull
public SortedMap<String, Interface> getUnits() {
return _units;
}
+ @Nullable
public Zone getZone() {
return _zone;
}
@@ -85,27 +87,27 @@ public final class Interface implements Serializable {
_active = active;
}
- public void setAddress(InterfaceAddress address) {
+ public void setAddress(@Nullable InterfaceAddress address) {
_address = address;
}
- public void setComment(String comment) {
+ public void setComment(@Nullable String comment) {
_comment = comment;
}
- public void setMtu(Integer mtu) {
+ public void setMtu(@Nullable Integer mtu) {
_mtu = mtu;
}
- public void setParent(Interface parent) {
+ public void setParent(@Nullable Interface parent) {
_parent = parent;
}
- public void setTag(Integer tag) {
+ public void setTag(@Nullable Integer tag) {
_tag = tag;
}
- public void setZone(Zone zone) {
+ public void setZone(@Nullable Zone zone) {
_zone = zone;
}
}
