java.lang.Object
org.qubership.atp.environments.model.utils.Utils

public class Utils extends Object
  • Field Details

    • JOINER_DOT

      public static final com.google.common.base.Joiner JOINER_DOT
  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • emptySup

      @Nonnull public static <T> Supplier<T> emptySup()
    • isEqual

      public static boolean isEqual(@Nonnull Identified o1, @Nullable Object o2)
      To not to copy paste Object.equals(Object) logic.
      Parameters:
      o1 - object to compare with o2
      o2 - object to compare with o1
      Returns:
      true if equals
    • isEqual

      public static <T extends Identified> boolean isEqual(@Nonnull Class<T> clazz, @Nonnull T o1, @Nullable Object o2)
      To not to copy paste Object.equals(Object) logic.
      Type Parameters:
      T - general superclass of o1 and o2
      Parameters:
      clazz - general superclass of o1 and o2
      o1 - object to compare with o2
      o2 - object to compare with o1
      Returns:
      true if equals
    • isEqual

      public static <T extends Identified> boolean isEqual(@Nonnull Class<T> clazz, @Nonnull UUID id, @Nullable Object target)
      Checks target object has expected class and id.
      Type Parameters:
      T - type
      Parameters:
      clazz - which should be extended by target
      id - expected id of target
      target - checking object
      Returns:
      true if target has expected type and id