Skip to content

MicroISRC is a Java library designed to generate valid ISRCs using your purchased prefixes (Country Code + Registrant Code) for any year.

License

Notifications You must be signed in to change notification settings

Valkryst/MicroISRC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MicroISRC is a Java library designed to generate valid ISRCs using your purchased prefixes (Country Code + Registrant Code) for any year.

Table of Contents

Installation

MicroISRC is hosted on the JitPack package repository which supports Gradle, Maven, and sbt.

Gradle Gradle

Add JitPack to your build.gradle at the end of repositories.

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Add MicroISRC as a dependency.

dependencies {
	implementation 'com.github.Valkryst:MicroISRC:1.1.0'
}

Maven Maven

Add JitPack as a repository.

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Add MicroISRC as a dependency.

<dependency>
    <groupId>com.github.Valkryst</groupId>
    <artifactId>MicroISRC</artifactId>
    <version>1.1.0</version>
</dependency>

Scala SBT Scala SBT

Add JitPack as a resolver.

resolvers += "jitpack" at "https://jitpack.io"

Add MicroISRC as a dependency.

libraryDependencies += "com.github.Valkryst" % "MicroISRC" % "1.1.0"

ISRCRepository

This library has been designed in such a way as to make it agnostic of the backend storage required to enable its use.

To use MicroISRC you must first write a class which implements the ISRCRepository interface, then you can initialize and use the ISRCGenerator as follows:

import com.valkryst.MicroISRC.ISRCGenerator;
import com.valkryst.MicroISRC.repository.ISRCRepository;

import java.time.Year;
import java.time.ZoneId;

public class Example {
    public static void main(final String[] args) {
        final ISRCRepository repository = null; // Initialize this using your implementation of ISRCRepository.

        final ISRCGenerator generator = ISRCGenerator.getInstance();
        generator.setRepository(repository);

        final Year currentYear = Year.of(ZoneId.systemDefault());
        System.out.println(generator.generate(currentYear));
    }
}

Implementations of ISRCRepository must adhere to the documentation of the interface and its methods, with special care required to ensure the methods are atomic and thread-safe. An example can be found here.

About

MicroISRC is a Java library designed to generate valid ISRCs using your purchased prefixes (Country Code + Registrant Code) for any year.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Languages