Class NamedNumber<T extends Number,U extends NamedNumber<T,?>>

java.lang.Object
org.pcap4j.packet.namednumber.NamedNumber<T,U>
Type Parameters:
T - number
U - named number
All Implemented Interfaces:
Serializable, Comparable<U>
Direct Known Subclasses:
ArpHardwareType, ArpOperation, DataLinkType, DnsClass, DnsOpCode, DnsRCode, DnsResourceRecordType, Dot11AccessNetworkType, Dot11BssMembershipSelector, Dot11ChannelUsageMode, Dot11FrameType, Dot11InformationElementId, Dot11ServiceIntervalGranularity, Dot11VenueGroup, Dot11VenueInfo, EtherType, GtpV1ExtensionHeaderType, GtpV1MessageType, GtpV2MessageType, HttpStatusCode, IcmpV4Code, IcmpV4Type, IcmpV6Code, IcmpV6Type, IpNumber, IpV4InternetTimestampOptionFlag, IpV4OptionType, IpV4SecurityOptionCompartments, IpV4SecurityOptionHandlingRestrictions, IpV4SecurityOptionSecurity, IpV4SecurityOptionTransmissionControlCode, IpV4TosPrecedence, IpV4TosTos, IpV6NeighborDiscoveryOptionType, IpV6OptionType, IpV6RoutingType, IpVersion, LinuxSllPacketType, LlcControlModifierFunction, LlcControlSupervisoryFunction, LlcNumber, NotApplicable, Oui, Port, PppDllProtocol, ProtocolFamily, RadiotapPresentBitNumber, RadiotapVhtBandwidth, SctpChunkType, Ssh2DisconnectionReasonCode, Ssh2MessageNumber, TcpOptionKind

public abstract class NamedNumber<T extends Number,U extends NamedNumber<T,?>> extends Object implements Comparable<U>, Serializable
Since:
pcap4j 0.9.1
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • value

      private final T extends Number value
    • name

      private final String name
  • Constructor Details

    • NamedNumber

      protected NamedNumber(T value, String name)
      Parameters:
      value - value
      name - name
  • Method Details

    • value

      public T value()
      Returns:
      value
    • name

      public String name()
      Returns:
      name
    • valueAsString

      public String valueAsString()
      Returns:
      a string representation of this value.
    • compareTo

      public abstract int compareTo(U o)
      Specified by:
      compareTo in interface Comparable<T extends Number>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object