Class VersionFunctionBuilder<T,V>

java.lang.Object
de.eldoria.eldoutilities.crossversion.builder.VersionFunctionBuilder<T,V>
Direct Known Subclasses:
BiFunctionBuilder, FunctionBuilder, QuadFunctionBuilder, TriFunctionBuilder

public abstract class VersionFunctionBuilder<T,V> extends Object
Interface to create different function builders.
  • Field Details

  • Constructor Details

    • VersionFunctionBuilder

      public VersionFunctionBuilder()
  • Method Details

    • functionBuilder

      public static <A, R> FunctionBuilder<A,R> functionBuilder(Class<A> a, Class<R> r)
      Get a function builder.
      Type Parameters:
      A - first input type
      R - result type
      Parameters:
      a - first input type class
      r - result type class
      Returns:
      a new function builder instance
    • biFunctionBuilder

      public static <A, B, R> BiFunctionBuilder<A,B,R> biFunctionBuilder(Class<A> a, Class<B> b, Class<R> r)
      Get a bi function builder
      Type Parameters:
      A - first input type
      B - second input type
      R - result type
      Parameters:
      a - first input type class
      b - second input type class
      r - result type class
      Returns:
      a new bi function builder instance
    • triFunctionBuilder

      public static <A, B, C, R> TriFunctionBuilder<A,B,C,R> triFunctionBuilder(Class<A> a, Class<B> b, Class<C> c, Class<R> r)
      Get a tri function builder.
      Type Parameters:
      A - first input type
      B - second input type
      C - third input type
      R - result type
      Parameters:
      a - first input type class
      b - second input type class
      c - third input type class
      r - result type class
      Returns:
      new tri function builder instance
    • quadFunctionBuilder

      public static <A, B, C, D, R> QuadFunctionBuilder<A,B,C,D,R> quadFunctionBuilder(Class<A> a, Class<B> b, Class<C> c, Class<D> d, Class<R> r)
      Get a quad function builder.
      Type Parameters:
      A - first input type
      B - second input type
      C - third input type
      D - fourth input type
      R - result type
      Parameters:
      a - first input type class
      b - second input type class
      c - third input type class
      d - fourth input type class
      r - result type class
      Returns:
      new quad function builder instance
    • addVersionFunction

      @Deprecated(forRemoval=true) public VersionFunctionBuilder<T,V> addVersionFunction(V function, VersionRange version)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Add a version function which should be used on one or more versions.
      Parameters:
      function - function to execute
      version - versions which should use this function
      Returns:
      builder instance with function applied for versions
    • addVersion

      public VersionFunctionBuilder<T,V> addVersion(VersionRange version, V function)
      Add a version function which should be used on one or more versions.
      Parameters:
      function - function to execute
      version - versions which should use this function
      Returns:
      builder instance with function applied for versions
    • addVersionFunctionBetween

      @Deprecated(forRemoval=true) public VersionFunctionBuilder<T,V> addVersionFunctionBetween(Version oldest, Version newest, V function)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Add a version functions for all versions between two versions.
      Parameters:
      oldest - oldest version (inclusive)
      newest - newest version (exclusive)
      function - function to execute
      Returns:
      builder instance with function applied for versions
    • addExclusiveVersion

      public VersionFunctionBuilder<T,V> addExclusiveVersion(Version oldest, Version newest, V function)
      Add a version functions for all versions between two versions.
      Parameters:
      oldest - oldest version (inclusive)
      newest - newest version (exclusive)
      function - function to execute
      Returns:
      builder instance with function applied for versions
    • addInclusiveVersion

      public VersionFunctionBuilder<T,V> addInclusiveVersion(Version oldest, Version newest, V function)
      Add a version functions for all versions between two versions.
      Parameters:
      oldest - oldest version (inclusive)
      newest - newest version (inclusive)
      function - function to execute
      Returns:
      builder instance with function applied for versions
    • build

      public abstract T build()
      Build the version function.
      Returns:
      version functions with applied functions for versions.