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

io.github.hiskrtapps.apocalypse.dao.api.criteria.Truth Maven / Gradle / Ivy

/*
 * © 2020 Ceppi Productions.
 */
package io.github.hiskrtapps.apocalypse.dao.api.criteria;

import static java.util.Arrays.copyOf;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * The {@link Truth} criteria implements the ever-true condition
 *
 */
public final class Truth extends CriteriaImpl {

  /**
   * truth constant instance/
   */
  public static final Truth INSTANCE = new Truth();

  /**
   * test template that is applied
   */
  private static final String TEMPLATE = "1 = 1";

  /**
   * always empty parameter bindings
   */
  private final Map[] bindings = new LinkedHashMap[0];

  /**
   * Creates an instance of {@link Truth}
   */
  private Truth() {
    this(Truth.class.getSimpleName());
  }

  /**
   * Creates an instance of {@link Truth}
   *
   * @param name of the {@Exists Equal} criteria
   */
  private Truth(String name) {
    super(name);
  }

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

  @Override
  public Map[] bindings() {
    return copyOf(bindings, bindings.length);
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy