core


License

License

Categories

Categories

Scala Languages
GroupId

GroupId

com.github.acsgh.common.scala
ArtifactId

ArtifactId

core_2.13
Last Version

Last Version

1.2.16
Release Date

Release Date

Type

Type

jar
Description

Description

core
core
Project URL

Project URL

https://github.com/acsgh/scala-common
Project Organization

Project Organization

com.github.acsgh.common.scala
Source Code Management

Source Code Management

https://github.com/acsgh/scala-common

Download core_2.13

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.acsgh.common.scala/core_2.13/ -->
<dependency>
    <groupId>com.github.acsgh.common.scala</groupId>
    <artifactId>core_2.13</artifactId>
    <version>1.2.16</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.acsgh.common.scala/core_2.13/
implementation 'com.github.acsgh.common.scala:core_2.13:1.2.16'
// https://jarcasting.com/artifacts/com.github.acsgh.common.scala/core_2.13/
implementation ("com.github.acsgh.common.scala:core_2.13:1.2.16")
'com.github.acsgh.common.scala:core_2.13:jar:1.2.16'
<dependency org="com.github.acsgh.common.scala" name="core_2.13" rev="1.2.16">
  <artifact name="core_2.13" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.acsgh.common.scala', module='core_2.13', version='1.2.16')
)
libraryDependencies += "com.github.acsgh.common.scala" % "core_2.13" % "1.2.16"
[com.github.acsgh.common.scala/core_2.13 "1.2.16"]

Dependencies

compile (5)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.13.2
com.beachape : enumeratum_2.13 jar 1.6.1
com.typesafe.scala-logging : scala-logging_2.13 jar 3.9.2
org.slf4j : slf4j-api jar 1.7.30
ch.qos.logback : logback-classic jar 1.2.3

test (4)

Group / Artifact Type Version
org.scalatest : scalatest_2.13 jar 3.2.0
org.scalacheck : scalacheck_2.13 jar 1.14.3
org.pegdown : pegdown jar 1.6.0
org.scalamock : scalamock_2.13 jar 4.4.0

Project Modules

There are no modules declared in this project.

scala-common

Common utils used in several projects

Build Status Maven Central

Log support

Forget about initiate your log just extends your class / object with

import com.acsgh.common.scala.log.LogSupport

object Foo extends LogSupport {
  log.info("Hello world")
}

Stop Watch

Utility to measure time in your code

import com.acsgh.common.scala.time.StopWatch
import com.acsgh.common.scala.log.LogLevel

val stopWatch = StopWatch.createStarted()
try{
// YOUR CODE HERE
} finally {
  stopWatch.printElapseTime("Important stuff", log, LogLevel.INFO)
}

It will print: 'Important stuff in 234 milliseconds'

Reentrant locks

Utility to run safe locking in scala

Simple

import com.acsgh.common.scala.lock.ReentrantLock

val simpleLock = ReentrantLock()

simpleLock.run{
 1 + 1
}

val result = simpleLock.get {
 1 + 1
}

Read/Write

import com.acsgh.common.scala.lock.ReentrantReadWriteLock

val simpleLock = ReentrantLock()

simpleLock.write{
 1 + 1
}

val writeResult = simpleLock.write {
 1 + 1
}

val readResult = simpleLock.read {
 1 + 1
}

Versions

Version
1.2.16
1.2.15
1.2.14
1.2.13
1.2.12
1.2.4
1.0.6