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

com.github.elibracha.util.ChangedUtils Maven / Gradle / Ivy

package com.github.elibracha.util;


import com.github.elibracha.model.Changed;

import java.util.Optional;

public class ChangedUtils {

  public static boolean isUnchanged(Changed changed) {
    return changed == null || changed.isUnchanged();
  }

  public static boolean isCompatible(Changed changed) {
    return changed == null || changed.isCompatible();
  }

  public static  Optional isChanged(T changed) {
    if (isUnchanged(changed)) {
      return Optional.empty();
    }
    return Optional.of(changed);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy