net.i2p.util

## Class VersionComparator

- java.lang.Object
- - net.i2p.util.VersionComparator

- All Implemented Interfaces:
    Serializable, Comparator<String>

      public class VersionComparator
      extends Object
      implements Comparator<String>, Serializable

  Compares versions. Characters other than [0-9.-_] are ignored. I2P only uses '.' but Sun Java uses '_' and plugins may use any of '.-_' Moved from TrustedUpdate.java
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `VersionComparator()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `comp(String l, String r)` To avoid churning comparators
    `int` | `compare(String l, String r)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.util.Comparator

      `comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

- - ### Constructor Detail

    - #### VersionComparator

          public VersionComparator()

  - ### Method Detail

    - #### comp

          public static int comp(String l,
                                 String r)

      To avoid churning comparators

    - #### compare

          public int compare(String l,
                             String r)

      Specified by:
        `compare` in interface `Comparator<String>`