gfc-id


License

License

Apache-style
GroupId

GroupId

com.gilt
ArtifactId

ArtifactId

gfc-id_2.11
Last Version

Last Version

0.0.7
Release Date

Release Date

Type

Type

jar
Description

Description

gfc-id
gfc-id
Project Organization

Project Organization

com.gilt

Download gfc-id_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/com.gilt/gfc-id_2.11/ -->
<dependency>
    <groupId>com.gilt</groupId>
    <artifactId>gfc-id_2.11</artifactId>
    <version>0.0.7</version>
</dependency>
// https://jarcasting.com/artifacts/com.gilt/gfc-id_2.11/
implementation 'com.gilt:gfc-id_2.11:0.0.7'
// https://jarcasting.com/artifacts/com.gilt/gfc-id_2.11/
implementation ("com.gilt:gfc-id_2.11:0.0.7")
'com.gilt:gfc-id_2.11:jar:0.0.7'
<dependency org="com.gilt" name="gfc-id_2.11" rev="0.0.7">
  <artifact name="gfc-id_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.gilt', module='gfc-id_2.11', version='0.0.7')
)
libraryDependencies += "com.gilt" % "gfc-id_2.11" % "0.0.7"
[com.gilt/gfc-id_2.11 "0.0.7"]

Dependencies

compile (1)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.8

test (2)

Group / Artifact Type Version
org.scalatest : scalatest_2.11 jar 3.0.0
org.scalacheck : scalacheck_2.11 jar 1.13.4

Project Modules

There are no modules declared in this project.

gfc-id Maven Central Build Status Coverage Status Join the chat at https://gitter.im/gilt/gfc

A library that contains typed Id and Guid classes. Part of the Gilt Foundation Classes.

Getting gfc-id

The latest version is 0.0.7, which is cross-built against Scala 2.10.x, 2.11.x and 2.12.x.

If you're using SBT, add the following line to your build file:

libraryDependencies += "com.gilt" %% "gfc-id" % "0.0.7"

For Maven and other build tools, you can visit search.maven.org. (This search will also list other available libraries from the gilt fundation classes.)

Contents and Example Usage

Typed identifiers allow compile-time checking that an identifier that is passed into a function or object is of the correct type, which is not the case with "untyped" String, Long or UUID types.

com.gilt.gfc.id.Guid

Guid is a space/cpu efficient and type safe replacement for java.util.UUID

val userGuid: Guid[User] = Guid.randomGuid
val user: User = new User(userGuid, firstName, lastName)

com.gilt.gfc.id.Id

Id can be used for typed identifiers (e.g. rdbms auto-increment ids).

val userId: Id[User, Long] = Random.nextLong
val user: User = new User(userId, firstName, lastName)

Type aliases

Both Guid and Id can be used in conjunction with type aliases:

type UserGuid = Guid[User]
type UserId = Id[User, Long]
case class User(guid: UserGuid, id: UserId, firstName: String, lastName: String)

License

Copyright 2016 Gilt Groupe, Inc.

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

com.gilt

Gilt Tech

Versions

Version
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1