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

com.likethesalad.tools.resource.api.collection.BasicResourceCollection.kt Maven / Gradle / Ivy

Go to download

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)"
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy