com.likethesalad.tools.resource.api.collection.BasicResourceCollection.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of resource-api Show documentation
Show all versions of resource-api Show documentation
Plugin that gathers resources from Android projects for compilation purposes.
The newest version!
package com.likethesalad.tools.resource.api.collection
import com.likethesalad.tools.resource.api.Resource
open class BasicResourceCollection(
private val resources: List
) : ResourceCollection {
override fun getAllResources(): List = resources
override fun isEmpty(): Boolean = resources.isEmpty()
override fun getResourcesByType(type: Resource.Type): List {
return resources.filter { it.type() == type }
}
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is ResourceCollection) return false
if (resources != other.getAllResources()) return false
return true
}
override fun hashCode(): Int {
return resources.hashCode()
}
override fun toString(): String {
return "BasicResourceCollection(resources=$resources)"
}
}