
geotrellis.util.package.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geotrellis-util_2.10 Show documentation
Show all versions of geotrellis-util_2.10 Show documentation
GeoTrellis is an open source geographic data processing engine for high performance applications.
The newest version!
package geotrellis
package object util {
implicit def identityComponent[T]: Component[T, T] =
Component(v => v, (_, v) => v)
/** A sugar method for getting a component of an object that has
* an implicitly defined lens into a component of that object
* with a specific type.
*/
implicit class withGetComponentMethods[T](val self: T) extends MethodExtensions[T] {
def getComponent[C]()(implicit component: GetComponent[T, C]): C =
component.get(self)
}
/** A sugar method for setting a component of an object that has
* an implicitly defined lens into a component of that object
* with a specific type.
*/
implicit class withSetComponentMethods[T](val self: T) extends MethodExtensions[T] {
def setComponent[C](value: C)(implicit component: SetComponent[T, C]): T =
component.set(self, value)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy