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

com.scalar.db.storage.dynamo.Namespace Maven / Gradle / Ivy

Go to download

A universal transaction manager that achieves database-agnostic transactions and distributed transactions that span multiple databases

There is a newer version: 3.14.0
Show newest version
package com.scalar.db.storage.dynamo;

public class Namespace {
  private final String prefix;
  private final String name;

  private Namespace(String prefix, String name) {
    if (prefix == null) {
      throw new IllegalArgumentException("The prefix cannot be null");
    }
    if (name == null) {
      throw new IllegalArgumentException("The namespace name cannot be null");
    }
    this.prefix = prefix;
    this.name = name;
  }

  public static Namespace of(String prefix, String name) {
    return new Namespace(prefix, name);
  }

  public static Namespace of(String name) {
    return new Namespace("", name);
  }

  public String prefixed() {
    return prefix + name;
  }

  public String nonPrefixed() {
    return name;
  }

  @Override
  public String toString() {
    return prefixed();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy