Class Weighted<T>

java.lang.Object
io.micronaut.jaxrs.runtime.core.Weighted<T>
Type Parameters:
T - The object type
All Implemented Interfaces:
Comparable<Weighted<T>>

public class Weighted<T> extends Object implements Comparable<Weighted<T>>
Used to compare objects be weighted value.
Since:
1.0
Author:
graemerocher
  • Constructor Details

    • Weighted

      public Weighted(T object, Map<String,String> parameters)
      Constructor that takes parameters.
      Parameters:
      object - The object
      parameters - An optional map of parameters. If a "q" variable is found try to use it to weigh.
    • Weighted

      public Weighted(T object, float weight)
      Default constructor.
      Parameters:
      object - The object
      weight - The weight
    • Weighted

      public Weighted(T object)
      Construct with the default weight.
      Parameters:
      object - The Object
  • Method Details

    • getObject

      public T getObject()
      Returns:
      The object
    • getWeight

      public float getWeight()
      Returns:
      The weight
    • compareTo

      public int compareTo(Weighted<T> o)
      Specified by:
      compareTo in interface Comparable<T>
    • parseParameters

      public static Map<String,String> parseParameters(String str)
      Parse the parameters that come after the semicolon.
      Parameters:
      str - The string
      Returns:
      The parameters