java.lang.Object
net.i2p.data.DataStructureImpl
net.i2p.data.i2cp.AbuseSeverity
All Implemented Interfaces:
Serializable, DataStructure

public class AbuseSeverityextends DataStructureImpl
Provides a severity level (larger numbers are more severe) in association with a client reporting abusive behavior to the router or the router reporting it to the client.
See Also:
  • Field Details

    • _severityId

      private int _severityId
      Numeric severity level.
  • Constructor Details

    • AbuseSeverity

      public AbuseSeverity()
      Create a new abuse severity with default value -1.
  • Method Details

    • getSeverity

      public int getSeverity()
      Severity level of the abuse.
      Returns:
      the severity level
    • setSeverity

      public void setSeverity(int id)
      New severity level of the abuse.
      Parameters:
      id - the severity level
    • readBytes

      public void readBytes(InputStream in) throws DataFormatException, IOException
      Reads the severity level from a stream.
      Parameters:
      in - stream to read from
      Throws:
      DataFormatException - if the data is improperly formatted
      IOException - if there was a problem reading the stream
    • writeBytes

      public void writeBytes(OutputStream out) throws DataFormatException, IOException
      Writes the severity level to a stream.
      Parameters:
      out - stream to write to
      Throws:
      DataFormatException - if the data was incomplete or not yet ready to be written
      IOException - if there was a problem writing to the stream
    • equals

      public boolean equals(Object object)
      Compares this abuse severity with another object for equality.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Hash code based on the severity level.
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Returns a string representation of this abuse severity.
      Overrides:
      toString in class Object