All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.autonomousapps.model.Warning.kt Maven / Gradle / Ivy

There is a newer version: 2.6.1
Show newest version
package com.autonomousapps.model

import com.autonomousapps.internal.utils.LexicographicIterableComparator
import com.squareup.moshi.JsonClass

/** Warnings about the project for which the plugin cannot yet make universally actionable advice. */
@JsonClass(generateAdapter = false)
data class Warning(
  val duplicateClasses: Set,
) : Comparable {

  internal companion object {
    @JvmStatic
    fun empty() = Warning(emptySet())
  }

  override fun compareTo(other: Warning): Int {
    return LexicographicIterableComparator()
      .compare(duplicateClasses, other.duplicateClasses)
  }

  fun isEmpty(): Boolean = duplicateClasses.isEmpty()
  fun isNotEmpty(): Boolean = !isEmpty()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy