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

com.hubspot.baragon.agent.handlebars.IfEqualHelperSource Maven / Gradle / Ivy

There is a newer version: 0.6.2
Show newest version
package com.hubspot.baragon.agent.handlebars;

import java.io.IOException;

import com.github.jknack.handlebars.Options;
import com.google.common.base.Optional;

public class IfEqualHelperSource {
  public static CharSequence ifEqual(String v1, String v2, Options options) throws IOException {
    if (v1 == null ? v2 == null : v1.equals(v2)) {
      return options.fn();
    } else {
      return options.inverse();
    }
  }

  public static CharSequence ifOptionalEqual(Optional v1, Optional v2, Options options) throws IOException {
    if (v1.equals(v2)) {
      return options.fn();
    } else {
      return options.inverse();
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy