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

io.lsdconsulting.interceptors.http.naming.RegexResolvingNameMapper.kt Maven / Gradle / Ivy

Go to download

Provides various interceptors to capture events for the lsd-core library to generate sequence diagrams

There is a newer version: 8.0.73
Show newest version
package io.lsdconsulting.interceptors.http.naming

private const val FIRST_PART_OF_PATH = "^/?(.*?)([/?].*|$)"

class RegexResolvingNameMapper : DestinationNameMappings {
    override fun mapForPath(path: String): String = path
        .replaceFirst(FIRST_PART_OF_PATH.toRegex(), "$1")

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        return javaClass == other?.javaClass
    }

    override fun hashCode(): Int {
        return javaClass.hashCode()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy