Class CharacteristicUtils

java.lang.Object
ubic.gemma.model.common.description.CharacteristicUtils

public class CharacteristicUtils extends Object
  • Constructor Details

    • CharacteristicUtils

      public CharacteristicUtils()
  • Method Details

    • getNormalizedValue

      @Nullable public static String getNormalizedValue(Characteristic characteristic)
      Normalize a characteristic by value.

      This is obtained by taking the value URI or value if the former is null and converting it to lowercase.

    • hasCategory

      public static boolean hasCategory(Characteristic c, Category category)
      Check if a given characteristics has a specific category.

      Comparisons are performed as per equals(String, String, String, String).

    • getCategory

      public static Category getCategory(Characteristic t)
      Create a new characteristic that represents the category of a given characteristic.
    • getCategoryAsCharacteristic

      public static Characteristic getCategoryAsCharacteristic(Characteristic t)
    • hasValue

      public static boolean hasValue(Characteristic c, Value value)
      Check if the given characteristic has a particular value.
    • hasAnyValue

      public static boolean hasAnyValue(Characteristic c, Value... values)
      Check if the given characteristic has any of the specified values.
    • isUncategorized

      public static boolean isUncategorized(Characteristic c)
      Check if the given characteristic is uncategorized.
    • isFreeTextCategory

      public static boolean isFreeTextCategory(Characteristic c)
      Check if the given characteristic has or is a free-text category.
    • isFreeText

      public static boolean isFreeText(Characteristic c)
      Check if the given characteristic is a free-text value.
    • equals

      public static boolean equals(String a, String aUri, String b, String bUri)
      Compare a pair of ontology terms.
    • compareTerm

      public static int compareTerm(String a, @Nullable String aUri, String b, @Nullable String bUri)
      Compare a pair of ontology terms.

      Terms are sorted by label and then URI. If two term have an identical URI, this method will return zero regardless of the label.

      All URI and label comparisons are case-insensitive.